Skip to content

Commit

Permalink
decorations: alway use GLib.idle_add when toggling decorations
Browse files Browse the repository at this point in the history
  • Loading branch information
jonian committed Mar 17, 2019
1 parent c107906 commit 78d1821
Showing 1 changed file with 8 additions and 14 deletions.
22 changes: 8 additions & 14 deletions [email protected]/modules/windowDecoration.js
Original file line number Diff line number Diff line change
Expand Up @@ -68,10 +68,12 @@ var WindowDecoration = new Lang.Class({
let winId = this._getWindowXID(win);
if (!winId) return;

if (this._useMotifHints)
this._toggleDecorationsMotif(winId, hide);
else
this._toggleDecorationsGtk(winId, hide);
GLib.idle_add(0, () => {
if (this._useMotifHints)
this._toggleDecorationsMotif(winId, hide);
else
this._toggleDecorationsGtk(winId, hide);
});
},

_toggleDecorationsGtk(winId, hide) {
Expand Down Expand Up @@ -156,21 +158,13 @@ var WindowDecoration = new Lang.Class({
loadUserStyles('');
},

_undecorateWindow(win) {
GLib.idle_add(0, () => { this._toggleTitlebar(win) });
},

_undecorateWindows() {
let windows = this._getAllWindows();
windows.forEach(win => { this._undecorateWindow(win) });
},

_decorateWindow(win) {
GLib.idle_add(0, () => { this._resetDecorations(win) });
windows.forEach(win => { this._toggleTitlebar(win) });
},

_decorateWindows() {
let windows = this._getAllWindows();
windows.forEach(win => { this._decorateWindow(win) });
windows.forEach(win => { this._resetDecorations(win) });
}
});

0 comments on commit 78d1821

Please sign in to comment.