aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorPo Lu2022-01-16 10:43:22 +0000
committerPo Lu2022-01-16 10:43:22 +0000
commit7f074fecf4516031699f443f8a88f925a73d1147 (patch)
treeb487e4d400d3ca327e068920a1d5c5cbb5c6994d /src
parentdf53beb2db4a3aeba24b43ac748538e7daf06f8c (diff)
downloademacs-7f074fecf4516031699f443f8a88f925a73d1147.tar.gz
emacs-7f074fecf4516031699f443f8a88f925a73d1147.zip
Make help event generation on Haiku behave closer to X
* src/haikuterm.c (haiku_read_socket): Generate help events more like how X does it.
Diffstat (limited to 'src')
-rw-r--r--src/haikuterm.c38
1 files changed, 34 insertions, 4 deletions
diff --git a/src/haikuterm.c b/src/haikuterm.c
index 7380420e531..05f9788f184 100644
--- a/src/haikuterm.c
+++ b/src/haikuterm.c
@@ -55,6 +55,8 @@ struct unhandled_event
55 uint8_t buffer[200]; 55 uint8_t buffer[200];
56}; 56};
57 57
58static bool any_help_event_p = false;
59
58char * 60char *
59get_keysym_name (int keysym) 61get_keysym_name (int keysym)
60{ 62{
@@ -2594,6 +2596,7 @@ haiku_read_socket (struct terminal *terminal, struct input_event *hold_quit)
2594 struct unhandled_event *unhandled_events = NULL; 2596 struct unhandled_event *unhandled_events = NULL;
2595 int button_or_motion_p; 2597 int button_or_motion_p;
2596 int need_flush = 0; 2598 int need_flush = 0;
2599 int do_help = 0;
2597 2600
2598 if (!buf) 2601 if (!buf)
2599 buf = xmalloc (200); 2602 buf = xmalloc (200);
@@ -2774,8 +2777,9 @@ haiku_read_socket (struct terminal *terminal, struct input_event *hold_quit)
2774 } 2777 }
2775 2778
2776 haiku_new_focus_frame (x_display_list->focused_frame); 2779 haiku_new_focus_frame (x_display_list->focused_frame);
2777 help_echo_string = Qnil; 2780
2778 gen_help_event (Qnil, frame, Qnil, Qnil, 0); 2781 if (any_help_event_p)
2782 do_help = -1;
2779 } 2783 }
2780 else 2784 else
2781 { 2785 {
@@ -2820,9 +2824,9 @@ haiku_read_socket (struct terminal *terminal, struct input_event *hold_quit)
2820 remember_mouse_glyph (f, b->x, b->y, 2824 remember_mouse_glyph (f, b->x, b->y,
2821 &FRAME_DISPLAY_INFO (f)->last_mouse_glyph); 2825 &FRAME_DISPLAY_INFO (f)->last_mouse_glyph);
2822 dpyinfo->last_mouse_glyph_frame = f; 2826 dpyinfo->last_mouse_glyph_frame = f;
2823 gen_help_event (help_echo_string, frame, help_echo_window,
2824 help_echo_object, help_echo_pos);
2825 } 2827 }
2828 else
2829 help_echo_string = previous_help_echo_string;
2826 2830
2827 if (!NILP (Vmouse_autoselect_window)) 2831 if (!NILP (Vmouse_autoselect_window))
2828 { 2832 {
@@ -2842,6 +2846,10 @@ haiku_read_socket (struct terminal *terminal, struct input_event *hold_quit)
2842 2846
2843 last_mouse_window = window; 2847 last_mouse_window = window;
2844 } 2848 }
2849
2850 if (!NILP (help_echo_string)
2851 || !NILP (previous_help_echo_string))
2852 do_help = 1;
2845 } 2853 }
2846 break; 2854 break;
2847 } 2855 }
@@ -3293,6 +3301,28 @@ haiku_read_socket (struct terminal *terminal, struct input_event *hold_quit)
3293 xfree (old); 3301 xfree (old);
3294 } 3302 }
3295 3303
3304 if (do_help && !(hold_quit && hold_quit->kind != NO_EVENT))
3305 {
3306 Lisp_Object help_frame = Qnil;
3307
3308 if (x_display_list->last_mouse_frame)
3309 XSETFRAME (help_frame,
3310 x_display_list->last_mouse_frame);
3311
3312 if (do_help > 0)
3313 {
3314 any_help_event_p = true;
3315 gen_help_event (help_echo_string, help_frame,
3316 help_echo_window, help_echo_object,
3317 help_echo_pos);
3318 }
3319 else
3320 {
3321 help_echo_string = Qnil;
3322 gen_help_event (Qnil, help_frame, Qnil, Qnil, 0);
3323 }
3324 }
3325
3296 if (need_flush) 3326 if (need_flush)
3297 flush_dirty_back_buffers (); 3327 flush_dirty_back_buffers ();
3298 3328