event.c
changeset 953 d7de5c7bdbe4
parent 946 b938876de936
child 956 484245788760
equal deleted inserted replaced
952:4f66942cc63b 953:d7de5c7bdbe4
     2 #include "dwm.h"
     2 #include "dwm.h"
     3 #include <stdio.h>
     3 #include <stdio.h>
     4 #include <stdlib.h>
     4 #include <stdlib.h>
     5 #include <X11/keysym.h>
     5 #include <X11/keysym.h>
     6 #include <X11/Xatom.h>
     6 #include <X11/Xatom.h>
       
     7 #include <X11/Xutil.h>
     7 
     8 
     8 /* static */
     9 /* static */
     9 
    10 
    10 typedef struct {
    11 typedef struct {
    11 	unsigned long mod;
    12 	unsigned long mod;
   224 destroynotify(XEvent *e) {
   225 destroynotify(XEvent *e) {
   225 	Client *c;
   226 	Client *c;
   226 	XDestroyWindowEvent *ev = &e->xdestroywindow;
   227 	XDestroyWindowEvent *ev = &e->xdestroywindow;
   227 
   228 
   228 	if((c = getclient(ev->window)))
   229 	if((c = getclient(ev->window)))
   229 		unmanage(c);
   230 		unmanage(c, WithdrawnState);
   230 }
   231 }
   231 
   232 
   232 static void
   233 static void
   233 enternotify(XEvent *e) {
   234 enternotify(XEvent *e) {
   234 	Client *c;
   235 	Client *c;
   336 	Client *c;
   337 	Client *c;
   337 	XUnmapEvent *ev = &e->xunmap;
   338 	XUnmapEvent *ev = &e->xunmap;
   338 
   339 
   339 	if((c = getclient(ev->window)) && (ev->event == root)) {
   340 	if((c = getclient(ev->window)) && (ev->event == root)) {
   340 		if(ev->send_event || c->unmapped-- == 0)
   341 		if(ev->send_event || c->unmapped-- == 0)
   341 			unmanage(c);
   342 			unmanage(c, WithdrawnState);
   342 	}
   343 	}
   343 }
   344 }
   344 
   345 
   345 /* extern */
   346 /* extern */
   346 
   347