From 31ce82f151b564532211e05e97ffaf1db02abdcd Mon Sep 17 00:00:00 2001 From: Clement Lefebvre Date: Tue, 20 Jun 2017 15:42:34 +0200 Subject: Don't draw the background before starting the session. Drawing the background on the root window causes the following issues: - The settings daemon sets the DE resolution and that can break the aspect of the background - Depending on configuration and distros, the background rendered by the greeter may or may not be the same as the users's. - Some DEs such as Cinnamon render a login animation, which looks good on a black screen but not when a background is drawn. Potential for regression: Minimal DEs and WM should be tested to ensure the default state of the root window is OK. We might have to clear that window or explicitly paint it black (or the background color chosen by the user). --- src/arctica-greeter.vala | 23 ----------------------- 1 file changed, 23 deletions(-) (limited to 'src') diff --git a/src/arctica-greeter.vala b/src/arctica-greeter.vala index 5048bf9..0369eb7 100644 --- a/src/arctica-greeter.vala +++ b/src/arctica-greeter.vala @@ -230,18 +230,11 @@ 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 display = Gdk.Display.get_default(); var monitor = display.get_primary_monitor(); var scale = monitor.get_scale_factor (); 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 (screen, background_surface); - main_window.before_session_start(); if (test_mode) @@ -500,22 +493,6 @@ public class ArcticaGreeter return surface; } - private static void refresh_background (Gdk.Screen screen, Cairo.XlibSurface surface) - { - Gdk.flush (); - - unowned X.Display display = (screen.get_display () as Gdk.X11.Display).get_xdisplay (); - - /* Ensure Cairo has actually finished its drawing */ - surface.flush (); - /* Use this pixmap for the background */ - X.SetWindowBackgroundPixmap (display, - (screen.get_root_window () as Gdk.X11.Window).get_xid (), - surface.get_drawable ()); - - X.ClearWindow (display, (screen.get_root_window () as Gdk.X11.Window).get_xid ()); - } - private static void log_cb (string? log_domain, LogLevelFlags log_level, string message) { string prefix; -- cgit v1.2.3