From 778eebc42121b8a3477d48c90c585e2407e42fa7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Florian=20M=C3=BCllner?= Date: Wed, 20 Sep 2017 02:35:12 +0200 Subject: [PATCH] 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 file changed, 6 insertions(+), 7 deletions(-) diff --git a/extensions/native-window-placement/extension.js b/extensions/native-window-placement/extension.js index e19ad64c..cce84aac 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) {