summaryrefslogtreecommitdiff
path: root/src/haikufns.c
diff options
context:
space:
mode:
authorPo Lu <luangruo@yahoo.com>2022-05-06 07:28:23 +0000
committerPo Lu <luangruo@yahoo.com>2022-05-06 07:29:15 +0000
commitded4413acc6a894bd47736672cceb960bf0fad7d (patch)
treeece53204f10b26ff952118c45d51b22b23483fbc /src/haikufns.c
parent7609c6cadb071df8eeded71263c66c5ca94860b3 (diff)
downloademacs-ded4413acc6a894bd47736672cceb960bf0fad7d.tar.gz
Fix calculation of display resolution on Haiku
* src/haiku_support.cc (BScreen_px_dim): Rename to `be_get_screen_dimensions'. (BScreen_res): Rename to `be_get_display_resolution' and fix resolution computation. * src/haiku_support.h: Update prototypes. * src/haikufns.c (compute_tip_xy, Fx_display_pixel_width) (Fx_display_pixel_height, Fx_display_mm_height) (Fx_display_mm_width): Update accordingly. * src/haikuterm.c (haiku_term_init): Likewise.
Diffstat (limited to 'src/haikufns.c')
-rw-r--r--src/haikufns.c14
1 files changed, 9 insertions, 5 deletions
diff --git a/src/haikufns.c b/src/haikufns.c
index e88ded23ffe..2f26623fa5c 100644
--- a/src/haikufns.c
+++ b/src/haikufns.c
@@ -1203,7 +1203,11 @@ compute_tip_xy (struct frame *f,
/* Default min and max values. */
min_x = 0;
min_y = 0;
- BScreen_px_dim (&max_x, &max_y);
+
+ be_get_screen_dimensions (&max_x, &max_y);
+
+ max_x = max_x - 1;
+ max_y = max_y - 1;
block_input ();
BView_get_mouse (FRAME_HAIKU_VIEW (f), &x, &y);
@@ -1917,7 +1921,7 @@ DEFUN ("x-display-pixel-width", Fx_display_pixel_width, Sx_display_pixel_width,
int width, height;
check_haiku_display_info (terminal);
- BScreen_px_dim (&width, &height);
+ be_get_screen_dimensions (&width, &height);
return make_fixnum (width);
}
@@ -1930,7 +1934,7 @@ DEFUN ("x-display-pixel-height", Fx_display_pixel_height, Sx_display_pixel_heigh
int width, height;
check_haiku_display_info (terminal);
- BScreen_px_dim (&width, &height);
+ be_get_screen_dimensions (&width, &height);
return make_fixnum (width);
}
@@ -1941,7 +1945,7 @@ DEFUN ("x-display-mm-height", Fx_display_mm_height, Sx_display_mm_height, 0, 1,
struct haiku_display_info *dpyinfo = check_haiku_display_info (terminal);
int width, height;
- BScreen_px_dim (&width, &height);
+ be_get_screen_dimensions (&width, &height);
return make_fixnum (height / (dpyinfo->resy / 25.4));
}
@@ -1953,7 +1957,7 @@ DEFUN ("x-display-mm-width", Fx_display_mm_width, Sx_display_mm_width, 0, 1, 0,
struct haiku_display_info *dpyinfo = check_haiku_display_info (terminal);
int width, height;
- BScreen_px_dim (&width, &height);
+ be_get_screen_dimensions (&width, &height);
return make_fixnum (width / (dpyinfo->resx / 25.4));
}