diff options
author | Dmitry Antipov <dmantipov@yandex.ru> | 2013-09-16 14:41:41 +0400 |
---|---|---|
committer | Dmitry Antipov <dmantipov@yandex.ru> | 2013-09-16 14:41:41 +0400 |
commit | 61582e6aadc24dda730055d9907e7c053dd6218b (patch) | |
tree | ca2fbdfb25cfaf51e43c72111b1e660db620a8e7 /src/gtkutil.c | |
parent | c6ad9bcaded7363a11128e7a005e45fb53c7dd87 (diff) | |
download | emacs-61582e6aadc24dda730055d9907e7c053dd6218b.tar.gz |
Do not copy X event in handle_one_xevent except KeyPress case.
Wnen XEvent is processed, it is unlikely to be changed except
KeyPress case, so we can avoid copying and use const pointer to
const data to make sure that an event is not changed elsewhere.
* xterm.c (handle_one_xevent): Change 2nd arg to 'const XEvent *
const' and do not create local copy except for the KeyPress event.
Use casts to avoid a few glitches. Adjust formatting. Add comments.
(SET_SAVED_BUTTON_EVENT): Remove and move the code to the only user.
(x_handle_net_wm_state, x_menubar_window_to_frame)
(x_detect_focus_change, construct_mouse_click, note_mouse_movement)
(x_scroll_bar_to_input_event, x_scroll_bar_expose)
(x_scroll_bar_handle_click, x_scroll_bar_note_movement):
* gtkutil.c (xg_event_is_for_menubar, xg_event_is_for_scrollbar):
* xselect.c (x_handle_property_notify, x_handle_selection_notify)
(x_handle_dnd_message):
* xsettings.c (xft_settings_event):
Use 'const XEvent * const' where appropriate.
* xterm.h, gtkutil.h, xsettngs.h: Adjust related prototypes.
Diffstat (limited to 'src/gtkutil.c')
-rw-r--r-- | src/gtkutil.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/gtkutil.c b/src/gtkutil.c index 95154ef9b52..57b7b58d9d6 100644 --- a/src/gtkutil.c +++ b/src/gtkutil.c @@ -3409,7 +3409,7 @@ free_frame_menubar (struct frame *f) } bool -xg_event_is_for_menubar (struct frame *f, XEvent *event) +xg_event_is_for_menubar (struct frame *f, const XEvent * const event) { struct x_output *x = f->output_data.x; GList *iter; @@ -3861,7 +3861,7 @@ xg_set_toolkit_scroll_bar_thumb (struct scroll_bar *bar, frame. This function does additional checks. */ bool -xg_event_is_for_scrollbar (struct frame *f, XEvent *event) +xg_event_is_for_scrollbar (struct frame *f, const XEvent * const event) { bool retval = 0; |