Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

seat: Drop has_exclusive_layer #8032

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

Nefsen402
Copy link
Contributor

Fixes: #7936

In the transition to wlr_scene, I accidentally dropped a call to reset this has_exclusive_layer so once it was set, nothing could reset it afterwards and the compositor basically unusable. Let's just drop the has_exclusive_layer bool for something simpler and more robust.

@Nefsen402 Nefsen402 changed the title Layer exclusive focus seat: Drop has_exclusive_layer Mar 2, 2024
@@ -1315,11 +1317,6 @@ void seat_set_focus_layer(struct sway_seat *seat,
return;
}
assert(layer->surface->mapped);
if (layer->current.layer >= ZWLR_LAYER_SHELL_V1_LAYER_TOP &&
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Seems like we're loosing this condition here?

IOW, exclusive keyboard layers under the toplevels would never get focus before, but now they do.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why do we have this condition in the first place?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That's a decision we made when implementing layer-shell support. The motivation is that if a particular layer has focus, a lower level layer cannot get focus. So if a toplevel has focus, background/bottom cannot get focus.

@WhyNotHugo
Copy link
Contributor

WhyNotHugo commented May 7, 2024

I used shotman to test this and sway crashes when shotman runs:

...
00:00:23.802 [wlr] [render/gles2/renderer.c:158] Created GL FBO for buffer 1280x720
00:00:23.802 [wlr] [render/swapchain.c:106] Allocating new swapchain buffer
00:00:23.802 [wlr] [render/allocator/gbm.c:144] Allocated 10x16 GBM buffer with format AR24 (0x34325241), modifier Y_TILED_GEN12_RC_CCS_CC (0x0100000000000008)
00:00:23.802 [wlr] [render/gles2/renderer.c:158] Created GL FBO for buffer 10x16
00:00:23.803 [wlr] [types/output/render.c:146] Disabling direct scan-out on output 'WL-1' (locks: 1)
00:00:23.803 [wlr] [types/output/cursor.c:44] Disabling hardware cursors on output 'WL-1' (locks: 1)
00:00:23.806 [sway/desktop/transaction.c:872] Transaction 0x7f6ba1c86620 is ready
00:00:23.806 [sway/desktop/transaction.c:682] Applying transaction 0x7f6ba1c86620
00:00:23.807 [sway/desktop/transaction.c:786] Transaction 0x7f6ba1c857f0 committing with 2 instructions
00:00:23.807 [sway/desktop/transaction.c:682] Applying transaction 0x7f6ba1c857f0
00:00:23.807 [wlr] [types/output/cursor.c:386] Falling back to software cursor on output 'WL-1'
00:00:23.814 [wlr] [types/output/render.c:146] Enabling direct scan-out on output 'WL-1' (locks: 0)
00:00:23.814 [wlr] [types/output/cursor.c:44] Enabling hardware cursors on output 'WL-1' (locks: 0)
Assertion failed: layer->surface->mapped (sway/input/seat.c: seat_set_focus_layer: 1328)
 err: wayland.c:1447: failed to read events from the Wayland socket: Connection reset by peer
 err: wayland.c:2019: failed to roundtrip Wayland display: Connection reset by peer
 err: wayland.c:2019: failed to roundtrip Wayland display: Connection reset by peer
 err: wayland.c:2019: failed to roundtrip Wayland display: Connection reset by peer
zsh: abort      ./build/sway/sway --config ./test.conf -d
 err: wayland.c:1984: failed to flush wayland socket: Connection reset by peer                                                                     

Output of WAYLAND_DEBUG=1 shotman --capture output: https://paste.sr.ht/blob/22620559ee800e1996579f5d7206a4c5c7bad980

Note that I tested a merge of this into master: Merge: dcdb7275 972fcc60.

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

Successfully merging this pull request may close these issues.

Layer Shell regression: Layershell never releasing mouse again, once it is set to exclusive
3 participants