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

WIP Input focus update #322

Closed
wants to merge 8 commits into from
Closed

WIP Input focus update #322

wants to merge 8 commits into from

Conversation

ids1024
Copy link
Member

@ids1024 ids1024 commented Feb 24, 2024

Not too much to see here code-wise at the moment (just an initial attempt at combining LockSurface and Popup focus targets into a WlSurface target). But I figure I may as well start a WIP PR now that I've been looking into what to change here.

Updating cosmic-comp for Smithay/smithay#1326 is fairly complicated. Particularly trying to do things more correctly, and not just copying the logic from the trait impls removed there. Adjusting how pointer focuses are defined without updating to that commit seems like a good place to start iterating on things without have to address everything at once.

The Wayland protocol spec doesn't define how exactly input to subsurfaces works, but on KDE, Gnome Shell, And Sway:

  • Subsurfaces the mouse moves over get pointer focus
  • Subsurfaces never get keyboard focus

On cosmic-comp, it seems with a couple subsurfaces, some but not all subsurfaces can get pointer focus? So something isn't quite right.

Given how we were implementing PointerTarget for Popup and LockSurface to just call the PointerTarget methods on the WlSurface, we're presumably also not sending pointer input to subsurfaces of the LockSurface or Popup. So we want to have a PointerFocusTarget::WlSurface with the subsurface.

Meanwhile, for KeyboardFocusTarget, we don't want to have a subsurface as the focus. And it seems some code here does care that the keyboard focus is a popup... I wonder if condensing into a KeyboardFocusTarget::WlSurface makes as much sense as the simplification of combining surface types into a PointerFocusTarget::WlSurface.

Needs testing to make sure pointer/keyboard to fullscreen surfaces is
working properly.
@Drakulix
Copy link
Member

Drakulix commented Mar 25, 2024

Closing in favour of #380. Thanks for starting this!

@Drakulix Drakulix closed this Mar 25, 2024
@jackpot51 jackpot51 deleted the input-focus branch April 26, 2024 19:17
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