emacs-diffs
[Top][All Lists]
Advanced

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

master b616e14c35: Make menus on Haiku work better


From: Po Lu
Subject: master b616e14c35: Make menus on Haiku work better
Date: Sat, 29 Jan 2022 00:28:24 -0500 (EST)

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

    Make menus on Haiku work better
    
    * src/haikuterm.c (haiku_read_socket): Don't send up events for
    ungrabbed buttons.
---
 src/haikuterm.c | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/src/haikuterm.c b/src/haikuterm.c
index 6a84e61add..5ff348fa5d 100644
--- a/src/haikuterm.c
+++ b/src/haikuterm.c
@@ -2842,6 +2842,7 @@ haiku_read_socket (struct terminal *terminal, struct 
input_event *hold_quit)
            struct frame *f = haiku_window_to_frame (b->window);
            Lisp_Object tab_bar_arg = Qnil;
            int tab_bar_p = 0, tool_bar_p = 0;
+           bool up_okay_p = false;
 
            if (!f)
              continue;
@@ -2894,10 +2895,12 @@ haiku_read_socket (struct terminal *terminal, struct 
input_event *hold_quit)
            if (type == BUTTON_UP)
              {
                inev.modifiers |= up_modifier;
+               up_okay_p = (dpyinfo->grabbed & (1 << b->btn_no));
                dpyinfo->grabbed &= ~(1 << b->btn_no);
              }
            else
              {
+               up_okay_p = true;
                inev.modifiers |= down_modifier;
                dpyinfo->last_mouse_frame = f;
                dpyinfo->grabbed |= (1 << b->btn_no);
@@ -2907,7 +2910,9 @@ haiku_read_socket (struct terminal *terminal, struct 
input_event *hold_quit)
                  f->last_tool_bar_item = -1;
              }
 
-           if (!(tab_bar_p && NILP (tab_bar_arg)) && !tool_bar_p)
+           if (up_okay_p
+               && !(tab_bar_p && NILP (tab_bar_arg))
+               && !tool_bar_p)
              inev.kind = MOUSE_CLICK_EVENT;
            inev.arg = tab_bar_arg;
            inev.code = b->btn_no;



reply via email to

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