[gnome-shell-extensions] nativeWindowPlacement: Handle captions-on-top settings changes



commit 778eebc42121b8a3477d48c90c585e2407e42fa7
Author: Florian Müllner <fmuellner gnome org>
Date:   Wed Sep 20 02:35:12 2017 +0200

    nativeWindowPlacement: Handle captions-on-top settings changes
    
    Currently the injection to move title captions to the top depends on
    the value of the setting at the time the extension is enabled.
    Instead, do the injections unconditionally and query the setting
    inside the function to pick up settings changes.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=787934

 extensions/native-window-placement/extension.js |   13 ++++++-------
 1 files changed, 6 insertions(+), 7 deletions(-)
---
diff --git a/extensions/native-window-placement/extension.js b/extensions/native-window-placement/extension.js
index e19ad64..cce84aa 100644
--- a/extensions/native-window-placement/extension.js
+++ b/extensions/native-window-placement/extension.js
@@ -91,7 +91,6 @@ function enable() {
 
     let settings = Convenience.getSettings();
     let useMoreScreen = settings.get_boolean('use-more-screen');
-    let windowCaptionsOnTop = settings.get_boolean('window-captions-on-top');
     let signalId = settings.connect('changed::use-more-screen', function() {
         useMoreScreen = settings.get_boolean('use-more-screen');
     });
@@ -370,15 +369,15 @@ function enable() {
 
 
     /// position window titles on top of windows in overlay ////
-    if (windowCaptionsOnTop) {
-        winInjections['relayout'] = Workspace.WindowOverlay.prototype.relayout;
-        Workspace.WindowOverlay.prototype.relayout = function(animate) {
+    winInjections['relayout'] = Workspace.WindowOverlay.prototype.relayout;
+    Workspace.WindowOverlay.prototype.relayout = function(animate) {
+        if (settings.get_boolean('window-captions-on-top')) {
             let [, , , cloneHeight] = this._windowClone.slot;
             this.title.translation_y = -cloneHeight;
+        }
 
-            winInjections['relayout'].call(this, animate);
-        };
-    }
+        winInjections['relayout'].call(this, animate);
+    };
 }
 
 function removeInjection(object, injection, name) {


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]