Commit 1c76e347 authored by David Jarvie's avatar David Jarvie
Browse files

Don't move main window when highlighting an alarm from a message window

parent 40df81fe
Pipeline #20775 passed with stage
in 6 minutes and 4 seconds
......@@ -69,6 +69,7 @@ using namespace KCalendarCore;
#include <KIO/StatJob>
#include <KIO/StoredTransferJob>
#include <KFileCustomDialog>
#include <KWindowInfo>
#include <QAction>
#include <QDBusConnectionInterface>
......@@ -160,8 +161,15 @@ MainWindow* displayMainWindowSelected(const QString& eventId)
// There is already a main window, so make it the active window
#pragma message("Don't hide unless necessary, since it moves the window")
win->hide(); // in case it's on a different desktop
KWindowInfo wi(win->winId(), NET::WMDesktop);
if (!wi.valid() || !wi.isOnDesktop(KWindowSystem::currentDesktop()))
// The main window isn't on the current desktop. Hide it first so
// that it will be shown on the current desktop when it is shown
// again. Note that this shifts the window's position, so don't
// hide it if it's already on the current desktop.
win->setWindowState(win->windowState() & ~Qt::WindowMinimized);
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