aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorPo Lu2022-02-08 05:14:16 +0000
committerPo Lu2022-02-08 05:14:16 +0000
commit7a1a56da0aec15ef9202213f8a988783a7a59dab (patch)
tree479e281a6efe12930589e5a8d4dfe57e7273157f /src
parent65f07859172940b1f7c89e4a81c8bc1a28646f96 (diff)
downloademacs-7a1a56da0aec15ef9202213f8a988783a7a59dab.tar.gz
emacs-7a1a56da0aec15ef9202213f8a988783a7a59dab.zip
Try harder to preserve cursor when mapping tooltip frames on Haiku
* src/haikufns.c (haiku_set_cursor_color): Fix argument to `error'. (Fx_show_tip): Define cursors on both views.
Diffstat (limited to 'src')
-rw-r--r--src/haikufns.c14
1 files changed, 11 insertions, 3 deletions
diff --git a/src/haikufns.c b/src/haikufns.c
index 8aad2cbd7f0..91e0d392ac6 100644
--- a/src/haikufns.c
+++ b/src/haikufns.c
@@ -1408,7 +1408,7 @@ haiku_set_cursor_color (struct frame *f, Lisp_Object arg, Lisp_Object oldval)
1408 { 1408 {
1409 if (haiku_get_color (SSDATA (Vx_cursor_fore_pixel), 1409 if (haiku_get_color (SSDATA (Vx_cursor_fore_pixel),
1410 &fore_pixel)) 1410 &fore_pixel))
1411 error ("Bad color %s", Vx_cursor_fore_pixel); 1411 error ("Bad color %s", SSDATA (Vx_cursor_fore_pixel));
1412 FRAME_OUTPUT_DATA (f)->cursor_fg = fore_pixel.pixel; 1412 FRAME_OUTPUT_DATA (f)->cursor_fg = fore_pixel.pixel;
1413 } 1413 }
1414 else 1414 else
@@ -1932,7 +1932,7 @@ DEFUN ("x-show-tip", Fx_show_tip, Sx_show_tip, 1, 6, 0,
1932 (Lisp_Object string, Lisp_Object frame, Lisp_Object parms, 1932 (Lisp_Object string, Lisp_Object frame, Lisp_Object parms,
1933 Lisp_Object timeout, Lisp_Object dx, Lisp_Object dy) 1933 Lisp_Object timeout, Lisp_Object dx, Lisp_Object dy)
1934{ 1934{
1935 struct frame *tip_f; 1935 struct frame *f, *tip_f;
1936 struct window *w; 1936 struct window *w;
1937 int root_x, root_y; 1937 int root_x, root_y;
1938 struct buffer *old_buffer; 1938 struct buffer *old_buffer;
@@ -1952,7 +1952,7 @@ DEFUN ("x-show-tip", Fx_show_tip, Sx_show_tip, 1, 6, 0,
1952 1952
1953 if (NILP (frame)) 1953 if (NILP (frame))
1954 frame = selected_frame; 1954 frame = selected_frame;
1955 decode_window_system_frame (frame); 1955 f = decode_window_system_frame (frame);
1956 1956
1957 if (NILP (timeout)) 1957 if (NILP (timeout))
1958 timeout = make_fixnum (5); 1958 timeout = make_fixnum (5);
@@ -2185,12 +2185,20 @@ DEFUN ("x-show-tip", Fx_show_tip, Sx_show_tip, 1, 6, 0,
2185 void *wnd = FRAME_HAIKU_WINDOW (tip_f); 2185 void *wnd = FRAME_HAIKU_WINDOW (tip_f);
2186 BWindow_resize (wnd, width, height); 2186 BWindow_resize (wnd, width, height);
2187 BView_resize_to (FRAME_HAIKU_VIEW (tip_f), width, height); 2187 BView_resize_to (FRAME_HAIKU_VIEW (tip_f), width, height);
2188 BView_set_view_cursor (FRAME_HAIKU_VIEW (tip_f),
2189 FRAME_OUTPUT_DATA (f)->current_cursor);
2188 BWindow_set_offset (wnd, root_x, root_y); 2190 BWindow_set_offset (wnd, root_x, root_y);
2189 BWindow_set_visible (wnd, true); 2191 BWindow_set_visible (wnd, true);
2190 SET_FRAME_VISIBLE (tip_f, true); 2192 SET_FRAME_VISIBLE (tip_f, true);
2191 FRAME_PIXEL_WIDTH (tip_f) = width; 2193 FRAME_PIXEL_WIDTH (tip_f) = width;
2192 FRAME_PIXEL_HEIGHT (tip_f) = height; 2194 FRAME_PIXEL_HEIGHT (tip_f) = height;
2193 BWindow_sync (wnd); 2195 BWindow_sync (wnd);
2196
2197 /* This is needed because the app server resets the cursor whenever
2198 a new window is mapped, so we won't see the cursor set on the
2199 tooltip if the mouse pointer isn't actually over it. */
2200 BView_set_view_cursor (FRAME_HAIKU_VIEW (f),
2201 FRAME_OUTPUT_DATA (f)->current_cursor);
2194 unblock_input (); 2202 unblock_input ();
2195 2203
2196 w->must_be_updated_p = true; 2204 w->must_be_updated_p = true;