From 8279eb3a4e9d6a29550d0395ce751061271616b8 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Niklas=20Hamb=C3=BCchen?= Date: Thu, 14 Oct 2010 22:57:15 +0100 Subject: [PATCH] Fix wallpaper flickering on workspace switch by mapping new clients before unmapping old clients --- src/workspace.c | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/src/workspace.c b/src/workspace.c index 291f754a..40f68bf8 100644 --- a/src/workspace.c +++ b/src/workspace.c @@ -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 -- 2.39.5