summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJon TURNEY <jon.turney@dronecode.org.uk>2013-07-01 14:43:46 +0100
committerJon TURNEY <jon.turney@dronecode.org.uk>2013-07-01 14:43:46 +0100
commit62a2635431023f4b0b77579cf3d8433af97ea5a6 (patch)
tree16697c1e823373260e49ed2ab23dbfd307426295
parent27bc9bf634c87ae282e205121bf4507f0c46ba2c (diff)
Handle WM_XCWM_EXIT
-rw-r--r--src/main.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/src/main.c b/src/main.c
index 038f597..bf32e76 100644
--- a/src/main.c
+++ b/src/main.c
@@ -33,6 +33,7 @@
#define WM_XCWM_CREATE WM_USER
#define WM_XCWM_DESTROY (WM_USER+1)
#define WM_XCWM_CURSOR (WM_USER+2)
+#define WM_XCWM_EXIT (WM_USER+3)
#define XCWM_EVENT_WINDOW_ICON 100
@@ -102,6 +103,10 @@ eventHandler(const xcwm_event_t *event)
*/
PostThreadMessage(msgPumpThread, WM_XCWM_CURSOR, 0, 0);
break;
+
+ case XCWM_EVENT_EXIT:
+ PostThreadMessage(msgPumpThread, WM_XCWM_EXIT, 0, 0);
+ break;
}
}
@@ -289,13 +294,15 @@ int main(int argc, char **argv)
}
else if (msg.message == WM_XCWM_CURSOR)
UpdateCursor();
+ else if (msg.message == WM_XCWM_EXIT)
+ PostQuitMessage(0);
else
DispatchMessage(&msg);
}
// Shutdown:
+ // if server died, we get a error from xcb, which causes XCWM_EVENT_EXIT to be sent
// if we got WM_QUIT, message loop exits
- // if server died, we get a error from xcb
// if window station is shutting down, we get WM_ENDSESSION
// if we got a signal...