From f6fdeae869e6af1d6c4b13645ab10d703073cfba Mon Sep 17 00:00:00 2001 From: Colin Guthrie <colin@mageia.org> Date: Thu, 9 Oct 2014 19:32:04 +0100 Subject: [PATCH 1/2] screenShield: Allow for custom backgrounds on login screen. Up until now the only customised backgrounds allowed was on the actual shield itself, not the actual password entry screens. This patch is based on a throw-away patch by Ray Strode which we used in Mageia to provide a little bit of customisation. By default the look+feel will be unaffected, but with appropriate settings (in the corresponding org.gnome.desktop.background.login schema added in gsettings-desktop-schemas) it can be customised to taste. https://bugzilla.gnome.org/show_bug.cgi?id=738260 --- data/theme/gnome-shell.css | 7 +++---- js/ui/screenShield.js | 36 +++++++++++++++++++++++++++++++++--- 2 files changed, 36 insertions(+), 7 deletions(-) diff --git a/data/theme/gnome-shell.css b/data/theme/gnome-shell.css index 2e09c1c..44ca916 100644 --- a/data/theme/gnome-shell.css +++ b/data/theme/gnome-shell.css @@ -1689,14 +1689,13 @@ StScrollBar { #panel.lock-screen { background-color: rgba(46, 52, 54, 0.5); } +.login-background { + background: black; } + .screen-shield-background { background: black; box-shadow: 0px 2px 4px rgba(0, 0, 0, 0.4); } -#lockDialogGroup { - background: #2e3436 url(resource:///org/gnome/shell/theme/noise-texture.png); - background-repeat: repeat; } - #screenShieldNotifications StButton#vhandle, #screenShieldNotifications StButton#hhandle { background-color: rgba(57, 63, 63, 0.3); } #screenShieldNotifications StButton#vhandle:hover, #screenShieldNotifications StButton#vhandle:focus, #screenShieldNotifications StButton#hhandle:hover, #screenShieldNotifications StButton#hhandle:focus { diff --git a/js/ui/screenShield.js b/js/ui/screenShield.js index d8d991c..e0998da 100644 --- a/js/ui/screenShield.js +++ b/js/ui/screenShield.js @@ -29,6 +29,7 @@ const SmartcardManager = imports.misc.smartcardManager; const Tweener = imports.ui.tweener; const Util = imports.misc.util; +const LOGIN_SCHEMA = 'org.gnome.desktop.background.login'; const SCREENSAVER_SCHEMA = 'org.gnome.desktop.screensaver'; const LOCK_ENABLED_KEY = 'lock-enabled'; const LOCK_DELAY_KEY = 'lock-delay'; @@ -437,8 +438,12 @@ const ScreenShield = new Lang.Class({ this._lockScreenGroup.add_actor(this._lockScreenContents); - this._backgroundGroup = new Clutter.Actor(); + this._backgroundLoginGroup = new Clutter.Actor(); + this.actor.add_actor(this._backgroundLoginGroup); + this._backgroundLoginGroup.lower_bottom(); + this._bgLoginManagers = []; + this._backgroundGroup = new Clutter.Actor(); this._lockScreenGroup.add_actor(this._backgroundGroup); this._backgroundGroup.lower_bottom(); this._bgManagers = []; @@ -562,6 +567,24 @@ const ScreenShield = new Lang.Class({ this._syncInhibitor(); }, + _createLoginBackground: function(monitorIndex) { + let monitor = Main.layoutManager.monitors[monitorIndex]; + let widget = new St.Widget({ style_class: 'login-background', + x: monitor.x, + y: monitor.y, + width: monitor.width, + height: monitor.height }); + + let bgManager = new Background.BackgroundManager({ container: widget, + monitorIndex: monitorIndex, + controlPosition: false, + settingsSchema: LOGIN_SCHEMA }); + + this._bgLoginManagers.push(bgManager); + + this._backgroundLoginGroup.add_child(widget); + }, + _createBackground: function(monitorIndex) { let monitor = Main.layoutManager.monitors[monitorIndex]; let widget = new St.Widget({ style_class: 'screen-shield-background', @@ -581,14 +604,21 @@ const ScreenShield = new Lang.Class({ }, _updateBackgrounds: function() { - for (let i = 0; i < this._bgManagers.length; i++) + for (let i = 0; i < this._bgManagers.length; i++) { + this._bgLoginManagers[i].destroy(); this._bgManagers[i].destroy(); + } + this._bgLoginManagers = []; this._bgManagers = []; + + this._backgroundLoginGroup.destroy_all_children(); this._backgroundGroup.destroy_all_children(); - for (let i = 0; i < Main.layoutManager.monitors.length; i++) + for (let i = 0; i < Main.layoutManager.monitors.length; i++) { + this._createLoginBackground(i); this._createBackground(i); + } }, _liftShield: function(onPrimary, velocity) { -- 2.7.1