Skip to content

Commit

Permalink
fix window decorations on gnome < 3.26
Browse files Browse the repository at this point in the history
  • Loading branch information
olibia committed Oct 28, 2017
1 parent 93c66e2 commit c2deb98
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions [email protected]/modules/windowDecoration.js
Original file line number Diff line number Diff line change
Expand Up @@ -41,9 +41,13 @@ var WindowDecoration = new Lang.Class({

_toggleMaximize: function (win) {
if (this._needsMaxUnmax && win.get_maximized() === MAXIMIZED) {
Mainloop.idle_add(function () {
win._doingMaxUnmax = true;

Mainloop.timeout_add(50, function () {
win.unmaximize(MAXIMIZED);
win.maximize(MAXIMIZED);

win._doingMaxUnmax = false;
});
}
},
Expand All @@ -59,7 +63,7 @@ var WindowDecoration = new Lang.Class({
},

_showTitlebar: function (win) {
if (win && win._decorationOFF && win._windowXID) {
if (win && !win._doingMaxUnmax && win._decorationOFF && win._windowXID) {
win._decorationOFF = false;

this._toggleTitlebar(win._windowXID, false);
Expand All @@ -68,7 +72,7 @@ var WindowDecoration = new Lang.Class({
},

_hideTitlebar: function (win) {
if (win && win.decorated) {
if (win && !win._doingMaxUnmax && win.decorated) {
if (!win._windowXID) {
win._windowXID = Helpers.getXWindow(win);
}
Expand Down Expand Up @@ -132,6 +136,7 @@ var WindowDecoration = new Lang.Class({

delete win._decorationOFF;
delete win._windowXID;
delete win._doingMaxUnmax;
})));
},

Expand Down

0 comments on commit c2deb98

Please sign in to comment.