diff options
| author | Jan D | 2010-07-14 16:32:25 +0200 |
|---|---|---|
| committer | Jan D | 2010-07-14 16:32:25 +0200 |
| commit | cf28cebc2e93dbd2cd0e6eb2f1a9543a015a1235 (patch) | |
| tree | f342da6952fb8e6e523fff9ef43f26fa2a641088 /src/xmenu.c | |
| parent | ebd3d6afa42948e3fb136583f12f9f72e7830ec5 (diff) | |
| download | emacs-cf28cebc2e93dbd2cd0e6eb2f1a9543a015a1235.tar.gz emacs-cf28cebc2e93dbd2cd0e6eb2f1a9543a015a1235.zip | |
Fix menu bar activation with click for Motif/Lesstif.
* src/xdisp.c (pending_menu_activation): Remove extern declaration.
(prepare_menu_bars): Remove setting of pending_menu_activation.
* src/xmenu.c (pending_menu_activation): Remove.
(x_activate_menubar): Set popup_activated_flag for Xt also. Remove
setting of pending_menu_activation.
(set_frame_menubar): Remove check of pending_menu_activation.
Declare menubar_size before code. Correct spelling in comment.
* src/xterm.c (xm_scroll_callback, x_process_timeouts): K&R => prototype.
(SET_SAVED_KEY_EVENT): Remove (not used).
(SET_SAVED_MENU_EVENT): Rename to SET_SAVED_BUTTON_EVENT and
remove size parameter.
(handle_one_xevent): Check popup_activated () for menu for Xt also.
Remove #ifdef USE_GTK around finish = X_EVENT_DROP.
Remove #ifdef USE_MOTIF code that did SET_SAVED_BUTTON_EVENT for
ButtonRelease.
Diffstat (limited to 'src/xmenu.c')
| -rw-r--r-- | src/xmenu.c | 21 |
1 files changed, 4 insertions, 17 deletions
diff --git a/src/xmenu.c b/src/xmenu.c index b0bdbcfecaa..4b99297e772 100644 --- a/src/xmenu.c +++ b/src/xmenu.c | |||
| @@ -151,14 +151,6 @@ extern widget_value *xmalloc_widget_value (void); | |||
| 151 | extern widget_value *digest_single_submenu (int, int, int); | 151 | extern widget_value *digest_single_submenu (int, int, int); |
| 152 | #endif | 152 | #endif |
| 153 | 153 | ||
| 154 | /* This is set nonzero after the user activates the menu bar, and set | ||
| 155 | to zero again after the menu bars are redisplayed by prepare_menu_bar. | ||
| 156 | While it is nonzero, all calls to set_frame_menubar go deep. | ||
| 157 | |||
| 158 | I don't understand why this is needed, but it does seem to be | ||
| 159 | needed on Motif, according to Marcus Daniels <marcus@sysc.pdx.edu>. */ | ||
| 160 | |||
| 161 | int pending_menu_activation; | ||
| 162 | 154 | ||
| 163 | #ifdef USE_X_TOOLKIT | 155 | #ifdef USE_X_TOOLKIT |
| 164 | 156 | ||
| @@ -670,6 +662,7 @@ x_activate_menubar (FRAME_PTR f) | |||
| 670 | 662 | ||
| 671 | set_frame_menubar (f, 0, 1); | 663 | set_frame_menubar (f, 0, 1); |
| 672 | BLOCK_INPUT; | 664 | BLOCK_INPUT; |
| 665 | popup_activated_flag = 1; | ||
| 673 | #ifdef USE_GTK | 666 | #ifdef USE_GTK |
| 674 | /* If we click outside any menu item, the menu bar still grabs. | 667 | /* If we click outside any menu item, the menu bar still grabs. |
| 675 | So we send Press and the Release. If outside, grab is released. | 668 | So we send Press and the Release. If outside, grab is released. |
| @@ -681,15 +674,10 @@ x_activate_menubar (FRAME_PTR f) | |||
| 681 | f->output_data.x->saved_menu_event->type = ButtonPress; | 674 | f->output_data.x->saved_menu_event->type = ButtonPress; |
| 682 | XPutBackEvent (f->output_data.x->display_info->display, | 675 | XPutBackEvent (f->output_data.x->display_info->display, |
| 683 | f->output_data.x->saved_menu_event); | 676 | f->output_data.x->saved_menu_event); |
| 684 | popup_activated_flag = 1; | ||
| 685 | #else | 677 | #else |
| 686 | XtDispatchEvent (f->output_data.x->saved_menu_event); | 678 | XtDispatchEvent (f->output_data.x->saved_menu_event); |
| 687 | #endif | 679 | #endif |
| 688 | UNBLOCK_INPUT; | 680 | UNBLOCK_INPUT; |
| 689 | #ifdef USE_MOTIF | ||
| 690 | if (f->output_data.x->saved_menu_event->type == ButtonRelease) | ||
| 691 | pending_menu_activation = 1; | ||
| 692 | #endif | ||
| 693 | 681 | ||
| 694 | /* Ignore this if we get it a second time. */ | 682 | /* Ignore this if we get it a second time. */ |
| 695 | f->output_data.x->saved_menu_event->type = 0; | 683 | f->output_data.x->saved_menu_event->type = 0; |
| @@ -991,8 +979,6 @@ set_frame_menubar (FRAME_PTR f, int first_time, int deep_p) | |||
| 991 | 979 | ||
| 992 | if (! menubar_widget) | 980 | if (! menubar_widget) |
| 993 | deep_p = 1; | 981 | deep_p = 1; |
| 994 | else if (pending_menu_activation && !deep_p) | ||
| 995 | deep_p = 1; | ||
| 996 | /* Make the first call for any given frame always go deep. */ | 982 | /* Make the first call for any given frame always go deep. */ |
| 997 | else if (!f->output_data.x->saved_menu_event && !deep_p) | 983 | else if (!f->output_data.x->saved_menu_event && !deep_p) |
| 998 | { | 984 | { |
| @@ -1274,10 +1260,11 @@ set_frame_menubar (FRAME_PTR f, int first_time, int deep_p) | |||
| 1274 | } | 1260 | } |
| 1275 | 1261 | ||
| 1276 | { | 1262 | { |
| 1263 | int menubar_size; | ||
| 1277 | if (f->output_data.x->menubar_widget) | 1264 | if (f->output_data.x->menubar_widget) |
| 1278 | XtRealizeWidget (f->output_data.x->menubar_widget); | 1265 | XtRealizeWidget (f->output_data.x->menubar_widget); |
| 1279 | 1266 | ||
| 1280 | int menubar_size | 1267 | menubar_size |
| 1281 | = (f->output_data.x->menubar_widget | 1268 | = (f->output_data.x->menubar_widget |
| 1282 | ? (f->output_data.x->menubar_widget->core.height | 1269 | ? (f->output_data.x->menubar_widget->core.height |
| 1283 | + f->output_data.x->menubar_widget->core.border_width) | 1270 | + f->output_data.x->menubar_widget->core.border_width) |
| @@ -1286,7 +1273,7 @@ set_frame_menubar (FRAME_PTR f, int first_time, int deep_p) | |||
| 1286 | #if 1 /* Experimentally, we now get the right results | 1273 | #if 1 /* Experimentally, we now get the right results |
| 1287 | for -geometry -0-0 without this. 24 Aug 96, rms. | 1274 | for -geometry -0-0 without this. 24 Aug 96, rms. |
| 1288 | Maybe so, but the menu bar size is missing the pixels so the | 1275 | Maybe so, but the menu bar size is missing the pixels so the |
| 1289 | WM size hints are off by theses pixel. Jan D, oct 2009. */ | 1276 | WM size hints are off by these pixels. Jan D, oct 2009. */ |
| 1290 | #ifdef USE_LUCID | 1277 | #ifdef USE_LUCID |
| 1291 | if (FRAME_EXTERNAL_MENU_BAR (f)) | 1278 | if (FRAME_EXTERNAL_MENU_BAR (f)) |
| 1292 | { | 1279 | { |