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

Laszlo Papp lpapp at kde.org
Thu Oct 20 21:58:16 CEST 2022


On Thu, Oct 20, 2022 at 6:24 PM Thiago Macieira <thiago.macieira at intel.com>
wrote:

> 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.
>

I am not able to check alt+tab as I use Linux in a remote guest and it
works in the host. I replied to this:

> The menus  in both Firefox and in Chrome, but not in Emacs or
pavucontrol, visibly disappear when you press the Tab or the function key.

The menus do not disappear for me when you press tab or a function key.
Print Screen also captures the menu. I am not asking for alt+tab to work,
but more like Print Screen. Actually, not even me, but the user of the
application.

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.


The reason why wayland does it, I think... Or simply because you want to
capture a menu to put into the documentation of the application? Sounds
like a fair use case to me.


> I also don't know what gotchas there may be, or what events should be
> injected and which ones shouldn't.
>

Open source can hopefully help with this.


> This was one of the things that Wayland *fixed*, instead of having every
> toolkit work around.
>

That is helpful for Wayland. It does not help X11 users though.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.qt-project.org/pipermail/development/attachments/20221020/4722cc80/attachment.htm>


More information about the Development mailing list