openbsd-ports/x11/i3/patches/patch-src_tree_c
dcoppa adde8dc487 Bugfix: Unmap windows before reparenting them to the root window
(upstream git commit 62ef7834b042409acb99f0a030729c806be69335)
2013-06-02 12:25:53 +00:00

31 lines
1.3 KiB
Plaintext

$OpenBSD: patch-src_tree_c,v 1.5 2013/06/02 12:25:53 dcoppa Exp $
commit 62ef7834b042409acb99f0a030729c806be69335
Author: Michael Stapelberg <michael@stapelberg.de>
Date: Tue May 28 19:52:01 2013 +0200
Bugfix: Unmap windows before reparenting them to the root window
Some apps such as Mathematica send a synthetic UnmapNotify event
without properly unmapping their window first. This change makes
sure that happens and fixes an annoying bug with Mathematica where
some unmanaged windows would stay around, but you couldn't do
anything with them.
--- src/tree.c.orig Mon Mar 18 22:43:36 2013
+++ src/tree.c Sun Jun 2 13:51:02 2013
@@ -235,7 +235,12 @@ bool tree_close(Con *con, kill_window_t kill_window, b
return false;
} else {
xcb_void_cookie_t cookie;
- /* un-parent the window */
+ /* Ignore any further events by clearing the event mask,
+ * unmap the window,
+ * then reparent it to the root window. */
+ xcb_change_window_attributes(conn, con->window->id,
+ XCB_CW_EVENT_MASK, (uint32_t[]){ XCB_NONE });
+ xcb_unmap_window(conn, con->window->id);
cookie = xcb_reparent_window(conn, con->window->id, root, 0, 0);
/* Ignore X11 errors for the ReparentWindow request.