Verified Commit fba38b9d authored by Andre Heinecke's avatar Andre Heinecke
Browse files

W32: Change window behavior to always activate

This code enables a creative solution in Qt for Windows to allow
the application to always raise a window. This is important
because kleopatra is kept running and might not have foreground
window permissions when a user triggers an action through
the uiserver or kuniqueservice_win. So many windows were opened
in the background.

GnuPG-Bug-Id: T5533
parent 86ef08ff
Pipeline #73322 passed with stage
in 14 minutes and 52 seconds
......@@ -59,6 +59,11 @@
#include <memory>
#include <KSharedConfig>
#ifdef Q_OS_WIN
#include <QtPlatformHeaders/QWindowsWindowFunctions>
#endif
using namespace Kleo;
using namespace Kleo::Commands;
......@@ -191,6 +196,10 @@ KleopatraApplication::KleopatraApplication(int &argc, char *argv[])
void KleopatraApplication::init()
{
#ifdef Q_OS_WIN
QWindowsWindowFunctions::setWindowActivationBehavior(
QWindowsWindowFunctions::AlwaysActivateWindow);
#endif
d->init();
add_resources();
d->setupKeyCache();
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment