diff --git a/autotests/client/test_plasmashell.cpp b/autotests/client/test_plasmashell.cpp --- a/autotests/client/test_plasmashell.cpp +++ b/autotests/client/test_plasmashell.cpp @@ -161,6 +161,7 @@ QTest::newRow("panel") << PlasmaShellSurface::Role::Panel << PlasmaShellSurfaceInterface::Role::Panel; QTest::newRow("notification") << PlasmaShellSurface::Role::Notification << PlasmaShellSurfaceInterface::Role::Notification; QTest::newRow("tooltip") << PlasmaShellSurface::Role::ToolTip << PlasmaShellSurfaceInterface::Role::ToolTip; + QTest::newRow("criticalnotification") << PlasmaShellSurface::Role::CriticalNotification << PlasmaShellSurfaceInterface::Role::CriticalNotification; } void TestPlasmaShell::testRole() diff --git a/src/client/plasmashell.h b/src/client/plasmashell.h --- a/src/client/plasmashell.h +++ b/src/client/plasmashell.h @@ -246,7 +246,8 @@ Panel, ///< The Surface represents a panel (dock), normally stacked above normal surfaces OnScreenDisplay, ///< The Surface represents an on screen display, like a volume changed notification Notification, ///< The Surface represents a notification @since 5.24 - ToolTip ///< The Surface represents a tooltip @since 5.24 + ToolTip, ///< The Surface represents a tooltip @since 5.24 + CriticalNotification, ///< The Surface represents a critical notification, like battery is running out @since 5.58 }; /** * Changes the requested Role to @p role. diff --git a/src/client/plasmashell.cpp b/src/client/plasmashell.cpp --- a/src/client/plasmashell.cpp +++ b/src/client/plasmashell.cpp @@ -280,6 +280,10 @@ case Role::ToolTip: wlRole = ORG_KDE_PLASMA_SURFACE_ROLE_TOOLTIP; break; + case Role::CriticalNotification: + // FIXME check protocol version and send NOTIFICATION if not supported? + wlRole = ORG_KDE_PLASMA_SURFACE_ROLE_CRITICALNOTIFICATION; + break; default: Q_UNREACHABLE(); break; diff --git a/src/client/protocols/plasma-shell.xml b/src/client/protocols/plasma-shell.xml --- a/src/client/protocols/plasma-shell.xml +++ b/src/client/protocols/plasma-shell.xml @@ -17,7 +17,7 @@ along with this program. If not, see . ]]> - + This interface is used by KF5 powered Wayland shells to communicate with the compositor and can only be bound one time. @@ -190,6 +190,8 @@ + +