From 91024027b09b4e8e5eded43540dfaed7bda367ea Mon Sep 17 00:00:00 2001 From: Kai Uwe Broulik Date: Thu, 2 May 2019 10:15:57 +0200 Subject: [PATCH] [Dialog] Add CriticalNotification type Allows to flag a dialog window as critical notification that should be shown even on top of fullscreen windows Differential Revision: https://phabricator.kde.org/D20630 --- src/plasmaquick/dialog.cpp | 6 +++--- src/plasmaquick/dialog.h | 3 ++- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/src/plasmaquick/dialog.cpp b/src/plasmaquick/dialog.cpp index c4be0a2d1..c9f9cd87d 100644 --- a/src/plasmaquick/dialog.cpp +++ b/src/plasmaquick/dialog.cpp @@ -308,7 +308,7 @@ void DialogPrivate::updateVisibility(bool visible) } } - if (!q->flags().testFlag(Qt::ToolTip) && type != Dialog::Notification) { + if (!q->flags().testFlag(Qt::ToolTip) && type != Dialog::Notification && type != Dialog::CriticalNotification) { KWindowEffects::SlideFromLocation slideLocation = KWindowEffects::NoEdge; switch (location) { @@ -341,7 +341,7 @@ void DialogPrivate::updateVisibility(bool visible) q->setFlags(Qt::FramelessWindowHint | q->flags()); } - if (type == Dialog::Dock || type == Dialog::Notification || type == Dialog::OnScreenDisplay) { + if (type == Dialog::Dock || type == Dialog::Notification || type == Dialog::OnScreenDisplay || type == Dialog::CriticalNotification) { KWindowSystem::setOnAllDesktops(q->winId(), true); } else { KWindowSystem::setOnAllDesktops(q->winId(), false); @@ -1091,7 +1091,7 @@ void Dialog::setType(WindowType type) } } - if (type == Dock || type == Notification || type == OnScreenDisplay) { + if (type == Dock || type == Notification || type == OnScreenDisplay || type == CriticalNotification) { KWindowSystem::setOnAllDesktops(winId(), true); } else { KWindowSystem::setOnAllDesktops(winId(), false); diff --git a/src/plasmaquick/dialog.h b/src/plasmaquick/dialog.h index 27eb84a98..727976bb4 100644 --- a/src/plasmaquick/dialog.h +++ b/src/plasmaquick/dialog.h @@ -157,7 +157,8 @@ public: PopupMenu = NET::PopupMenu, Tooltip = NET::Tooltip, Notification = NET::Notification, - OnScreenDisplay = NET::OnScreenDisplay + OnScreenDisplay = NET::OnScreenDisplay, + CriticalNotification = NET::CriticalNotification }; Q_ENUM(WindowType)