changeset 3121:42ae3bebb840

Updated #266: Updated handling of close messages for clients and trays
author unexist
date Fri, 11 Nov 2011 15:22:13 +0100
parents 73e63dc190a6
children 94ff54dd6e4a
files src/subtle/client.c src/subtle/event.c
diffstat 2 files changed, 6 insertions(+), 18 deletions(-) [+]
line wrap: on
line diff
--- a/src/subtle/client.c	Fri Nov 11 15:21:33 2011 +0100
+++ b/src/subtle/client.c	Fri Nov 11 15:22:13 2011 +0100
@@ -1646,6 +1646,8 @@
   subSharedPropertyDelete(subtle->dpy, c->win,
     subEwmhGet(SUB_EWMH_NET_WM_STATE));
 
+  /* Ignore further events and delete context */
+  XSelectInput(subtle->dpy, c->win, NoEventMask);
   XDeleteContext(subtle->dpy, c->win, CLIENTID);
 
   /* Remove client tags from urgent tags */
--- a/src/subtle/event.c	Fri Nov 11 15:21:33 2011 +0100
+++ b/src/subtle/event.c	Fri Nov 11 15:22:13 2011 +0100
@@ -348,10 +348,6 @@
   /* Check if we know this window */
   if((c = CLIENT(subSubtleFind(ev->window, CLIENTID)))) ///< Client
     {
-      /* Ignore remaining events */
-      c->flags |= SUB_CLIENT_DEAD;
-      XSelectInput(subtle->dpy, c->win, NoEventMask);
-
       /* Kill client */
       subArrayRemove(subtle->clients, (void *)c);
       subClientKill(c);
@@ -884,7 +880,7 @@
       t->flags &= ~SUB_TRAY_DEAD;
 
       subTrayUpdate();
-      subScreenConfigure();
+      subScreenUpdate();
       subScreenRender();
     }
 
@@ -1407,12 +1403,7 @@
       switch(subEwmhFind(ev->message_type))
         {
           case SUB_EWMH_NET_CLOSE_WINDOW: /* {{{ */
-            subArrayRemove(subtle->trays, (void *)r);
-            subTrayKill(r);
-            subTrayPublish();
-            subTrayUpdate();
-            subScreenUpdate();
-            subScreenRender();
+            subTrayClose(r);
             break; /* }}} */
           default: break;
         }
@@ -1652,10 +1643,7 @@
           return;
         }
 
-      /* Kill client */
-      c->flags |= SUB_CLIENT_DEAD;
-      XSelectInput(subtle->dpy, c->win, NoEventMask);
-
+      /*  Kill client */
       subArrayRemove(subtle->clients, (void *)c);
       subClientKill(c);
       subClientPublish(False);
@@ -1672,7 +1660,7 @@
       /* Set withdrawn state (see ICCCM 4.1.4) */
       subEwmhSetWMState(t->win, WithdrawnState);
 
-      /* Ignore out own generated unmap events */
+      /* Ignore our own generated unmap events */
       if(t->flags & SUB_TRAY_UNMAP)
         {
           t->flags &= ~SUB_TRAY_UNMAP;
@@ -1681,8 +1669,6 @@
         }
 
       /*  Kill tray */
-      t->flags |= SUB_TRAY_DEAD;
-
       subArrayRemove(subtle->trays, (void *)t);
       subTrayKill(t);
       subTrayUpdate();