Members of the KDE Community are recommended to subscribe to the kde-community mailing list at to allow them to participate in important discussions and receive other important announcements

Don't always stay on top on Windows

For now only the signencryptemail dialog should stay
on top for Windows. Otherwise just raise our dialogs
but don't stay on top.

GnuPG-Bug-Id: 3460
parent 9bef188f
......@@ -649,7 +649,7 @@ void NewSignEncryptEMailController::Private::cancelAllTasks()
void NewSignEncryptEMailController::Private::ensureDialogVisible()
q->bringToForeground(dialog, true);
#include "moc_newsignencryptemailcontroller.cpp"
......@@ -63,7 +63,7 @@ WINBOOL SetForegroundWindowEx(HWND hWnd)
}// End SetForegroundWindowEx
void Kleo::agressive_raise(QWidget *w)
void Kleo::agressive_raise(QWidget *w, bool stayOnTop)
/* Maybe Qt will become aggressive enough one day that
* this is enough on windows too*/
......@@ -88,18 +88,17 @@ void Kleo::agressive_raise(QWidget *w)
OutputDebugStringA("SetWindowPos failed.");
/* In Kleopatra we want to stay on top even if the user
/* sometimes we want to stay on top even if the user
* changes focus because we are _agressive_ and otherwise
* Outlook might show the "Help I'm unresponsive so I must have
* crashed" Popup if the user clicks into Outlook while a dialog
* from us is active.
else {
* from us is active. */
else if (!stayOnTop) {
// Without moving back to NOTOPMOST we just stay on top.
// Even if the user changes focus.
SetWindowPos(wid, HWND_NOTOPMOST, 0, 0, 0, 0,
......@@ -57,7 +57,7 @@ static inline bool xconnect(const QObject *a, const char *signal,
/** Agressively raise a window to foreground. May be platform
* specific. */
void agressive_raise(QWidget *w);
void agressive_raise(QWidget *w, bool stayOnTop);
......@@ -101,10 +101,10 @@ std::shared_ptr<const ExecutionContext> ExecutionContextUser::executionContext()
return d->executionContext.lock();
void ExecutionContextUser::bringToForeground(QWidget *wid)
void ExecutionContextUser::bringToForeground(QWidget *wid, bool stayOnTop)
agressive_raise(wid, stayOnTop);
......@@ -79,7 +79,7 @@ public:
std::shared_ptr<const ExecutionContext> executionContext() const;
void bringToForeground(QWidget *wid);
void bringToForeground(QWidget *wid, bool stayOnTop = false);
void applyWindowID(QWidget *wid);
class Private;
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