summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRichard Grenville <pyxlcy@gmail.com>2013-03-03 21:53:08 +0800
committerRichard Grenville <pyxlcy@gmail.com>2013-03-03 21:53:08 +0800
commitdc4da095bb876c4ba2b77050b35883e59af944a6 (patch)
tree3c5be51366366ed3acce15d57db82663f1f34cfb
parent71fdda46e615df29ac1b2c8d3d1984a7be3b44fd (diff)
downloadtdebase-dc4da095bb876c4ba2b77050b35883e59af944a6.tar.gz
tdebase-dc4da095bb876c4ba2b77050b35883e59af944a6.zip
Bug fix #93: Assertion failure when window reparented
- Fix an assertion failure that occurs when a window is reparented to the root window then immediately to another window. Thanks to smlx for reporting. - Add extra debugging info for ReparentNotify.
-rw-r--r--compton.c13
1 files changed, 10 insertions, 3 deletions
diff --git a/compton.c b/compton.c
index edd387823..ff1dd4975 100644
--- a/compton.c
+++ b/compton.c
@@ -2505,9 +2505,11 @@ add_win(session_t *ps, Window id, Window prev) {
new->id = id;
set_ignore_next(ps);
- if (!XGetWindowAttributes(ps->dpy, id, &new->a)) {
- // Failed to get window attributes. Which probably means, the window
- // is gone already.
+ if (!XGetWindowAttributes(ps->dpy, id, &new->a)
+ || IsUnviewable == new->a.map_state) {
+ // Failed to get window attributes probably means the window is gone
+ // already. IsUnviewable means the window is already reparented
+ // elsewhere.
free(new);
return false;
}
@@ -3446,6 +3448,11 @@ ev_unmap_notify(session_t *ps, XUnmapEvent *ev) {
inline static void
ev_reparent_notify(session_t *ps, XReparentEvent *ev) {
+#ifdef DEBUG_EVENTS
+ printf_dbg(" { new_parent: %#010lx, override_redirect: %d }\n",
+ ev->parent, ev->override_redirect);
+#endif
+
if (ev->parent == ps->root) {
add_win(ps, ev->window, 0);
} else {