summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPřemysl Eric Janouch <p@janouch.name>2023-03-25 11:08:30 +0100
committerPřemysl Eric Janouch <p@janouch.name>2023-03-25 11:10:26 +0100
commit349c907cbf1cba6988b971073f84a91ffdc8074d (patch)
tree6ff4d9d3b27bfdc8639341b93a7fb2e89a1ba2a4
parent0b62b2a788e4773a0be03e5b10c86f553efa5117 (diff)
downloadnncmpp-349c907cbf1cba6988b971073f84a91ffdc8074d.tar.gz
nncmpp-349c907cbf1cba6988b971073f84a91ffdc8074d.tar.xz
nncmpp-349c907cbf1cba6988b971073f84a91ffdc8074d.zip
X11: act on DestroyNotify rather than UnmapNotify
This makes the program survive i3 restarts, which cause a sequence of: UnmapNotify, ReparentNotify, MapNotify.
-rw-r--r--nncmpp.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/nncmpp.c b/nncmpp.c
index 17c7685..e4e24cd 100644
--- a/nncmpp.c
+++ b/nncmpp.c
@@ -6748,7 +6748,10 @@ on_x11_event (XEvent *ev)
case SelectionClear:
cstr_set (&g.x11_selection, NULL);
break;
- case UnmapNotify:
+ // UnmapNotify can be received when restarting the window manager.
+ // Should this turn out to be unreliable (window not destroyed by WM
+ // upon closing), opt for the WM_DELETE_WINDOW protocol as well.
+ case DestroyNotify:
app_quit ();
break;
case FocusIn: