diff options
author | Victor Kareh <[email protected]> | 2018-03-29 16:09:16 -0400 |
---|---|---|
committer | raveit65 <[email protected]> | 2018-04-05 09:08:43 +0200 |
commit | 1a14801e9e24139efd5bff2a351405fd05d44096 (patch) | |
tree | e45d017bb1a88502acd70494bafff05d1888d86b /src/caja-desktop-window.c | |
parent | 4c377bad72d5c873999c09fcbc8a2ac6aa76d4d6 (diff) | |
download | caja-1a14801e9e24139efd5bff2a351405fd05d44096.tar.bz2 caja-1a14801e9e24139efd5bff2a351405fd05d44096.tar.xz |
Scale screen dimensions
Diffstat (limited to 'src/caja-desktop-window.c')
-rw-r--r-- | src/caja-desktop-window.c | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/src/caja-desktop-window.c b/src/caja-desktop-window.c index 2aa0c2f5..16242dcd 100644 --- a/src/caja-desktop-window.c +++ b/src/caja-desktop-window.c @@ -114,9 +114,12 @@ caja_desktop_window_screen_size_changed (GdkScreen *screen, CajaDesktopWindow *window) { int width_request, height_request; + int scale; - width_request = WidthOfScreen (gdk_x11_screen_get_xscreen (screen)); - height_request = HeightOfScreen (gdk_x11_screen_get_xscreen (screen)); + scale = gdk_window_get_scale_factor (gdk_screen_get_root_window (screen)); + + width_request = WidthOfScreen (gdk_x11_screen_get_xscreen (screen)) / scale; + height_request = HeightOfScreen (gdk_x11_screen_get_xscreen (screen)) / scale; g_object_set (window, "width_request", width_request, @@ -130,9 +133,12 @@ caja_desktop_window_new (CajaApplication *application, { CajaDesktopWindow *window; int width_request, height_request; + int scale; + + scale = gdk_window_get_scale_factor (gdk_screen_get_root_window (screen)); - width_request = WidthOfScreen (gdk_x11_screen_get_xscreen (screen)); - height_request = HeightOfScreen (gdk_x11_screen_get_xscreen (screen)); + width_request = WidthOfScreen (gdk_x11_screen_get_xscreen (screen)) / scale; + height_request = HeightOfScreen (gdk_x11_screen_get_xscreen (screen)) / scale; window = CAJA_DESKTOP_WINDOW (gtk_widget_new (caja_desktop_window_get_type(), |