summaryrefslogtreecommitdiff
path: root/src/xterm.h
diff options
context:
space:
mode:
authorDmitry Antipov <dmantipov@yandex.ru>2014-07-18 15:04:37 +0400
committerDmitry Antipov <dmantipov@yandex.ru>2014-07-18 15:04:37 +0400
commit1a5db9eb9ebde75aa94e52c8eab8d07868759444 (patch)
tree9eb145f20f68fcb3d3afeaad737cd05ea5609c74 /src/xterm.h
parent32a608307c53bd8bb1e29015bc36438f0ff0c572 (diff)
downloademacs-1a5db9eb9ebde75aa94e52c8eab8d07868759444.tar.gz
emacs-1a5db9eb9ebde75aa94e52c8eab8d07868759444.tar.bz2
emacs-1a5db9eb9ebde75aa94e52c8eab8d07868759444.zip
Prefer 'x_display_info *' to 'Display *' in X selection code.
This helps to avoid unneeded calls to x_display_info_for_display. * xterm.h (struct selection_input_event): Record 'x_display_info *' instead of 'Display *'. (SELECTION_EVENT_DPYINFO): New macro. (SELECTION_EVENT_DISPLAY): Now inline function to prohibit using it as an lvalue. Mention this in comment. * xterm.c (handle_one_xevent): Use SELECTION_EVENT_DPYINFO. * xselect.c (x_get_window_property_as_lisp_data, x_atom_to_symbol) (selection_data_to_lisp_data, receive_incremental_selection): Convert to use 'x_display_info *'. Adjust users where appropriate. (lisp_data_to_selection_data): Likewise. Also pass 'struct selection data *' as last arg to not return values in args. (unexpect_property_change): Use common removal technique.
Diffstat (limited to 'src/xterm.h')
-rw-r--r--src/xterm.h12
1 files changed, 9 insertions, 3 deletions
diff --git a/src/xterm.h b/src/xterm.h
index 243deb5b72d..0de9c99ab8f 100644
--- a/src/xterm.h
+++ b/src/xterm.h
@@ -892,15 +892,21 @@ struct scroll_bar
struct selection_input_event
{
int kind;
- Display *display;
+ struct x_display_info *dpyinfo;
/* We spell it with an "o" here because X does. */
Window requestor;
Atom selection, target, property;
Time time;
};
-#define SELECTION_EVENT_DISPLAY(eventp) \
- (((struct selection_input_event *) (eventp))->display)
+/* Unlike macros below, this can't be used as an lvalue. */
+INLINE Display *
+SELECTION_EVENT_DISPLAY (struct input_event *ev)
+{
+ return ((struct selection_input_event *) ev)->dpyinfo->display;
+}
+#define SELECTION_EVENT_DPYINFO(eventp) \
+ (((struct selection_input_event *) (eventp))->dpyinfo)
/* We spell it with an "o" here because X does. */
#define SELECTION_EVENT_REQUESTOR(eventp) \
(((struct selection_input_event *) (eventp))->requestor)