Skip to content

A layer that changes monitor is not kept alive as the popups' parent (#136) - #138

Merged
k4ditano merged 1 commit into
k4ditano:mainfrom
datingesp-hash:ghost-layer
Nov 6, 2026
Merged

k4ditano merged 1 commit into
k4ditano:mainfrom
datingesp-hash:ghost-layer

Conversation

@datingesp-hash

Copy link
Copy Markdown
Contributor

Fixes the second problem in #136: after screens: from a text moves a surface to another monitor, its first layer can stay on the monitor it left. It stays mapped, frozen on its last frame, and does not take input. It looks as if the scene is on both monitors at once.

Cause

configured() stores a clone of the first configured layer as the popups' parent ("while the mouse hasn't been seen on any, popups hang from the first one"). That clone is only replaced when the pointer enters another surface. rescreen drops the layer everywhere else, but this clone keeps it alive. In a launcher driven by a controller, with the pointer hidden, it stayed there until the scene was closed.

Change

forget_parent(wl): when a layer goes (rescreen, remove_from, surface_gone), it stops being the popups' parent. The next layer configured takes that place, as at start.

Tested

Hyprland 0.57, three 1920×1080 monitors. Layers of the scene's pid from hyprctl layers -j, sampled every 20 ms:

slow moves 12 moves at 150 ms
0.7.22 the first layer stays (DP-1/20cf0 beside each new one) 2 layers in 135 of 153 samples
0.7.22 + this one layer each time never 2 (0 of 151)
  • The same with GlassLauncher, a full-screen launcher moved with screens: on_screen: 22 moves between two monitors (16 at 150 ms), 0 of 315 samples with two layers. Then tried by hand switching fast with the controller, and it no longer happens.
  • cargo test --release: 193 passed, 2 ignored.
  • I have not tested popups themselves after a move. They should hang from the next layer configured, as they do before the pointer is first seen.

🤖 Generated with Claude Code

…4ditano#136)

The first layer configured became the popups' parent ("while the mouse hasn't
been seen on any, popups hang from the first one"), and that clone was only
replaced when the pointer entered another surface. When `screens:` from a text
moved the surface to another monitor, the old layer was dropped everywhere else
but stayed alive through that clone: still mapped, frozen on its last frame, on
the monitor it left. A launcher driven by a controller (the pointer hidden)
kept it there until it was closed.

Now a layer that goes (rescreen, a monitor unplugged, surface_gone) stops being
the parent; the next one configured takes its place.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@k4ditano
k4ditano merged commit 81a4830 into k4ditano:main Nov 6, 2026
1 check passed
@k4ditano

k4ditano commented Nov 6, 2026

Copy link
Copy Markdown
Owner

Thanks, merged. A layer that leaves should never stay the popups' parent, and the fix is right where it belongs. I checked that a missing parent only skips a popup until the next layer configured takes the place, and ran the two-monitor move bench on it: same moves, the scene kept its state. It's out in 0.7.23.

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.

2 participants