[sawfish] Quit on manager selection clear.
- From: Christopher Bratusek <chrisb src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [sawfish] Quit on manager selection clear.
- Date: Mon, 27 Dec 2010 20:38:36 +0000 (UTC)
commit 632f1bd0f514e9f7702366fca2ff4310393c6a71
Author: Timo Korvola <tkorvola iki fi>
Date: Thu Dec 23 14:23:20 2010 +0200
Quit on manager selection clear.
Also added a stub for handling selection requests.
src/display.c | 1 +
src/events.c | 19 +++++++++++++++++++
2 files changed, 20 insertions(+), 0 deletions(-)
---
diff --git a/src/display.c b/src/display.c
index cfaa092..1181bbf 100644
--- a/src/display.c
+++ b/src/display.c
@@ -490,6 +490,7 @@ sys_kill (void)
if(!batch_mode_p ())
{
XSetInputFocus (dpy, PointerRoot, 0, last_event_time);
+ XSelectInput (dpy, root_window, 0);
XDestroyWindow (dpy, no_focus_window);
XCloseDisplay (dpy);
}
diff --git a/src/events.c b/src/events.c
index a1943df..03b7886 100644
--- a/src/events.c
+++ b/src/events.c
@@ -1277,6 +1277,23 @@ mapping_notify (XEvent *ev)
}
static void
+selection_clear (XEvent *ev)
+{
+ XSelectionClearEvent *scev = &ev->xselectionclear;
+ if (scev->selection == xa_wm_sn && scev->window == no_focus_window)
+ Fquit ();
+}
+
+static void
+selection_request (XEvent *ev)
+{
+ XSelectionRequestEvent *srev = &ev->xselectionrequest;
+ if (srev->selection == xa_wm_sn)
+ {
+ }
+}
+
+static void
shape_notify (XEvent *ev)
{
XShapeEvent *sev = (XShapeEvent *)ev;
@@ -1761,6 +1778,8 @@ events_init (void)
event_handlers[ReparentNotify] = reparent_notify;
event_handlers[CreateNotify] = create_notify;
event_handlers[CirculateNotify] = circulate_notify;
+ event_handlers[SelectionClear] = selection_clear;
+ event_handlers[SelectionRequest] = selection_request;
event_handlers[MappingNotify] = mapping_notify;
#ifdef DEBUG
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]