Mercurial > emacs
comparison src/xterm.c @ 106867:e9a9fc07702f
* xterm.c (event_handler_gdk): Block input (Bug#5037).
author | Chong Yidong <cyd@stupidchicken.com> |
---|---|
date | Sat, 16 Jan 2010 15:20:32 -0500 |
parents | 982abebe98ab |
children | f257bf772280 |
comparison
equal
deleted
inserted
replaced
106866:2140d1c42332 | 106867:e9a9fc07702f |
---|---|
5795 GdkEvent *ev; | 5795 GdkEvent *ev; |
5796 gpointer data; | 5796 gpointer data; |
5797 { | 5797 { |
5798 XEvent *xev = (XEvent *) gxev; | 5798 XEvent *xev = (XEvent *) gxev; |
5799 | 5799 |
5800 BLOCK_INPUT; | |
5800 if (current_count >= 0) | 5801 if (current_count >= 0) |
5801 { | 5802 { |
5802 struct x_display_info *dpyinfo; | 5803 struct x_display_info *dpyinfo; |
5803 | 5804 |
5804 dpyinfo = x_display_info_for_display (xev->xany.display); | 5805 dpyinfo = x_display_info_for_display (xev->xany.display); |
5805 | 5806 |
5806 #ifdef HAVE_X_I18N | 5807 #ifdef HAVE_X_I18N |
5807 /* Filter events for the current X input method. | 5808 /* Filter events for the current X input method. |
5808 GTK calls XFilterEvent but not for key press and release, | 5809 GTK calls XFilterEvent but not for key press and release, |
5809 so we do it here. */ | 5810 so we do it here. */ |
5810 if (xev->type == KeyPress || xev->type == KeyRelease) | 5811 if ((xev->type == KeyPress || xev->type == KeyRelease) |
5811 if (dpyinfo && x_filter_event (dpyinfo, xev)) | 5812 && dpyinfo |
5812 return GDK_FILTER_REMOVE; | 5813 && x_filter_event (dpyinfo, xev)) |
5814 { | |
5815 UNBLOCK_INPUT; | |
5816 return GDK_FILTER_REMOVE; | |
5817 } | |
5813 #endif | 5818 #endif |
5814 | 5819 |
5815 if (! dpyinfo) | 5820 if (! dpyinfo) |
5816 current_finish = X_EVENT_NORMAL; | 5821 current_finish = X_EVENT_NORMAL; |
5817 else | 5822 else |
5818 { | 5823 current_count += |
5819 current_count += | 5824 handle_one_xevent (dpyinfo, xev, ¤t_finish, |
5820 handle_one_xevent (dpyinfo, xev, ¤t_finish, | 5825 current_hold_quit); |
5821 current_hold_quit); | |
5822 } | |
5823 } | 5826 } |
5824 else | 5827 else |
5825 current_finish = x_dispatch_event (xev, xev->xany.display); | 5828 current_finish = x_dispatch_event (xev, xev->xany.display); |
5829 | |
5830 UNBLOCK_INPUT; | |
5826 | 5831 |
5827 if (current_finish == X_EVENT_GOTO_OUT || current_finish == X_EVENT_DROP) | 5832 if (current_finish == X_EVENT_GOTO_OUT || current_finish == X_EVENT_DROP) |
5828 return GDK_FILTER_REMOVE; | 5833 return GDK_FILTER_REMOVE; |
5829 | 5834 |
5830 return GDK_FILTER_CONTINUE; | 5835 return GDK_FILTER_CONTINUE; |