Add CriticalNotification window type to PlasmaShellSurface protocol

Differential Revision: https://phabricator.kde.org/D20628
master
Kai Uwe Broulik 5 years ago
parent 840268aa7e
commit 5a9df05460

@ -161,6 +161,7 @@ void TestPlasmaShell::testRole_data()
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()

@ -50,7 +50,7 @@ private:
static const quint32 s_version;
};
const quint32 PlasmaShellInterface::Private::s_version = 5;
const quint32 PlasmaShellInterface::Private::s_version = 6;
PlasmaShellInterface::Private::Private(PlasmaShellInterface *q, Display *d)
: Global::Private(d, &org_kde_plasma_shell_interface, s_version)
@ -252,6 +252,9 @@ void PlasmaShellSurfaceInterface::Private::setRole(uint32_t role)
case ORG_KDE_PLASMA_SURFACE_ROLE_TOOLTIP:
r = Role::ToolTip;
break;
case ORG_KDE_PLASMA_SURFACE_ROLE_CRITICALNOTIFICATION:
r = Role::CriticalNotification;
break;
case ORG_KDE_PLASMA_SURFACE_ROLE_NORMAL:
default:
r = Role::Normal;

@ -110,7 +110,8 @@ public:
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
};
/**
* @returns The requested role, default value is @c Role::Normal.

@ -172,6 +172,8 @@ int main(int argc, char **argv)
parser.addHelpOption();
QCommandLineOption notificationOption(QStringLiteral("notification"));
parser.addOption(notificationOption);
QCommandLineOption criticalNotificationOption(QStringLiteral("criticalNotification"));
parser.addOption(criticalNotificationOption);
QCommandLineOption panelOption(QStringLiteral("panel"));
parser.addOption(panelOption);
QCommandLineOption desktopOption(QStringLiteral("desktop"));
@ -191,6 +193,8 @@ int main(int argc, char **argv)
if (parser.isSet(notificationOption)) {
client.setRole(PlasmaShellSurface::Role::Notification);
} else if (parser.isSet(criticalNotificationOption)) {
client.setRole(PlasmaShellSurface::Role::CriticalNotification);
} else if (parser.isSet(panelOption)) {
client.setRole(PlasmaShellSurface::Role::Panel);
} else if (parser.isSet(desktopOption)) {

Loading…
Cancel
Save