Skip to content

rootston: focus newly-created surfaces

Ilia Bozhinov requested to merge github/fork/ammen99/master into master

Whenever a new surface is created, we have to update the cursor focus, even if there's no input event. So, we generate one motion event, and reuse the code to update the proper cursor focus. We need to do this for all surface roles - toplevels, popups, subsurfaces.

Fixes #1162 (closed)

How to test: There are many ways to test, for example open an app and don't move the cursor. The cursor surface should change (and the view should get cursor focus). Or open weston-terminal, right click, hold the button and don't move the mouse - the first menu item should be highlighted.

Further work:

  1. I'm not sure, but maybe we should do the same when a surface is unmapped?
  2. Port this to sway - it doesn't handle cursor focus properly either

Merge request reports