summaryrefslogtreecommitdiff
path: root/src/gs-manager.c
diff options
context:
space:
mode:
authorVictor Kareh <[email protected]>2018-02-01 09:20:32 -0500
committerMartin Wimpress <[email protected]>2018-02-01 06:20:32 -0800
commitc862d81db1e0ae1ce1f62a3aac1d915f5036c81c (patch)
tree2c59e4d098c4beca891d10d067ca851ce53e56d9 /src/gs-manager.c
parent64d47ad9e43da564ea4c2b2ae2dd4b1ca22a8770 (diff)
downloadmate-screensaver-c862d81db1e0ae1ce1f62a3aac1d915f5036c81c.tar.bz2
mate-screensaver-c862d81db1e0ae1ce1f62a3aac1d915f5036c81c.tar.xz
Add HiDPI support for lock screen (#148)
* Password dialog is now scaled * Background of lock screen is now scaled
Diffstat (limited to 'src/gs-manager.c')
-rw-r--r--src/gs-manager.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/gs-manager.c b/src/gs-manager.c
index 130227b..36bb752 100644
--- a/src/gs-manager.c
+++ b/src/gs-manager.c
@@ -1309,6 +1309,7 @@ apply_background_to_window (GSManager *manager,
GdkScreen *screen;
int width;
int height;
+ gint scale;
mate_bg_load_from_preferences (manager->priv->bg);
@@ -1320,8 +1321,9 @@ apply_background_to_window (GSManager *manager,
display = gs_window_get_display (window);
screen = gdk_display_get_default_screen (display);
- width = WidthOfScreen (gdk_x11_screen_get_xscreen (screen));
- height = HeightOfScreen (gdk_x11_screen_get_xscreen (screen));
+ scale = gdk_window_get_scale_factor (gdk_screen_get_root_window (screen));
+ width = WidthOfScreen (gdk_x11_screen_get_xscreen (screen)) / scale;
+ height = HeightOfScreen (gdk_x11_screen_get_xscreen (screen)) / scale;
gs_debug ("Creating background w:%d h:%d", width, height);
surface = mate_bg_create_surface (manager->priv->bg,
gs_window_get_gdk_window (window),