forked from pyrite-dev/milsko
wayland: fallback if selected_cairo is null
This commit is contained in:
parent
2499f82933
commit
09441380b5
2 changed files with 4 additions and 2 deletions
|
|
@ -235,6 +235,7 @@ struct _MwLLWayland {
|
|||
cairo_surface_t* back_cs;
|
||||
cairo_t* front_cairo;
|
||||
cairo_t* back_cairo;
|
||||
/* The cairo to actually use for draw operations. Typically is front_cairo, but MwLLBeginDraw can change this to the back_cairo so it can be used to draw window decorations. */
|
||||
cairo_t* selected_cairo;
|
||||
};
|
||||
|
||||
|
|
|
|||
|
|
@ -1960,6 +1960,7 @@ static void MwLLDestroyPixmapImpl(MwLLPixmap pixmap) {
|
|||
static void MwLLDrawPixmapImpl(MwLL handle, MwRect* rect, MwLLPixmap pixmap) {
|
||||
cairo_t* c;
|
||||
cairo_surface_t* cs;
|
||||
cairo_t * selected_cairo = handle->wayland.selected_cairo ? handle->wayland.selected_cairo : handle->wayland.front_cairo;
|
||||
|
||||
cs = cairo_image_surface_create(CAIRO_FORMAT_ARGB32, rect->width, rect->height);
|
||||
c = cairo_create(cs);
|
||||
|
|
@ -1973,8 +1974,8 @@ static void MwLLDrawPixmapImpl(MwLL handle, MwRect* rect, MwLLPixmap pixmap) {
|
|||
|
||||
cairo_paint(c);
|
||||
|
||||
cairo_set_source_surface(handle->wayland.selected_cairo, cs, rect->x, rect->y);
|
||||
cairo_paint(handle->wayland.selected_cairo);
|
||||
cairo_set_source_surface(selected_cairo, cs, rect->x, rect->y);
|
||||
cairo_paint(selected_cairo);
|
||||
|
||||
cairo_destroy(c);
|
||||
cairo_surface_destroy(cs);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue