scratch: Test out using above/minimized as scratch indicators

In addition to making `always on visible workspace` work for multimonitor setups
this makes it possible to have workspace local scratch windows.
This commit is contained in:
Tor Hedin Brønner
2018-01-11 12:59:32 +01:00
parent ab9d4c6a99
commit af339aedca

View File

@@ -4,7 +4,7 @@ const utils = Extension.imports.utils;
const debug = utils.debug;
function isScratchWindow(metaWindow) {
return metaWindow && metaWindow.is_on_all_workspaces();
return metaWindow && (metaWindow.above || metaWindow.minimized);
}
/** Return scratch windows in MRU order */
@@ -47,10 +47,17 @@ function enable() {
function (window) {
let item;
item = this.addAction(_('Scratch'), Lang.bind(this, function() {
if (isScratchWindow(window))
window.unstick();
else
if (isScratchWindow(window)) {
window.unmake_above();
// Make sure to detach and attach the window to the
// workspace
window.stick();
window.unstick();
}
else {
window.make_above();
window.stick();
}
}));
if (isScratchWindow(window))
item.setOrnament(PopupMenu.Ornament.CHECK);