canonical / mir

The Mir compositor
GNU General Public License v2.0
637 stars 102 forks source link

More focus madness #2256

Open AlanGriffiths opened 2 years ago

AlanGriffiths commented 2 years ago

This is with a native Wayland application (and happens with both 2.5 and 2.6)

  1. Run gedit
  2. Pull up the "shortcuts" dialog (F10 -> "Keyboard Shortcuts")
  3. Click on the main window

Expect: focus remains on the dialog Actual: the dialog loses focus decoration, but typing goes into the dialog's search field

wmww commented 2 years ago

Sway has the same behavior as Mir, but Weston keeps the dialog window visibly focused. I can't easily test with GNOME right now.

The protocol specifies:

This [child] surface should be stacked above the parent surface and all other ancestor surfaces.

But it does not specify if the parent should be allowed to have keyboard focus. Sway and Mir allow it, Weston does not.

Finally, Mir is not sending the keyboard events to the wrong window. Using wayland-debug, I determined that the parent both looks like it is active, and gets the keyboard events. I assume that somehow GTK is receiving them for the main window and re-targeting them to the dialog window internally. Considering that a lot of GTK's logic was built for X11 which requires some weird input targeting logic, this isn't terribly surprising.

I am not convinced Mir needs to change it's behavior.