Skip to content

Fix tiled windows positioned behind top bar on workspace move#1809

Open
cagostino wants to merge 1 commit intopop-os:master_noblefrom
cagostino:fix/window-behind-topbar
Open

Fix tiled windows positioned behind top bar on workspace move#1809
cagostino wants to merge 1 commit intopop-os:master_noblefrom
cagostino:fix/window-behind-topbar

Conversation

@cagostino
Copy link
Copy Markdown

monitor_work_area() always queries the active workspace for work area geometry, even when tiling a window that just moved to a different workspace. when a window gets moved between workspaces, the workspace-changed signal fires and pop-shell detaches + reattaches the window to the new workspace's tiling tree. during that reattach, it calls monitor_work_area() to figure out where to place the window — but since the active workspace hasn't switched yet, get_work_area_for_monitor() returns geometry for the wrong workspace. depending on timing, this can return y=0 instead of y=panel_height, so the window gets tiled behind the top bar.

the fix adds an optional workspace_idx parameter to monitor_work_area() so callers that know which workspace they're targeting can pass it explicitly instead of relying on the active workspace. all tiling codepaths that have fork/workspace context (attach_to_monitor, update_toplevel, detach_window, smart gap recalculations) now pass the actual workspace index. callers that genuinely operate on the active workspace (launcher, snap, display readiness check) are left unchanged.

this also explains why the bug is intermittent — it depends on whether gnome has finished switching the active workspace by the time the tiling code runs.

fixes #1565

…_work_area always queried the active workspace for work area geometry, even when tiling windows on a different workspace. When a window was moved to another workspace, the work area calculation could return y=0 instead of accounting for the top bar height, because the active workspace hadn't switched yet.
@jacobgkau jacobgkau requested review from a team March 16, 2026 22:01
@jacobktm jacobktm self-assigned this Mar 30, 2026
@jacobktm
Copy link
Copy Markdown

jacobktm commented Apr 2, 2026

I haven't been able to recreate this issue before applying this PR in order to verify that this resolves the issue. I noticed that the OS in the referenced issue is pop 22.04 but this PR looks like it's targeting pop 24.04, are you also having this issue in pop 24.04 and if so is there a set of steps I could use to recreate it?

@jacobgkau
Copy link
Copy Markdown
Member

jacobgkau commented Apr 2, 2026

@jacobktm It sounds like the issue's intermittent (sounds like a race condition). We can probably just regression test this since engineering approved the approach.

The PR targeting the Noble branch means this is for users of the extension on non-Pop distros (or would apply if someone's replaced COSMIC with GNOME on Pop).

@cagostino
Copy link
Copy Markdown
Author

actually no it should be targeting 22.04, i don't know if this issue occurs on 24.04 so that is my bad for specifying that incorrectly.

@jacobgkau
Copy link
Copy Markdown
Member

Ok. @cagostino Your earlier PR, #1808, was targeting the correct branch for 22.04 (master_jammy), but included a lot of unnecessary (and breaking) commits since it was based on the default master_noble branch. Can you rebase on master_jammy?

@cagostino
Copy link
Copy Markdown
Author

yeah i'll get this worked out tn

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Windows are partly covered behind top bar

4 participants