aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorPo Lu2022-03-06 08:56:02 +0800
committerPo Lu2022-03-06 08:56:46 +0800
commitc9667e9b60fe0044ea4d5f000973a87a0c584033 (patch)
tree2f582ca50750a01cde2a4646f1cedd8fed1c2466 /src
parent98d2dc6522114e4044077801f11a3ed8de9c1147 (diff)
downloademacs-c9667e9b60fe0044ea4d5f000973a87a0c584033.tar.gz
emacs-c9667e9b60fe0044ea4d5f000973a87a0c584033.zip
Fix reporting of menu bar wheel events on no toolkit builds
* src/xterm.c (x_toolkit_position): Handle menu bar position on no-toolkit builds. (x_create_terminal): Always add `toolkit_position_hook'.
Diffstat (limited to 'src')
-rw-r--r--src/xterm.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/src/xterm.c b/src/xterm.c
index 5f8e804c62a..89feece10eb 100644
--- a/src/xterm.c
+++ b/src/xterm.c
@@ -856,7 +856,6 @@ record_event (char *locus, int type)
856 856
857#endif 857#endif
858 858
859#if defined USE_X_TOOLKIT || USE_GTK
860static void 859static void
861x_toolkit_position (struct frame *f, int x, int y, 860x_toolkit_position (struct frame *f, int x, int y,
862 bool *menu_bar_p, bool *tool_bar_p) 861 bool *menu_bar_p, bool *tool_bar_p)
@@ -884,12 +883,15 @@ x_toolkit_position (struct frame *f, int x, int y,
884 *tool_bar_p = gtk_widget_intersect (FRAME_X_OUTPUT (f)->toolbar_widget, 883 *tool_bar_p = gtk_widget_intersect (FRAME_X_OUTPUT (f)->toolbar_widget,
885 &test_rect, NULL); 884 &test_rect, NULL);
886 } 885 }
887#else 886#elif defined USE_X_TOOLKIT
888 *menu_bar_p = (x > 0 && x < FRAME_PIXEL_WIDTH (f) 887 *menu_bar_p = (x > 0 && x < FRAME_PIXEL_WIDTH (f)
889 && (y < 0 && y >= -FRAME_MENUBAR_HEIGHT (f))); 888 && (y < 0 && y >= -FRAME_MENUBAR_HEIGHT (f)));
889#else
890 *menu_bar_p = (WINDOWP (f->menu_bar_window)
891 && (x > 0 && x < FRAME_PIXEL_WIDTH (f)
892 && (y > 0 && y < FRAME_MENU_BAR_HEIGHT (f))));
890#endif 893#endif
891} 894}
892#endif
893 895
894static void 896static void
895x_update_opaque_region (struct frame *f, XEvent *configure) 897x_update_opaque_region (struct frame *f, XEvent *configure)
@@ -17985,9 +17987,7 @@ x_create_terminal (struct x_display_info *dpyinfo)
17985 terminal->free_pixmap = x_free_pixmap; 17987 terminal->free_pixmap = x_free_pixmap;
17986 terminal->delete_frame_hook = x_destroy_window; 17988 terminal->delete_frame_hook = x_destroy_window;
17987 terminal->delete_terminal_hook = x_delete_terminal; 17989 terminal->delete_terminal_hook = x_delete_terminal;
17988#if defined USE_X_TOOLKIT || defined USE_GTK
17989 terminal->toolkit_position_hook = x_toolkit_position; 17990 terminal->toolkit_position_hook = x_toolkit_position;
17990#endif
17991 /* Other hooks are NULL by default. */ 17991 /* Other hooks are NULL by default. */
17992 17992
17993 return terminal; 17993 return terminal;