[Development] Print Screen does not work with Qt context menus

Thiago Macieira thiago.macieira at intel.com
Thu Oct 20 19:24:01 CEST 2022


On Thursday, 20 October 2022 09:59:18 PDT Laszlo Papp wrote:
> I am using CentoOS 7.9, but the Chrome menu remains when I press Tab or the
> function key. It does not disappear. This is the behaviour I would also
> like to have in my Qt app. If it was an application configuration, that is
> also fine. I just would like to have a way to at least opt-in even if it is
> not the default behaviour. I am also interested in any workarounds at this
> point.

Can't confirm. The Chrome menu disappears when you Alt+Tab away from the 
application. This is the expected behaviour and the whole reason why on X11 we 
have to grab the keyboard and mouse.

Looks like we can update Qt to inject the dismissal event back to X, somehow. 
But given that stock Gtk3 doesn't do that either, I don't know that we should. 
I don't know why Chrome and Firefox do this. I also don't know what gotchas 
there may be, or what events should be injected and which ones shouldn't.

This was one of the things that Wayland *fixed*, instead of having every 
toolkit work around. Same thing with password dialogs that grab the keyboard 
so you don't get keyloggers or accidental (or worse, intentional) focus 
stealing getting your passwords pasted to IRC.

-- 
Thiago Macieira - thiago.macieira (AT) intel.com
  Cloud Software Architect - Intel DCAI Cloud Engineering





More information about the Development mailing list