aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorPo Lu2022-01-29 05:24:04 +0000
committerPo Lu2022-01-29 05:24:04 +0000
commitb616e14c351cd92f6dd75f9ace65a190e5752d00 (patch)
treed2edc0e72650cfbe425898bb0477bebb340e35fc /src
parent95ccd1ba47771349e23aedf0981861fd5074bd7e (diff)
downloademacs-b616e14c351cd92f6dd75f9ace65a190e5752d00.tar.gz
emacs-b616e14c351cd92f6dd75f9ace65a190e5752d00.zip
Make menus on Haiku work better
* src/haikuterm.c (haiku_read_socket): Don't send up events for ungrabbed buttons.
Diffstat (limited to 'src')
-rw-r--r--src/haikuterm.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/haikuterm.c b/src/haikuterm.c
index 6a84e61add4..5ff348fa5d9 100644
--- a/src/haikuterm.c
+++ b/src/haikuterm.c
@@ -2842,6 +2842,7 @@ haiku_read_socket (struct terminal *terminal, struct input_event *hold_quit)
2842 struct frame *f = haiku_window_to_frame (b->window); 2842 struct frame *f = haiku_window_to_frame (b->window);
2843 Lisp_Object tab_bar_arg = Qnil; 2843 Lisp_Object tab_bar_arg = Qnil;
2844 int tab_bar_p = 0, tool_bar_p = 0; 2844 int tab_bar_p = 0, tool_bar_p = 0;
2845 bool up_okay_p = false;
2845 2846
2846 if (!f) 2847 if (!f)
2847 continue; 2848 continue;
@@ -2894,10 +2895,12 @@ haiku_read_socket (struct terminal *terminal, struct input_event *hold_quit)
2894 if (type == BUTTON_UP) 2895 if (type == BUTTON_UP)
2895 { 2896 {
2896 inev.modifiers |= up_modifier; 2897 inev.modifiers |= up_modifier;
2898 up_okay_p = (dpyinfo->grabbed & (1 << b->btn_no));
2897 dpyinfo->grabbed &= ~(1 << b->btn_no); 2899 dpyinfo->grabbed &= ~(1 << b->btn_no);
2898 } 2900 }
2899 else 2901 else
2900 { 2902 {
2903 up_okay_p = true;
2901 inev.modifiers |= down_modifier; 2904 inev.modifiers |= down_modifier;
2902 dpyinfo->last_mouse_frame = f; 2905 dpyinfo->last_mouse_frame = f;
2903 dpyinfo->grabbed |= (1 << b->btn_no); 2906 dpyinfo->grabbed |= (1 << b->btn_no);
@@ -2907,7 +2910,9 @@ haiku_read_socket (struct terminal *terminal, struct input_event *hold_quit)
2907 f->last_tool_bar_item = -1; 2910 f->last_tool_bar_item = -1;
2908 } 2911 }
2909 2912
2910 if (!(tab_bar_p && NILP (tab_bar_arg)) && !tool_bar_p) 2913 if (up_okay_p
2914 && !(tab_bar_p && NILP (tab_bar_arg))
2915 && !tool_bar_p)
2911 inev.kind = MOUSE_CLICK_EVENT; 2916 inev.kind = MOUSE_CLICK_EVENT;
2912 inev.arg = tab_bar_arg; 2917 inev.arg = tab_bar_arg;
2913 inev.code = b->btn_no; 2918 inev.code = b->btn_no;