aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorRobert Ancell <robert.ancell@canonical.com>2016-09-15 09:13:38 +0000
committerMike Gabriel <mike.gabriel@das-netzwerkteam.de>2016-09-15 09:13:38 +0000
commit65cc346ec06950aea99b033ee0155310208a8c6f (patch)
tree29bf15e7e09440078c16f84527c6350d4a8fe5f5 /src
parent440a813afff0260ed0030c9debf1c15a60121a7f (diff)
downloadarctica-greeter-65cc346ec06950aea99b033ee0155310208a8c6f.tar.gz
arctica-greeter-65cc346ec06950aea99b033ee0155310208a8c6f.tar.bz2
arctica-greeter-65cc346ec06950aea99b033ee0155310208a8c6f.zip
Explicitly set scale and geometry for Cairo.XlibSurface.
Diffstat (limited to 'src')
-rw-r--r--src/arctica-greeter.vala14
1 files changed, 10 insertions, 4 deletions
diff --git a/src/arctica-greeter.vala b/src/arctica-greeter.vala
index 82a4578..1a9d0cb 100644
--- a/src/arctica-greeter.vala
+++ b/src/arctica-greeter.vala
@@ -170,11 +170,16 @@ public class ArcticaGreeter
public bool start_session (string? session, Background bg)
{
+ /* Explicitly set the right scale before closing window */
+ var screen = Gdk.Screen.get_default ();
+ var scale = screen.get_monitor_scale_factor (screen.get_number ());
+ background_surface.set_device_scale (scale, scale);
+
/* Paint our background onto the root window before we close our own window */
var c = new Cairo.Context (background_surface);
bg.draw_full (c, Background.DrawFlags.NONE);
c = null;
- refresh_background (Gdk.Screen.get_default (), background_surface);
+ refresh_background (screen, background_surface);
if (test_mode)
{
@@ -374,18 +379,19 @@ public class ArcticaGreeter
var visual = screen.get_system_visual ();
unowned X.Display display = (screen.get_display () as Gdk.X11.Display).get_xdisplay ();
+ unowned X.Screen xscreen = (screen as Gdk.X11.Screen).get_xscreen ();
var pixmap = X.CreatePixmap (display,
(screen.get_root_window () as Gdk.X11.Window).get_xid (),
- screen.get_width (),
- screen.get_height (),
+ xscreen.width_of_screen (),
+ xscreen.height_of_screen (),
visual.get_depth ());
/* Convert into a Cairo surface */
var surface = new Cairo.XlibSurface (display,
pixmap,
(visual as Gdk.X11.Visual).get_xvisual (),
- screen.get_width (), screen.get_height ());
+ xscreen.width_of_screen (), xscreen.height_of_screen ());
return surface;
}