diff options
author | Jesse Luehrs <doy@tozt.net> | 2014-05-18 01:24:27 -0400 |
---|---|---|
committer | Jesse Luehrs <doy@tozt.net> | 2014-07-04 22:39:07 -0400 |
commit | 033b80e9ef340e75a56a37eab803bb4858415061 (patch) | |
tree | b31e0a6b65bc6dc6183958d0c55fe62e299f9281 | |
parent | 233fadb59f31ae04709ce8948631473382a140ac (diff) | |
download | runes-033b80e9ef340e75a56a37eab803bb4858415061.tar.gz runes-033b80e9ef340e75a56a37eab803bb4858415061.zip |
also respond to TARGETS requests
-rw-r--r-- | src/window-xlib.c | 11 | ||||
-rw-r--r-- | src/window-xlib.h | 1 |
2 files changed, 11 insertions, 1 deletions
diff --git a/src/window-xlib.c b/src/window-xlib.c index e02db3d..53cd970 100644 --- a/src/window-xlib.c +++ b/src/window-xlib.c @@ -16,6 +16,7 @@ static char *atom_names[RUNES_NUM_ATOMS] = { "_NET_WM_NAME", "UTF8_STRING", "WM_PROTOCOLS", + "TARGETS", "RUNES_FLUSH", "RUNES_SELECTION" }; @@ -994,7 +995,15 @@ static void runes_window_backend_handle_selection_request_event( selection.property = e->property; selection.time = e->time; - if (e->target == XA_STRING || e->target == w->atoms[RUNES_ATOM_UTF8_STRING]) { + if (e->target == w->atoms[RUNES_ATOM_TARGETS]) { + Atom targets[2] = { XA_STRING, w->atoms[RUNES_ATOM_UTF8_STRING] }; + + XChangeProperty( + w->dpy, e->requestor, e->property, + XA_ATOM, 32, PropModeReplace, + (unsigned char *)&targets, 2); + } + else if (e->target == XA_STRING || e->target == w->atoms[RUNES_ATOM_UTF8_STRING]) { char *contents; size_t len; diff --git a/src/window-xlib.h b/src/window-xlib.h index 10d3417..a72f2cd 100644 --- a/src/window-xlib.h +++ b/src/window-xlib.h @@ -12,6 +12,7 @@ enum runes_atoms { RUNES_ATOM_NET_WM_NAME, RUNES_ATOM_UTF8_STRING, RUNES_ATOM_WM_PROTOCOLS, + RUNES_ATOM_TARGETS, RUNES_ATOM_RUNES_FLUSH, RUNES_ATOM_RUNES_SELECTION, RUNES_NUM_ATOMS |