Handle destroy notify events like unmap notify events
This helps for windows which are immediately destroyed instead of unmapped, like when starting i3status | ./foobar | dzen2 -dock and foobar does not exist (i3status and dzen2 will get a SIGPIPE).
This commit is contained in:
@ -571,6 +571,26 @@ int handle_unmap_notify_event(void *data, xcb_connection_t *conn, xcb_unmap_noti
|
||||
return 1;
|
||||
}
|
||||
|
||||
/*
|
||||
* A destroy notify event is sent when the window is not unmapped, but
|
||||
* immediately destroyed (for example when starting a window and immediately
|
||||
* killing the program which started it).
|
||||
*
|
||||
* We just pass on the event to the unmap notify handler (by copying the
|
||||
* important fields in the event data structure).
|
||||
*
|
||||
*/
|
||||
int handle_destroy_notify_event(void *data, xcb_connection_t *conn, xcb_destroy_notify_event_t *event) {
|
||||
DLOG("destroy notify for 0x%08x, 0x%08x\n", event->event, event->window);
|
||||
|
||||
xcb_unmap_notify_event_t unmap;
|
||||
unmap.sequence = event->sequence;
|
||||
unmap.event = event->event;
|
||||
unmap.window = event->window;
|
||||
|
||||
return handle_unmap_notify_event(NULL, conn, &unmap);
|
||||
}
|
||||
|
||||
/*
|
||||
* Called when a window changes its title
|
||||
*
|
||||
|
Reference in New Issue
Block a user