[hackers] [tabbed] tabbed: UnmapNotify patch || Okan Demirmen

From: <git_AT_suckless.org>
Date: Sat, 13 Sep 2014 07:57:15 +0200

commit 5c560f3784971b1a3bbfc7d18af759778f7779d1
Author: Okan Demirmen <okan_AT_demirmen.com>
Date: Wed Sep 10 13:50:34 2014 -0400

    tabbed: UnmapNotify patch
    
    Hi,
    
    Simple patch for tabbed that prevents tabbed from killing a client that it
    should no longer be managing due to an UnmapNotify event.
    
    Add support for UnmapNotify; allows a window to map and unmap without
    needing it to be destroyed.
    
    Thanks,
    Okan
    
    Signed-off-by: Christoph Lohmann <20h_AT_r-36.net>

diff --git a/tabbed.c b/tabbed.c
index 6a2264f..68281ac 100644
--- a/tabbed.c
+++ b/tabbed.c
_AT_@ -93,6 +93,7 @@ static void clientmessage(const XEvent *e);
 static void configurenotify(const XEvent *e);
 static void configurerequest(const XEvent *e);
 static void createnotify(const XEvent *e);
+static void unmapnotify(const XEvent *e);
 static void destroynotify(const XEvent *e);
 static void die(const char *errstr, ...);
 static void drawbar(void);
_AT_@ -141,6 +142,7 @@ static void (*handler[LASTEvent]) (const XEvent *) = {
         [ConfigureNotify] = configurenotify,
         [ConfigureRequest] = configurerequest,
         [CreateNotify] = createnotify,
+ [UnmapNotify] = unmapnotify,
         [DestroyNotify] = destroynotify,
         [Expose] = expose,
         [FocusIn] = focusin,
_AT_@ -286,6 +288,15 @@ createnotify(const XEvent *e) {
 }
 
 void
+unmapnotify(const XEvent *e) {
+ const XUnmapEvent *ev = &e->xunmap;
+ int c;
+
+ if((c = getclient(ev->window)) > -1)
+ unmanage(c);
+}
+
+void
 destroynotify(const XEvent *e) {
         const XDestroyWindowEvent *ev = &e->xdestroywindow;
         int c;
Received on Sat Sep 13 2014 - 07:57:15 CEST

This archive was generated by hypermail 2.3.0 : Sat Sep 13 2014 - 08:00:17 CEST