]> git.sur5r.net Git - i3/i3/blobdiff - src/layout.c
Some little fixes (mostly formatting) for bapt’s patch
[i3/i3] / src / layout.c
index e70d0f49682217376d50d1512d87217eda3030d4..89c561eae83ab79a3071769ea46db477cc19c216 100644 (file)
@@ -188,6 +188,11 @@ void reposition_client(xcb_connection_t *conn, Client *client) {
         if (client->workspace->screen == (screen = get_screen_containing(client->rect.x, client->rect.y)))
                 return;
 
+        if (screen == NULL) {
+                LOG("Boundary checking disabled, no screen found for (%d, %d)\n", client->rect.x, client->rect.y);
+                return;
+        }
+
         LOG("Client is on workspace %p with screen %p\n", client->workspace, client->workspace->screen);
         LOG("but screen at %d, %d is %p\n", client->rect.x, client->rect.y, screen);
         floating_assign_to_workspace(client, &workspaces[screen->current_workspace]);
@@ -357,6 +362,9 @@ void render_container(xcb_connection_t *conn, Container *container) {
                         xcb_configure_window(conn, stack_win->window, mask, values);
                 }
 
+                /* Prepare the pixmap for usage */
+                cached_pixmap_prepare(conn, &(stack_win->pixmap));
+
                 /* Render the decorations of all clients */
                 CIRCLEQ_FOREACH(client, &(container->clients), clients) {
                         /* If the client is in fullscreen mode, it does not get reconfigured */
@@ -379,9 +387,12 @@ void render_container(xcb_connection_t *conn, Container *container) {
 
                         client->force_reconfigure = false;
 
-                        decorate_window(conn, client, stack_win->window, stack_win->gc,
+                        decorate_window(conn, client, stack_win->pixmap.id, stack_win->pixmap.gc,
                                         current_client++ * decoration_height);
                 }
+
+                xcb_copy_area(conn, stack_win->pixmap.id, stack_win->window, stack_win->pixmap.gc,
+                              0, 0, 0, 0, stack_win->rect.width, stack_win->rect.height);
         }
 }