summaryrefslogtreecommitdiff
path: root/src/globals.c
diff options
context:
space:
mode:
authorJérémie Courrèges-Anglas <jca@wxcvbn.org>2013-02-06 19:28:33 +0100
committerJérémie Courrèges-Anglas <jca@wxcvbn.org>2013-02-06 21:17:47 +0100
commit3725c23fddd8e936a91296f74e3fd6342270d6bb (patch)
tree4aec8e8d58ad232918aea32863a75d36f976587e /src/globals.c
parent5c0abe47a800dca3faf97b7ec608d86fddab25b6 (diff)
downloadratpoison-3725c23fddd8e936a91296f74e3fd6342270d6bb.zip
make TEXT atoms global variables
* (events.c) extract xa_compound_text from selection_request(), make it a global * introduce xa_string (same as XA_STRING) and rename utf8_string to xa_utf8_string, for consistency
Diffstat (limited to 'src/globals.c')
-rw-r--r--src/globals.c10
1 files changed, 7 insertions, 3 deletions
diff --git a/src/globals.c b/src/globals.c
index 3029aef..8824484 100644
--- a/src/globals.c
+++ b/src/globals.c
@@ -47,13 +47,17 @@ Atom rp_command_request;
Atom rp_command_result;
Atom rp_selection;
+/* TEXT atoms */
+Atom xa_string;
+Atom xa_compound_text;
+Atom xa_utf8_string;
+
/* netwm atoms */
Atom _net_wm_pid;
Atom _net_supported;
Atom _net_wm_window_type;
Atom _net_wm_window_type_dialog;
Atom _net_wm_name;
-Atom utf8_string;
int rp_current_screen;
rp_screen *screens;
@@ -94,7 +98,7 @@ x_export_selection (void)
XSetSelectionOwner(dpy, XA_PRIMARY, screens[0].key_window, CurrentTime);
if (XGetSelectionOwner(dpy, XA_PRIMARY) != screens[0].key_window)
PRINT_ERROR(("can't get primary selection"));
- XChangeProperty(dpy, screens[0].root, XA_CUT_BUFFER0, XA_STRING, 8,
+ XChangeProperty(dpy, screens[0].root, XA_CUT_BUFFER0, xa_string, 8,
PropModeReplace, (unsigned char*)selection.text, selection.len);
}
@@ -196,7 +200,7 @@ get_selection (void)
/* be a good icccm citizen */
XDeleteProperty (dpy, s->input_window, rp_selection);
/* TODO: we shouldn't use CurrentTime here, use the time of the XKeyEvent, should we fake it? */
- XConvertSelection (dpy, XA_PRIMARY, XA_STRING, rp_selection, s->input_window, CurrentTime);
+ XConvertSelection (dpy, XA_PRIMARY, xa_string, rp_selection, s->input_window, CurrentTime);
/* This seems like a hack. */
while (!XCheckTypedWindowEvent (dpy, s->input_window, SelectionNotify, &ev))