From eee86ce5569c4c97ad4d89c7b259cccb47c18649 Mon Sep 17 00:00:00 2001 From: Jonian Guveli Date: Sun, 14 Jan 2018 16:03:14 +0200 Subject: [PATCH] optimize showTitlebar in windowDecoration module --- unite@hardpixel.eu/modules/windowDecoration.js | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/unite@hardpixel.eu/modules/windowDecoration.js b/unite@hardpixel.eu/modules/windowDecoration.js index b1283ff..09c287a 100644 --- a/unite@hardpixel.eu/modules/windowDecoration.js +++ b/unite@hardpixel.eu/modules/windowDecoration.js @@ -82,11 +82,17 @@ var WindowDecoration = new Lang.Class({ }, _showTitlebar: function (win) { - if (win && !win._doingMaxUnmax && win.decorated && win._decorationOFF && win._windowXID) { - win._decorationOFF = false; + if (win && !win._doingMaxUnmax) { + if (!win._windowXID) { + win._windowXID = Helpers.getXWindow(win); + } - this._toggleTitlebar(win._windowXID, false); - this._toggleMaximize(win); + if (win._windowXID && win._decorationOFF) { + win._decorationOFF = false; + + this._toggleTitlebar(win._windowXID, false); + this._toggleMaximize(win); + } } },