From d753e13fbb5b090f2b69901a658df5098d655f40 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tor=20Hedin=20Br=C3=B8nner?= Date: Sun, 15 Jul 2018 21:06:16 +0200 Subject: [PATCH] Only show scratch windows in the overview --- kludges.js | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/kludges.js b/kludges.js index b5c0199..129dcfd 100644 --- a/kludges.js +++ b/kludges.js @@ -4,15 +4,25 @@ around these problems. */ +var Extension = imports.misc.extensionUtils.extensions['paperwm@hedning:matrix.org']; +var Scratch = Extension.imports.scratch; var Meta = imports.gi.Meta; +var Workspace = imports.ui.workspace; -var orgUpdateState; + +var orgUpdateState, _isOverviewWindow; function init() { orgUpdateState = imports.ui.messageTray.MessageTray.prototype._updateState; + _isOverviewWindow = Workspace.Workspace.prototype._isOverviewWindow; } function enable() { + + Workspace.Workspace.prototype._isOverviewWindow = (win) => { + let metaWindow = win.meta_window; + return Scratch.isScratchWindow(metaWindow) && !metaWindow.skip_taskbar; + }; // Don't hide notifications when there's fullscreen windows in the workspace. // Fullscreen windows aren't special in paperWM and might not even be // visible, so hiding notifications makes no sense. @@ -81,4 +91,5 @@ function enable() { function disable() { imports.ui.messageTray.MessageTray.prototype._updateState = orgUpdateState; + Workspace.Workspace.prototype._isOverviewWindow = _isOverviewWindow; }