summaryrefslogtreecommitdiff
path: root/eel/eel-gtk-extensions.c
diff options
context:
space:
mode:
authorrbuj <[email protected]>2021-12-19 23:34:14 +0100
committerLuke from DC <[email protected]>2022-02-09 04:03:59 +0000
commitb6d46039be75bd2b868ee6c32b091a1e37720a20 (patch)
treefe11a75d22da7ca239204f000c33b2338cc07419 /eel/eel-gtk-extensions.c
parent97b61e663e47e6bd6ee6ff460895a7370b3c6159 (diff)
downloadcaja-b6d46039be75bd2b868ee6c32b091a1e37720a20.tar.bz2
caja-b6d46039be75bd2b868ee6c32b091a1e37720a20.tar.xz
Fix some -Wsign-compare warnings
Diffstat (limited to 'eel/eel-gtk-extensions.c')
-rw-r--r--eel/eel-gtk-extensions.c10
1 files changed, 7 insertions, 3 deletions
diff --git a/eel/eel-gtk-extensions.c b/eel/eel-gtk-extensions.c
index b2a47d95..2218b02b 100644
--- a/eel/eel-gtk-extensions.c
+++ b/eel/eel-gtk-extensions.c
@@ -115,21 +115,25 @@ static void
sanity_check_window_dimensions (guint *width, guint *height)
{
GdkScreen *screen;
- gint scale;
+ int screen_width;
+ int screen_height;
+ int scale;
g_assert (width != NULL);
g_assert (height != NULL);
screen = gdk_screen_get_default ();
scale = gdk_window_get_scale_factor (gdk_screen_get_root_window (screen));
+ screen_width = WidthOfScreen (gdk_x11_screen_get_xscreen (screen)) / scale;
+ screen_height = HeightOfScreen (gdk_x11_screen_get_xscreen (screen)) / scale;
/* Pin the size of the window to the screen, so we don't end up in
* a state where the window is so big essential parts of it can't
* be reached (might not be necessary with all window managers,
* but seems reasonable anyway).
*/
- *width = MIN (*width, WidthOfScreen (gdk_x11_screen_get_xscreen (screen)) / scale);
- *height = MIN (*height, HeightOfScreen (gdk_x11_screen_get_xscreen (screen)) / scale);
+ *width = MIN (*width, (guint) screen_width);
+ *height = MIN (*height, (guint) screen_height);
}
/**