]> git.sur5r.net Git - i3/i3/commitdiff
Fix wallpaper flickering on workspace switch by mapping new clients before unmapping...
authorNiklas Hambüchen <mail@nh2.me>
Thu, 14 Oct 2010 21:57:15 +0000 (22:57 +0100)
committerMichael Stapelberg <michael@stapelberg.de>
Sun, 17 Oct 2010 16:21:01 +0000 (18:21 +0200)
src/workspace.c

index 291f754adf29784ab278c5cf497164ac12ba6296..40f68bf8332e4b5a67ea58da3584201fdaf63826 100644 (file)
@@ -175,17 +175,18 @@ void workspace_show(xcb_connection_t *conn, int workspace) {
         Workspace *old_workspace = c_ws;
         c_ws = t_ws->output->current_workspace = workspace_get(workspace-1);
 
-        /* Unmap all clients of the old workspace */
-        workspace_unmap_clients(conn, old_workspace);
-
         current_row = c_ws->current_row;
         current_col = c_ws->current_col;
         DLOG("new current row = %d, current col = %d\n", current_row, current_col);
 
-        ipc_send_event("workspace", I3_IPC_EVENT_WORKSPACE, "{\"change\":\"focus\"}");
-
+        /* Map new clients before unmapping old clients to prevent wallpaper flickering */
         workspace_map_clients(conn, c_ws);
 
+        /* Unmap all clients of the old workspace */
+        workspace_unmap_clients(conn, old_workspace);
+
+        ipc_send_event("workspace", I3_IPC_EVENT_WORKSPACE, "{\"change\":\"focus\"}");
+
         /* POTENTIAL TO IMPROVE HERE: due to the call to _map_clients first and
          * render_layout afterwards, there is a short flickering on the source
          * workspace (assign ws 3 to output 0, ws 4 to output 1, create single