Merge lp:~kaihengfeng/unity-greeter/fix-hidpi-trasition-wallpaper into lp:unity-greeter

Proposed by Kai-Heng Feng on 2016-03-16
Status: Merged
Merged at revision: 1839
Proposed branch: lp:~kaihengfeng/unity-greeter/fix-hidpi-trasition-wallpaper
Merge into: lp:unity-greeter
Diff against target: 44 lines (+10/-4)
1 file modified
src/unity-greeter.vala (+10/-4)
To merge this branch: bzr merge lp:~kaihengfeng/unity-greeter/fix-hidpi-trasition-wallpaper
Reviewer Review Type Date Requested Status
Robert Ancell 2016-03-16 Approve on 2016-03-17
Review via email: mp+289137@code.launchpad.net

Description of the Change

Explicitly set scale and geometry for Cairo.XlibSurface. (LP: #1557893)

To post a comment you must log in.
Robert Ancell (robert-ancell) wrote :

The code change makes sense to me, I just don't have any high DPI hardware to confirm.

review: Approve
Sebastien Bacher (seb128) wrote :

Looks like an improvement to me, I don't have hidpi hardware either but I force some scaling by replacing the binary by a wrapper setting GDK_SCALE and calling the greeter and there was graphical corruption before which seems solved by those change, great work!
(I still see a greeter bg -> empty screen -> wrongly scaled/tiled bg -> session bg sequence, but that tiled bg seems more a session/nautilus issue, I think the unity-greeter issue is resolved)

Robert Ancell (robert-ancell) wrote :

Thanks Kai-Heng!

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'src/unity-greeter.vala'
2--- src/unity-greeter.vala 2015-10-26 22:42:32 +0000
3+++ src/unity-greeter.vala 2016-03-16 06:55:13 +0000
4@@ -183,11 +183,16 @@
5
6 public bool start_session (string? session, Background bg)
7 {
8+ /* Explicitly set the right scale before closing window */
9+ var screen = Gdk.Screen.get_default ();
10+ var scale = screen.get_monitor_scale_factor (screen.get_number ());
11+ background_surface.set_device_scale (scale, scale);
12+
13 /* Paint our background onto the root window before we close our own window */
14 var c = new Cairo.Context (background_surface);
15 bg.draw_full (c, Background.DrawFlags.NONE);
16 c = null;
17- refresh_background (Gdk.Screen.get_default (), background_surface);
18+ refresh_background (screen, background_surface);
19
20 if (test_mode)
21 {
22@@ -387,18 +392,19 @@
23 var visual = screen.get_system_visual ();
24
25 unowned X.Display display = (screen.get_display () as Gdk.X11.Display).get_xdisplay ();
26+ unowned X.Screen xscreen = (screen as Gdk.X11.Screen).get_xscreen ();
27
28 var pixmap = X.CreatePixmap (display,
29 (screen.get_root_window () as Gdk.X11.Window).get_xid (),
30- screen.get_width (),
31- screen.get_height (),
32+ xscreen.width_of_screen (),
33+ xscreen.height_of_screen (),
34 visual.get_depth ());
35
36 /* Convert into a Cairo surface */
37 var surface = new Cairo.XlibSurface (display,
38 pixmap,
39 (visual as Gdk.X11.Visual).get_xvisual (),
40- screen.get_width (), screen.get_height ());
41+ xscreen.width_of_screen (), xscreen.height_of_screen ());
42
43 return surface;
44 }

Subscribers

People subscribed via source and target branches