From f7fe89ab59a25c6e23db56b94b6243915fd5ecdb Mon Sep 17 00:00:00 2001
From: Olivier Fourdan <fourdan@xfce.org>
Date: Mon, 1 May 2017 22:23:41 +0200
Subject: [PATCH] Flush display to catch possible errors

Otherwise the current WM window might have vanished and we wouldn't
know.
---
 src/screen.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/src/screen.c b/src/screen.c
index fc7c6085d..3cdc7cbb7 100644
--- a/src/screen.c
+++ b/src/screen.c
@@ -108,6 +108,7 @@ myScreenSetWMAtom (ScreenInfo *screen_info, gboolean replace_wm)
         gdk_error_trap_push ();
         attrs.event_mask = StructureNotifyMask;
         XChangeWindowAttributes (display_info->dpy, current_wm, CWEventMask, &attrs);
+        gdk_flush ();
         if (gdk_error_trap_pop ())
         {
             current_wm = None;
-- 
GitLab