emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

master c9667e9b60: Fix reporting of menu bar wheel events on no toolkit


From: Po Lu
Subject: master c9667e9b60: Fix reporting of menu bar wheel events on no toolkit builds
Date: Sat, 5 Mar 2022 19:57:04 -0500 (EST)

branch: master
commit c9667e9b60fe0044ea4d5f000973a87a0c584033
Author: Po Lu <luangruo@yahoo.com>
Commit: Po Lu <luangruo@yahoo.com>

    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'.
---
 src/xterm.c | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/src/xterm.c b/src/xterm.c
index 5f8e804c62..89feece10e 100644
--- a/src/xterm.c
+++ b/src/xterm.c
@@ -856,7 +856,6 @@ record_event (char *locus, int type)
 
 #endif
 
-#if defined USE_X_TOOLKIT || USE_GTK
 static void
 x_toolkit_position (struct frame *f, int x, int y,
                    bool *menu_bar_p, bool *tool_bar_p)
@@ -884,12 +883,15 @@ x_toolkit_position (struct frame *f, int x, int y,
       *tool_bar_p = gtk_widget_intersect (FRAME_X_OUTPUT (f)->toolbar_widget,
                                          &test_rect, NULL);
     }
-#else
+#elif defined USE_X_TOOLKIT
   *menu_bar_p = (x > 0 && x < FRAME_PIXEL_WIDTH (f)
                 && (y < 0 && y >= -FRAME_MENUBAR_HEIGHT (f)));
+#else
+  *menu_bar_p = (WINDOWP (f->menu_bar_window)
+                && (x > 0 && x < FRAME_PIXEL_WIDTH (f)
+                    && (y > 0 && y < FRAME_MENU_BAR_HEIGHT (f))));
 #endif
 }
-#endif
 
 static void
 x_update_opaque_region (struct frame *f, XEvent *configure)
@@ -17985,9 +17987,7 @@ x_create_terminal (struct x_display_info *dpyinfo)
   terminal->free_pixmap = x_free_pixmap;
   terminal->delete_frame_hook = x_destroy_window;
   terminal->delete_terminal_hook = x_delete_terminal;
-#if defined USE_X_TOOLKIT || defined USE_GTK
   terminal->toolkit_position_hook = x_toolkit_position;
-#endif
   /* Other hooks are NULL by default.  */
 
   return terminal;



reply via email to

[Prev in Thread] Current Thread [Next in Thread]