diff options
Diffstat (limited to 'src/xterm.c')
| -rw-r--r-- | src/xterm.c | 38 |
1 files changed, 6 insertions, 32 deletions
diff --git a/src/xterm.c b/src/xterm.c index 2f581d9f590..e66845df26c 100644 --- a/src/xterm.c +++ b/src/xterm.c | |||
| @@ -4159,9 +4159,7 @@ x_scroll_bar_to_input_event (XEvent *event, struct input_event *ievent) | |||
| 4159 | CALL_DATA is a pointer to a XmScrollBarCallbackStruct. */ | 4159 | CALL_DATA is a pointer to a XmScrollBarCallbackStruct. */ |
| 4160 | 4160 | ||
| 4161 | static void | 4161 | static void |
| 4162 | xm_scroll_callback (widget, client_data, call_data) | 4162 | xm_scroll_callback (Widget widget, XtPointer client_data, XtPointer call_data) |
| 4163 | Widget widget; | ||
| 4164 | XtPointer client_data, call_data; | ||
| 4165 | { | 4163 | { |
| 4166 | struct scroll_bar *bar = (struct scroll_bar *) client_data; | 4164 | struct scroll_bar *bar = (struct scroll_bar *) client_data; |
| 4167 | XmScrollBarCallbackStruct *cs = (XmScrollBarCallbackStruct *) call_data; | 4165 | XmScrollBarCallbackStruct *cs = (XmScrollBarCallbackStruct *) call_data; |
| @@ -5546,22 +5544,18 @@ struct x_display_info *XTread_socket_fake_io_error; | |||
| 5546 | 5544 | ||
| 5547 | static struct x_display_info *next_noop_dpyinfo; | 5545 | static struct x_display_info *next_noop_dpyinfo; |
| 5548 | 5546 | ||
| 5549 | #define SET_SAVED_MENU_EVENT(size) \ | 5547 | #define SET_SAVED_BUTTON_EVENT \ |
| 5550 | do \ | 5548 | do \ |
| 5551 | { \ | 5549 | { \ |
| 5552 | if (f->output_data.x->saved_menu_event == 0) \ | 5550 | if (f->output_data.x->saved_menu_event == 0) \ |
| 5553 | f->output_data.x->saved_menu_event \ | 5551 | f->output_data.x->saved_menu_event \ |
| 5554 | = (XEvent *) xmalloc (sizeof (XEvent)); \ | 5552 | = (XEvent *) xmalloc (sizeof (XEvent)); \ |
| 5555 | memcpy (f->output_data.x->saved_menu_event, &event, size); \ | 5553 | *f->output_data.x->saved_menu_event = event; \ |
| 5556 | inev.ie.kind = MENU_BAR_ACTIVATE_EVENT; \ | 5554 | inev.ie.kind = MENU_BAR_ACTIVATE_EVENT; \ |
| 5557 | XSETFRAME (inev.ie.frame_or_window, f); \ | 5555 | XSETFRAME (inev.ie.frame_or_window, f); \ |
| 5558 | } \ | 5556 | } \ |
| 5559 | while (0) | 5557 | while (0) |
| 5560 | 5558 | ||
| 5561 | #define SET_SAVED_BUTTON_EVENT SET_SAVED_MENU_EVENT (sizeof (XButtonEvent)) | ||
| 5562 | #define SET_SAVED_KEY_EVENT SET_SAVED_MENU_EVENT (sizeof (XKeyEvent)) | ||
| 5563 | |||
| 5564 | |||
| 5565 | enum | 5559 | enum |
| 5566 | { | 5560 | { |
| 5567 | X_EVENT_NORMAL, | 5561 | X_EVENT_NORMAL, |
| @@ -6755,14 +6749,12 @@ handle_one_xevent (struct x_display_info *dpyinfo, XEvent *eventp, int *finish, | |||
| 6755 | Instead, save it away | 6749 | Instead, save it away |
| 6756 | and we will pass it to Xt from kbd_buffer_get_event. | 6750 | and we will pass it to Xt from kbd_buffer_get_event. |
| 6757 | That way, we can run some Lisp code first. */ | 6751 | That way, we can run some Lisp code first. */ |
| 6758 | if ( | 6752 | if (! popup_activated () |
| 6759 | #ifdef USE_GTK | 6753 | #ifdef USE_GTK |
| 6760 | ! popup_activated () | ||
| 6761 | /* Gtk+ menus only react to the first three buttons. */ | 6754 | /* Gtk+ menus only react to the first three buttons. */ |
| 6762 | && event.xbutton.button < 3 | 6755 | && event.xbutton.button < 3 |
| 6763 | && | ||
| 6764 | #endif | 6756 | #endif |
| 6765 | f && event.type == ButtonPress | 6757 | && f && event.type == ButtonPress |
| 6766 | /* Verify the event is really within the menu bar | 6758 | /* Verify the event is really within the menu bar |
| 6767 | and not just sent to it due to grabbing. */ | 6759 | and not just sent to it due to grabbing. */ |
| 6768 | && event.xbutton.x >= 0 | 6760 | && event.xbutton.x >= 0 |
| @@ -6773,30 +6765,13 @@ handle_one_xevent (struct x_display_info *dpyinfo, XEvent *eventp, int *finish, | |||
| 6773 | { | 6765 | { |
| 6774 | SET_SAVED_BUTTON_EVENT; | 6766 | SET_SAVED_BUTTON_EVENT; |
| 6775 | XSETFRAME (last_mouse_press_frame, f); | 6767 | XSETFRAME (last_mouse_press_frame, f); |
| 6776 | #ifdef USE_GTK | ||
| 6777 | *finish = X_EVENT_DROP; | 6768 | *finish = X_EVENT_DROP; |
| 6778 | #endif | ||
| 6779 | } | 6769 | } |
| 6780 | else if (event.type == ButtonPress) | 6770 | else if (event.type == ButtonPress) |
| 6781 | { | 6771 | { |
| 6782 | last_mouse_press_frame = Qnil; | 6772 | last_mouse_press_frame = Qnil; |
| 6783 | goto OTHER; | 6773 | goto OTHER; |
| 6784 | } | 6774 | } |
| 6785 | |||
| 6786 | #ifdef USE_MOTIF /* This should do not harm for Lucid, | ||
| 6787 | but I am trying to be cautious. */ | ||
| 6788 | else if (event.type == ButtonRelease) | ||
| 6789 | { | ||
| 6790 | if (!NILP (last_mouse_press_frame)) | ||
| 6791 | { | ||
| 6792 | f = XFRAME (last_mouse_press_frame); | ||
| 6793 | if (f->output_data.x) | ||
| 6794 | SET_SAVED_BUTTON_EVENT; | ||
| 6795 | } | ||
| 6796 | else | ||
| 6797 | goto OTHER; | ||
| 6798 | } | ||
| 6799 | #endif /* USE_MOTIF */ | ||
| 6800 | else | 6775 | else |
| 6801 | goto OTHER; | 6776 | goto OTHER; |
| 6802 | #endif /* USE_X_TOOLKIT || USE_GTK */ | 6777 | #endif /* USE_X_TOOLKIT || USE_GTK */ |
| @@ -10336,8 +10311,7 @@ x_delete_display (struct x_display_info *dpyinfo) | |||
| 10336 | that slows us down. */ | 10311 | that slows us down. */ |
| 10337 | 10312 | ||
| 10338 | static void | 10313 | static void |
| 10339 | x_process_timeouts (timer) | 10314 | x_process_timeouts (struct atimer *timer) |
| 10340 | struct atimer *timer; | ||
| 10341 | { | 10315 | { |
| 10342 | BLOCK_INPUT; | 10316 | BLOCK_INPUT; |
| 10343 | x_timeout_atimer_activated_flag = 0; | 10317 | x_timeout_atimer_activated_flag = 0; |