Bring app window back to front once msg URL is opened externally.
This commit is contained in:
parent
de6aab846e
commit
902570a0e0
@ -459,12 +459,12 @@ void FormMain::switchVisibility(bool force_hide) {
|
||||
|
||||
void FormMain::display() {
|
||||
// Make sure window is not minimized.
|
||||
setWindowState(windowState() & ~Qt::WindowMinimized);
|
||||
setWindowState(windowState() & ~Qt::WindowMinimized& ~Qt::WindowActive);
|
||||
|
||||
// Display the window and make sure it is raised on top.
|
||||
show();
|
||||
activateWindow();
|
||||
raise();
|
||||
activateWindow();
|
||||
|
||||
// Raise alert event. Check the documentation for more info on this.
|
||||
Application::alert(this);
|
||||
|
@ -392,6 +392,10 @@ void MessagesView::openSelectedSourceMessagesExternally() {
|
||||
if (!selectionModel()->selectedRows().isEmpty()) {
|
||||
QTimer::singleShot(0, this, SLOT(markSelectedMessagesRead()));
|
||||
}
|
||||
|
||||
QTimer::singleShot(1000, this, []() {
|
||||
qApp->mainForm()->display();
|
||||
});
|
||||
}
|
||||
|
||||
void MessagesView::openSelectedMessagesInternally() {
|
||||
|
@ -8,6 +8,10 @@
|
||||
#include "miscellaneous/application.h"
|
||||
#include "services/abstract/label.h"
|
||||
|
||||
#ifdef Q_OS_WIN
|
||||
#include <QtPlatformHeaders/QWindowsWindowFunctions>
|
||||
#endif
|
||||
|
||||
#if defined (Q_OS_MACOS)
|
||||
extern void disableWindowTabbing();
|
||||
|
||||
@ -69,6 +73,10 @@ int main(int argc, char* argv[]) {
|
||||
|
||||
qApp->reactOnForeignNotifications();
|
||||
|
||||
#ifdef Q_OS_WIN
|
||||
QWindowsWindowFunctions::setWindowActivationBehavior(QWindowsWindowFunctions::AlwaysActivateWindow);
|
||||
#endif
|
||||
|
||||
FormMain main_window;
|
||||
|
||||
qApp->loadDynamicShortcuts();
|
||||
|
Loading…
x
Reference in New Issue
Block a user