summaryrefslogtreecommitdiff
path: root/src/caja-window.c
diff options
context:
space:
mode:
authorVictor Kareh <[email protected]>2018-03-29 16:09:16 -0400
committerraveit65 <[email protected]>2018-04-05 09:08:43 +0200
commit1a14801e9e24139efd5bff2a351405fd05d44096 (patch)
treee45d017bb1a88502acd70494bafff05d1888d86b /src/caja-window.c
parent4c377bad72d5c873999c09fcbc8a2ac6aa76d4d6 (diff)
downloadcaja-1a14801e9e24139efd5bff2a351405fd05d44096.tar.bz2
caja-1a14801e9e24139efd5bff2a351405fd05d44096.tar.xz
Scale screen dimensions
Diffstat (limited to 'src/caja-window.c')
-rw-r--r--src/caja-window.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/caja-window.c b/src/caja-window.c
index ac22b6d8..132ffd96 100644
--- a/src/caja-window.c
+++ b/src/caja-window.c
@@ -507,7 +507,8 @@ caja_window_zoom_to_default (CajaWindow *window)
static guint
get_max_forced_height (GdkScreen *screen)
{
- return (HeightOfScreen (gdk_x11_screen_get_xscreen (screen)) * 90) / 100;
+ gint scale = gdk_window_get_scale_factor (gdk_screen_get_root_window (screen));
+ return (HeightOfScreen (gdk_x11_screen_get_xscreen (screen)) / scale * 90) / 100;
}
/* Code should never force the window wider than this size.
@@ -516,7 +517,8 @@ get_max_forced_height (GdkScreen *screen)
static guint
get_max_forced_width (GdkScreen *screen)
{
- return (WidthOfScreen (gdk_x11_screen_get_xscreen (screen)) * 90) / 100;
+ gint scale = gdk_window_get_scale_factor (gdk_screen_get_root_window (screen));
+ return (WidthOfScreen (gdk_x11_screen_get_xscreen (screen)) / scale * 90) / 100;
}
/* This must be called when construction of CajaWindow is finished,