Pressing any global keyboard shortcut causes temporary loss of focus

What can I do to workaround this bug: in GTK3 application?
Especially, for editable GtkTreeView cells.

Have you tried opening an issue in mutter? This is not something that can be fixed by the toolkit.

Is is issued against mutter in bugzilla and one of the last comments says it can’t be fixed for Xorg sessions. That’s why I’m seeking for application-side workaround.
Clarification: bug is reproduced only under Xorg, not Wayland.

It cannot be fixed by the toolkit either: X11 grabs don’t work that way, and they won’t ever be changed because doing so would break something else. The window manager (which is the component responsible for intercepting global keyboard shortcuts) is holding a passive key grab; this means that the focus will be transferred at some point. A client toolkit is unable to prevent that from happening.

I know, but it’s an old bug, and Mutter maintainers will likely miss it now that we moved to GitLab.

“Not losing cell’s editability on temporary focus loss” would be good candidate for workaround.

We can’t know if the user focused out, and thus cancelled the editing; or the focus was lost programmatically because another component moved focus away from the window: from a toolkit perspective they are precisely the same.

Ideally, the window manager would be able to intercept key events without a grab—which is precisely how Wayland works. The equivalent would be to have the X server handle global key shortcuts, though, which is simply not going to happen.

1 Like

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.