mirror of
https://github.com/gosticks/PaperWM.git
synced 2026-07-01 14:40:02 +00:00
Disable the hot corner by default
Having the hot corner activate the overview works rather poorly with scrolling through the workspaces. We disable the functionality by default. The preference `override-hot-corner` controls the functionality, so set it to false if you want it back. A possibility is having the hot-corner force the top bar to be visible when a fullscreen window has focus, but it's not yet implemented.
This commit is contained in:
41
kludges.js
41
kludges.js
@@ -4,15 +4,53 @@
|
||||
around these problems.
|
||||
*/
|
||||
|
||||
var Extension = imports.misc.extensionUtils.extensions['paperwm@hedning:matrix.org'];
|
||||
|
||||
var Meta = imports.gi.Meta;
|
||||
var Main = imports.ui.main;
|
||||
var utils = Extension.imports.utils;
|
||||
|
||||
var Convenience = Extension.imports.convenience;
|
||||
var settings = Convenience.getSettings();
|
||||
|
||||
function overrideHotCorners() {
|
||||
for (let corner of Main.layoutManager.hotCorners) {
|
||||
if (!corner)
|
||||
return;
|
||||
|
||||
corner._toggleOverview = function() {};
|
||||
|
||||
corner._pressureBarrier._trigger = function() {};
|
||||
}
|
||||
}
|
||||
|
||||
function disableHotcorners() {
|
||||
let override = settings.get_boolean("override-hot-corner");
|
||||
if (override) {
|
||||
overrideHotCorners();
|
||||
signals.connect(Main.layoutManager,
|
||||
'hot-corners-changed',
|
||||
overrideHotCorners);
|
||||
} else {
|
||||
signals.disconnect(Main.layoutManager);
|
||||
Main.layoutManager._updateHotCorners();
|
||||
}
|
||||
}
|
||||
|
||||
var orgUpdateState;
|
||||
var signals;
|
||||
function init() {
|
||||
orgUpdateState = imports.ui.messageTray.MessageTray.prototype._updateState;
|
||||
signals = new utils.Signals();
|
||||
}
|
||||
|
||||
function enable() {
|
||||
|
||||
signals.connect(settings,
|
||||
'changed::override-hot-corner',
|
||||
disableHotcorners);
|
||||
disableHotcorners();
|
||||
|
||||
// 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 +119,7 @@ function enable() {
|
||||
|
||||
function disable() {
|
||||
imports.ui.messageTray.MessageTray.prototype._updateState = orgUpdateState;
|
||||
|
||||
signals.destroy();
|
||||
Main.layoutManager._updateHotCorners();
|
||||
}
|
||||
|
||||
Binary file not shown.
@@ -196,6 +196,11 @@
|
||||
<summary>Minimum gap between windows</summary>
|
||||
</key>
|
||||
|
||||
<key type="b" name="override-hot-corner">
|
||||
<default>true</default>
|
||||
<summary>Disable the upper left hot corner</summary>
|
||||
</key>
|
||||
|
||||
<key type="as" name="workspace-colors">
|
||||
<default><![CDATA[['#314E6C', '#565248', '#445632', '#663822',
|
||||
'#494066', '#826647', '#4B6983', '#807D74', '#5D7555', '#884631',
|
||||
|
||||
Reference in New Issue
Block a user