diff options
| author | Po Lu | 2022-01-18 02:06:00 +0000 |
|---|---|---|
| committer | Po Lu | 2022-01-18 02:06:00 +0000 |
| commit | 0c0b77b3ccecc7ca508254f66b4212ea7106b4df (patch) | |
| tree | b29e6dafa08be19e1a30608d4ca0cfa5638573b3 /src | |
| parent | 2dad332a1439b59a62cd5ed0d8e3626d9e91e3e5 (diff) | |
| download | emacs-0c0b77b3ccecc7ca508254f66b4212ea7106b4df.tar.gz emacs-0c0b77b3ccecc7ca508254f66b4212ea7106b4df.zip | |
Allow non-system tooltips to display above menus on Haiku
* doc/emacs/haiku.texi (Haiku Basics): Document that tooltips
can now be displayed above the menu bar.
* lisp/tooltip.el (tooltip-show-help): Only display help text in
the echo area if Haiku system tooltips are enabled.
* src/haiku_support.cc (FlipBuffers): Stop flushing view.
* src/haikufns.c (Fx_show_tip): Fix a sizing bug leading to
tooltips needing two redisplays to display correctly.
* src/haikuterm.c (haiku_read_socket): Ignore resize events on
tooltips.
Diffstat (limited to 'src')
| -rw-r--r-- | src/haiku_support.cc | 1 | ||||
| -rw-r--r-- | src/haikufns.c | 20 | ||||
| -rw-r--r-- | src/haikuterm.c | 2 |
3 files changed, 11 insertions, 12 deletions
diff --git a/src/haiku_support.cc b/src/haiku_support.cc index 22a977a4a69..2d6fd0381fc 100644 --- a/src/haiku_support.cc +++ b/src/haiku_support.cc | |||
| @@ -1320,7 +1320,6 @@ public: | |||
| 1320 | if (!offscreen_draw_view) | 1320 | if (!offscreen_draw_view) |
| 1321 | gui_abort ("Failed to lock offscreen view during buffer flip"); | 1321 | gui_abort ("Failed to lock offscreen view during buffer flip"); |
| 1322 | 1322 | ||
| 1323 | offscreen_draw_view->Flush (); | ||
| 1324 | offscreen_draw_view->Sync (); | 1323 | offscreen_draw_view->Sync (); |
| 1325 | 1324 | ||
| 1326 | EmacsWindow *w = (EmacsWindow *) Window (); | 1325 | EmacsWindow *w = (EmacsWindow *) Window (); |
diff --git a/src/haikufns.c b/src/haikufns.c index c294f4e862c..4ab7fa83b57 100644 --- a/src/haikufns.c +++ b/src/haikufns.c | |||
| @@ -1903,10 +1903,6 @@ DEFUN ("x-show-tip", Fx_show_tip, Sx_show_tip, 1, 6, 0, | |||
| 1903 | tip_last_string = string; | 1903 | tip_last_string = string; |
| 1904 | tip_last_parms = parms; | 1904 | tip_last_parms = parms; |
| 1905 | 1905 | ||
| 1906 | /* Block input until the tip has been fully drawn, to avoid crashes | ||
| 1907 | when drawing tips in menus. */ | ||
| 1908 | block_input (); | ||
| 1909 | |||
| 1910 | if (NILP (tip_frame) || !FRAME_LIVE_P (XFRAME (tip_frame))) | 1906 | if (NILP (tip_frame) || !FRAME_LIVE_P (XFRAME (tip_frame))) |
| 1911 | { | 1907 | { |
| 1912 | /* Add default values to frame parameters. */ | 1908 | /* Add default values to frame parameters. */ |
| @@ -1998,20 +1994,24 @@ DEFUN ("x-show-tip", Fx_show_tip, Sx_show_tip, 1, 6, 0, | |||
| 1998 | height = XFIXNUM (Fcdr (size)) + 2 * FRAME_INTERNAL_BORDER_WIDTH (tip_f); | 1994 | height = XFIXNUM (Fcdr (size)) + 2 * FRAME_INTERNAL_BORDER_WIDTH (tip_f); |
| 1999 | /* Calculate position of tooltip frame. */ | 1995 | /* Calculate position of tooltip frame. */ |
| 2000 | compute_tip_xy (tip_f, parms, dx, dy, width, height, &root_x, &root_y); | 1996 | compute_tip_xy (tip_f, parms, dx, dy, width, height, &root_x, &root_y); |
| 1997 | |||
| 1998 | block_input (); | ||
| 1999 | BWindow_set_offset (FRAME_HAIKU_WINDOW (tip_f), | ||
| 2000 | root_x, root_y); | ||
| 2001 | BWindow_resize (FRAME_HAIKU_WINDOW (tip_f), width, height); | 2001 | BWindow_resize (FRAME_HAIKU_WINDOW (tip_f), width, height); |
| 2002 | haiku_set_offset (tip_f, root_x, root_y, 1); | 2002 | BView_resize_to (FRAME_HAIKU_VIEW (tip_f), width, height); |
| 2003 | change_frame_size (tip_f, width, height, false, true, false); | ||
| 2003 | BWindow_set_tooltip_decoration (FRAME_HAIKU_WINDOW (tip_f)); | 2004 | BWindow_set_tooltip_decoration (FRAME_HAIKU_WINDOW (tip_f)); |
| 2004 | BView_set_view_cursor (FRAME_HAIKU_VIEW (tip_f), | ||
| 2005 | FRAME_OUTPUT_DATA (XFRAME (frame))->current_cursor); | ||
| 2006 | SET_FRAME_VISIBLE (tip_f, 1); | ||
| 2007 | BWindow_set_visible (FRAME_HAIKU_WINDOW (tip_f), 1); | 2005 | BWindow_set_visible (FRAME_HAIKU_WINDOW (tip_f), 1); |
| 2008 | BWindow_sync (FRAME_HAIKU_WINDOW (tip_f)); | 2006 | BWindow_sync (FRAME_HAIKU_WINDOW (tip_f)); |
| 2007 | SET_FRAME_VISIBLE (tip_f, 1); | ||
| 2008 | unblock_input (); | ||
| 2009 | |||
| 2009 | w->must_be_updated_p = true; | 2010 | w->must_be_updated_p = true; |
| 2010 | flush_frame (tip_f); | ||
| 2011 | update_single_window (w); | 2011 | update_single_window (w); |
| 2012 | |||
| 2012 | set_buffer_internal_1 (old_buffer); | 2013 | set_buffer_internal_1 (old_buffer); |
| 2013 | unbind_to (count_1, Qnil); | 2014 | unbind_to (count_1, Qnil); |
| 2014 | unblock_input (); | ||
| 2015 | windows_or_buffers_changed = old_windows_or_buffers_changed; | 2015 | windows_or_buffers_changed = old_windows_or_buffers_changed; |
| 2016 | 2016 | ||
| 2017 | start_timer: | 2017 | start_timer: |
diff --git a/src/haikuterm.c b/src/haikuterm.c index cc4c3961ec4..60b59436b87 100644 --- a/src/haikuterm.c +++ b/src/haikuterm.c | |||
| @@ -2639,7 +2639,7 @@ haiku_read_socket (struct terminal *terminal, struct input_event *hold_quit) | |||
| 2639 | struct haiku_resize_event *b = buf; | 2639 | struct haiku_resize_event *b = buf; |
| 2640 | struct frame *f = haiku_window_to_frame (b->window); | 2640 | struct frame *f = haiku_window_to_frame (b->window); |
| 2641 | 2641 | ||
| 2642 | if (!f) | 2642 | if (!f || FRAME_TOOLTIP_P (f)) |
| 2643 | continue; | 2643 | continue; |
| 2644 | 2644 | ||
| 2645 | int width = lrint (b->px_widthf); | 2645 | int width = lrint (b->px_widthf); |