mirror of
https://github.com/gosticks/PaperWM.git
synced 2026-10-05 11:46:57 +00:00
WIP: Make the hot corner show the top bar
Having the hot corner activate the overview works rather poorly with scrolling through the workspaces. We override the functionality to instead show the top bar, making it possible to scroll to another workspace if a fullscreen window is active.
This commit is contained in:
+31
@@ -4,15 +4,43 @@
|
||||
around these problems.
|
||||
*/
|
||||
|
||||
var Extension = imports.misc.extensionUtils.extensions['paperwm@hedning:matrix.org'];
|
||||
|
||||
var Meta = imports.gi.Meta;
|
||||
var Main = imports.ui.main;
|
||||
var prefs = Extension.imports.settings.prefs;
|
||||
var utils = Extension.imports.utils;
|
||||
|
||||
function overrideHotCorners() {
|
||||
for (let corner of Main.layoutManager.hotCorners) {
|
||||
if (!corner)
|
||||
return;
|
||||
|
||||
corner._toggleOverview = function() {
|
||||
};
|
||||
|
||||
corner._pressureBarrier._trigger = function() {
|
||||
this._isTriggered = true;
|
||||
Extension.imports.topbar.show();
|
||||
this._reset();
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
var orgUpdateState;
|
||||
var signals;
|
||||
function init() {
|
||||
orgUpdateState = imports.ui.messageTray.MessageTray.prototype._updateState;
|
||||
signals = new utils.Signals();
|
||||
}
|
||||
|
||||
function enable() {
|
||||
|
||||
if (prefs.override_hot_corner) {
|
||||
overrideHotCorners();
|
||||
signals.connect(Main.layoutManager, 'hot-corners-changed', overrideHotCorners);
|
||||
}
|
||||
|
||||
// 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 +109,7 @@ function enable() {
|
||||
|
||||
function disable() {
|
||||
imports.ui.messageTray.MessageTray.prototype._updateState = orgUpdateState;
|
||||
|
||||
Main.layoutManager._updateHotCorners();
|
||||
signals.destroy();
|
||||
}
|
||||
|
||||
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>Make the hot corner force top bar visibility</summary>
|
||||
</key>
|
||||
|
||||
<key type="as" name="workspace-colors">
|
||||
<default><![CDATA[['#314E6C', '#565248', '#445632', '#663822',
|
||||
'#494066', '#826647', '#4B6983', '#807D74', '#5D7555', '#884631',
|
||||
|
||||
+3
-1
@@ -22,7 +22,8 @@ var prefs = {
|
||||
window_gap: settings.get_int('window-gap'),
|
||||
vertical_margin: settings.get_int('vertical-margin'),
|
||||
horizontal_margin: settings.get_int('horizontal-margin'),
|
||||
workspace_colors: settings.get_strv('workspace-colors')
|
||||
workspace_colors: settings.get_strv('workspace-colors'),
|
||||
override_hot_corner: settings.get_boolean('override-hot-corner')
|
||||
};
|
||||
|
||||
function setVerticalMargin() {
|
||||
@@ -68,6 +69,7 @@ setSchemas(); // Initialize imediately so prefs.js can import properly
|
||||
function init() {
|
||||
settings.connect('changed::window-gap', setState);
|
||||
settings.connect('changed::horizontal-margin', setState);
|
||||
settings.connect('changed::override-hot-corner', setState);
|
||||
settings.connect('changed::vertical-margin', setVerticalMargin);
|
||||
setVerticalMargin();
|
||||
settings.connect('changed::workspace-colors', setState);
|
||||
|
||||
Reference in New Issue
Block a user