mirror of
https://github.com/gosticks/PaperWM.git
synced 2026-12-04 04:11:38 +00:00
Avoid moving the top bar when it's stuck on primary
With `topbar-follow-focus` set to false we still moved the topbar (to its own position). This caused issues with dash-to-panel with panels on all monitors. So only move the topbar to the primary monitor when `topbar-follow-focus` is toggled off by the user. There's still some issues with dash-to-panel and the workarea on secondary monitors, but this makes it at least somewhat usable. Co-authored-by: Simon Epstein <simon.epstein@67bricks.com>
This commit is contained in:
co-authored by
Simon Epstein
parent
ac54a572db
commit
c98fe8556e
@@ -539,13 +539,15 @@ function enable () {
|
||||
|
||||
signals.connect(Settings.settings, 'changed::topbar-follow-focus', (settings, key) => {
|
||||
let monitors = Tiling.spaces.monitors;
|
||||
if (!settings.prefs.topbar_follow_focus) {
|
||||
moveTopBarTo(Main.layoutManager.primaryMonitor);
|
||||
}
|
||||
let to = setMonitor(Main.layoutManager.focusMonitor);
|
||||
let space = monitors.get(to);
|
||||
updateWorkspaceIndicator(space.workspace.index());
|
||||
for (let [workspace, space] of Tiling.spaces) {
|
||||
space.layout();
|
||||
}
|
||||
|
||||
});
|
||||
|
||||
signals.connect(panelBox, 'show', () => {
|
||||
@@ -622,8 +624,16 @@ function setWorkspaceName (name) {
|
||||
}
|
||||
|
||||
function setMonitor(monitor) {
|
||||
if (!prefs.topbar_follow_focus)
|
||||
monitor = Main.layoutManager.primaryMonitor;
|
||||
if (prefs.topbar_follow_focus) {
|
||||
moveTopBarTo(monitor);
|
||||
} else {
|
||||
monitor = Main.layoutManager.primaryMonitor
|
||||
}
|
||||
panelMonitor = monitor;
|
||||
return monitor;
|
||||
}
|
||||
|
||||
function moveTopBarTo(monitor) {
|
||||
let panelBox = Main.layoutManager.panelBox;
|
||||
panelMonitor = monitor;
|
||||
panelBox.set_position(monitor.x, monitor.y);
|
||||
|
||||
Reference in New Issue
Block a user