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

Laszlo Papp lpapp at kde.org
Wed Oct 19 09:30:30 CEST 2022


Hi,

I have just written a simple test case that demonstrates the issue:

https://github.com/lpapp/examples/tree/main/qt-context-menu

If you bring up the context menu by pressing the right mouse button, and
then you try to press the Print Screen button on your keyboard on Linux, it
gets ignored. But I can take a screenshot fine using the Print Screen
button of the keyboard when launching the application and it is without
context menu.

I think I am hitting the same issue as these:

https://github.com/lpapp/examples/tree/main/qt-context-menu
https://github.com/flameshot-org/flameshot/issues/457

I have also tried various Qt applications, like Inkscape, where this also
does not work as soon as you bring up a context menu.

This works fine in non-Qt applications though, e.g. Firefox or Chrome.

I am using Qt 5.15.6.

Is there perhaps a way to handle the shortcut events in the Qt Application
that I pass it back to the windowing system to handle it?

Thank you in advance.

Kind regards,
László
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.qt-project.org/pipermail/development/attachments/20221019/14e2d74d/attachment.htm>


More information about the Development mailing list