diff options
| author | Po Lu | 2022-03-05 10:20:04 +0000 |
|---|---|---|
| committer | Po Lu | 2022-03-05 10:20:04 +0000 |
| commit | 1e1d2f18c6d797f7e49a71f998a82cb255b8bb58 (patch) | |
| tree | 7d3f139af4732496483974bd698984a9d9d53ec2 /src | |
| parent | 8969953328a6cb5b7f131c2b7441e9d5d21191aa (diff) | |
| download | emacs-1e1d2f18c6d797f7e49a71f998a82cb255b8bb58.tar.gz emacs-1e1d2f18c6d797f7e49a71f998a82cb255b8bb58.zip | |
Obey decorator-specified width and height of tooltip frames on Haiku
* src/haiku_support.cc (BWindow_dimensions): New functions.
* src/haiku_support.h: Update prototypes.
* src/haikufns.c (Fx_show_tip): Use actual dimensions, because
the decorator might specify a minimum width and height for the
tooltip frame.
* src/haikuterm.c (haiku_update_size_hints): Ignore tooltip
frames.
Diffstat (limited to 'src')
| -rw-r--r-- | src/haiku_support.cc | 10 | ||||
| -rw-r--r-- | src/haiku_support.h | 3 | ||||
| -rw-r--r-- | src/haikufns.c | 3 | ||||
| -rw-r--r-- | src/haikuterm.c | 3 |
4 files changed, 19 insertions, 0 deletions
diff --git a/src/haiku_support.cc b/src/haiku_support.cc index 20d04163fc9..057464c9088 100644 --- a/src/haiku_support.cc +++ b/src/haiku_support.cc | |||
| @@ -2080,6 +2080,16 @@ BWindow_set_offset (void *window, int x, int y) | |||
| 2080 | wn->MoveTo (x, y); | 2080 | wn->MoveTo (x, y); |
| 2081 | } | 2081 | } |
| 2082 | 2082 | ||
| 2083 | void | ||
| 2084 | BWindow_dimensions (void *window, int *width, int *height) | ||
| 2085 | { | ||
| 2086 | BWindow *w = (BWindow *) window; | ||
| 2087 | BRect frame = w->Frame (); | ||
| 2088 | |||
| 2089 | *width = BE_RECT_WIDTH (frame); | ||
| 2090 | *height = BE_RECT_HEIGHT (frame); | ||
| 2091 | } | ||
| 2092 | |||
| 2083 | /* Iconify WINDOW. */ | 2093 | /* Iconify WINDOW. */ |
| 2084 | void | 2094 | void |
| 2085 | BWindow_iconify (void *window) | 2095 | BWindow_iconify (void *window) |
diff --git a/src/haiku_support.h b/src/haiku_support.h index 9d13cae47c2..04079edbbc5 100644 --- a/src/haiku_support.h +++ b/src/haiku_support.h | |||
| @@ -939,6 +939,9 @@ extern "C" | |||
| 939 | extern haiku_font_family_or_style * | 939 | extern haiku_font_family_or_style * |
| 940 | be_list_font_families (size_t *length); | 940 | be_list_font_families (size_t *length); |
| 941 | 941 | ||
| 942 | extern void | ||
| 943 | BWindow_dimensions (void *window, int *width, int *height); | ||
| 944 | |||
| 942 | #ifdef __cplusplus | 945 | #ifdef __cplusplus |
| 943 | extern void * | 946 | extern void * |
| 944 | find_appropriate_view_for_draw (void *vw); | 947 | find_appropriate_view_for_draw (void *vw); |
diff --git a/src/haikufns.c b/src/haikufns.c index ff5082030f1..545edb27ae0 100644 --- a/src/haikufns.c +++ b/src/haikufns.c | |||
| @@ -2201,6 +2201,9 @@ DEFUN ("x-show-tip", Fx_show_tip, Sx_show_tip, 1, 6, 0, | |||
| 2201 | block_input (); | 2201 | block_input (); |
| 2202 | void *wnd = FRAME_HAIKU_WINDOW (tip_f); | 2202 | void *wnd = FRAME_HAIKU_WINDOW (tip_f); |
| 2203 | BWindow_resize (wnd, width, height); | 2203 | BWindow_resize (wnd, width, height); |
| 2204 | /* The window decorator might cause the actual width and height to | ||
| 2205 | be larger than WIDTH and HEIGHT, so use the actual sizes. */ | ||
| 2206 | BWindow_dimensions (wnd, &width, &height); | ||
| 2204 | BView_resize_to (FRAME_HAIKU_VIEW (tip_f), width, height); | 2207 | BView_resize_to (FRAME_HAIKU_VIEW (tip_f), width, height); |
| 2205 | BView_set_view_cursor (FRAME_HAIKU_VIEW (tip_f), | 2208 | BView_set_view_cursor (FRAME_HAIKU_VIEW (tip_f), |
| 2206 | FRAME_OUTPUT_DATA (f)->current_cursor); | 2209 | FRAME_OUTPUT_DATA (f)->current_cursor); |
diff --git a/src/haikuterm.c b/src/haikuterm.c index ac087e3bec5..c44b350c583 100644 --- a/src/haikuterm.c +++ b/src/haikuterm.c | |||
| @@ -140,6 +140,9 @@ haiku_update_size_hints (struct frame *f) | |||
| 140 | int base_width, base_height; | 140 | int base_width, base_height; |
| 141 | eassert (FRAME_HAIKU_P (f) && FRAME_HAIKU_WINDOW (f)); | 141 | eassert (FRAME_HAIKU_P (f) && FRAME_HAIKU_WINDOW (f)); |
| 142 | 142 | ||
| 143 | if (f->tooltip) | ||
| 144 | return; | ||
| 145 | |||
| 143 | base_width = FRAME_TEXT_COLS_TO_PIXEL_WIDTH (f, 0); | 146 | base_width = FRAME_TEXT_COLS_TO_PIXEL_WIDTH (f, 0); |
| 144 | base_height = FRAME_TEXT_LINES_TO_PIXEL_HEIGHT (f, 0); | 147 | base_height = FRAME_TEXT_LINES_TO_PIXEL_HEIGHT (f, 0); |
| 145 | 148 | ||