diff options
| author | Po Lu | 2022-02-28 09:40:01 +0800 |
|---|---|---|
| committer | Po Lu | 2022-02-28 09:40:01 +0800 |
| commit | 0f3ce51a0d5f2aabad3d3aeb3d86d52b152deef0 (patch) | |
| tree | 70392c69512031d6736ccb7cc3917d958e8111e5 /src | |
| parent | 0470ef007f268f19cad8c0c786559453c38fdde3 (diff) | |
| download | emacs-0f3ce51a0d5f2aabad3d3aeb3d86d52b152deef0.tar.gz emacs-0f3ce51a0d5f2aabad3d3aeb3d86d52b152deef0.zip | |
Don't save menu bar events that land on the menu bar itself
* src/xterm.c (handle_one_xevent): Ignore menu bar events which
land on the menu bar itself instead of a button.
Diffstat (limited to 'src')
| -rw-r--r-- | src/xterm.c | 26 |
1 files changed, 20 insertions, 6 deletions
diff --git a/src/xterm.c b/src/xterm.c index 2656b30472d..520de5fcf0f 100644 --- a/src/xterm.c +++ b/src/xterm.c | |||
| @@ -11112,12 +11112,26 @@ handle_one_xevent (struct x_display_info *dpyinfo, | |||
| 11112 | && event->xbutton.y < FRAME_MENUBAR_HEIGHT (f) | 11112 | && event->xbutton.y < FRAME_MENUBAR_HEIGHT (f) |
| 11113 | && event->xbutton.same_screen) | 11113 | && event->xbutton.same_screen) |
| 11114 | { | 11114 | { |
| 11115 | if (!f->output_data.x->saved_menu_event) | 11115 | #ifdef USE_MOTIF |
| 11116 | f->output_data.x->saved_menu_event = xmalloc (sizeof *event); | 11116 | unsigned char column_type; |
| 11117 | *f->output_data.x->saved_menu_event = *event; | 11117 | Widget widget; |
| 11118 | inev.ie.kind = MENU_BAR_ACTIVATE_EVENT; | 11118 | |
| 11119 | XSETFRAME (inev.ie.frame_or_window, f); | 11119 | widget = XtWindowToWidget (dpyinfo->display, |
| 11120 | *finish = X_EVENT_DROP; | 11120 | event->xbutton.window); |
| 11121 | XtVaGetValues (widget, XmNrowColumnType, &column_type, NULL); | ||
| 11122 | |||
| 11123 | if (column_type != XmMENU_BAR) | ||
| 11124 | { | ||
| 11125 | #endif | ||
| 11126 | if (!f->output_data.x->saved_menu_event) | ||
| 11127 | f->output_data.x->saved_menu_event = xmalloc (sizeof *event); | ||
| 11128 | *f->output_data.x->saved_menu_event = *event; | ||
| 11129 | inev.ie.kind = MENU_BAR_ACTIVATE_EVENT; | ||
| 11130 | XSETFRAME (inev.ie.frame_or_window, f); | ||
| 11131 | *finish = X_EVENT_DROP; | ||
| 11132 | #ifdef USE_MOTIF | ||
| 11133 | } | ||
| 11134 | #endif | ||
| 11121 | } | 11135 | } |
| 11122 | else | 11136 | else |
| 11123 | goto OTHER; | 11137 | goto OTHER; |