Closed ArsenArsen closed 7 years ago
Well thats a surprise. This is definitly something that should work...Wich OS are you on (please detailed, e.g. Windows 10 Creators Update)? Am I assuming correctly that your non-workaround implementation looked like this:
MainWindow w;
if (!parser.isSet(h))
w.show();
return a.exec();
Correct. I am using Arch Linux, with Xorg and KDE Plasma 5.
A fellow Arch/KDE user! I could verify the issue. There is probably something that needs to be activated by Qt, and this only happens on the first window show. I looked around, but couldn't find anything... The registration seems to work, but the key is not grabbed. (I tested with
For now, this workaround seems to work:
//In main
auto tmp = new QWidget();
tmp->show();
tmp->close();
tmp->deleteLater();
But I will try to find a proper solution. If not, I will integrate this code into the X11 implementation.
Solution found! A missing call to XSync
Please check if it works for you, and close the issue
Thanks! I won't be home 'till 9PM UK so won't be able to test.
👌
Hello! Using a hotkey before showing a
MainWindow
makes the QHotkey signals not trigger. Current workaround I've found isWhich flashes the window for one event loop iteration (too short to be visible).
I assume this is a singleton not being set up issue.
The hotkeys are registered at the end of the
MainWindow
constructor.Thanks for creating QHotkey! :)