Migrate i3 rendering to cairo.
This patch migrates all decoration rendering of i3 to cairo. Using the compile switch CAIRO_SUPPORT, rendering can be switched back to the previous XCB behavior, just like with the previous migration to cairo in i3bar. This patch also fixes a bug in draw_util.c where copying one surface to another would use incorrect coordinates if the source coordinates are not 0, 0. Furthermore, this patch implicitly fixes some minor issues in the decoration rendering which would be ignored previously due to the fact that errors would only show up in the event queue, but not cause the rendering code path to crash. One example is zero-height pixmaps which are not allowed. Using cairo, these would cause i3 to instantly segfault, so this patch avoids this. Lastly, this patch annotates other issues found but not fixed in this patch using TODO comments, e.g., the zero-height check not working correctly and the comment that it should probably work the same way for zero-width pixmaps. relates to #1278
This commit is contained in:
@ -656,15 +656,14 @@ static void handle_expose_event(xcb_expose_event_t *event) {
|
||||
return;
|
||||
}
|
||||
|
||||
/* Since we render to our pixmap on every change anyways, expose events
|
||||
/* Since we render to our surface on every change anyways, expose events
|
||||
* only tell us that the X server lost (parts of) the window contents. We
|
||||
* can handle that by copying the appropriate part from our pixmap to the
|
||||
* can handle that by copying the appropriate part from our surface to the
|
||||
* window. */
|
||||
xcb_copy_area(conn, parent->pixmap, parent->frame, parent->pm_gc,
|
||||
event->x, event->y, event->x, event->y,
|
||||
event->width, event->height);
|
||||
draw_util_copy_surface(conn, &(parent->frame_buffer), &(parent->frame),
|
||||
event->x, event->y, event->x, event->y,
|
||||
event->width, event->height);
|
||||
xcb_flush(conn);
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user