Add support for new Notification role on PlasmaSurface

Summary:
Sets notifications on all desktop and doesn't activate them.

Unfortunately doesn't work on Plasma yet. Seems the windows don't get
tagged properly.

Reviewers: #kwin, #plasma_on_wayland

Subscribers: plasma-devel, kwin

Tags: #plasma_on_wayland, #kwin

Differential Revision: https://phabricator.kde.org/D1930
This commit is contained in:
Martin Gräßlin 2016-06-17 09:46:16 +02:00
parent a97d438b6c
commit c81d8204f9
3 changed files with 10 additions and 3 deletions

View file

@ -4,7 +4,7 @@ set(PROJECT_VERSION_MAJOR 5)
cmake_minimum_required(VERSION 2.8.12 FATAL_ERROR)
set(QT_MIN_VERSION "5.5.0")
set(KF5_MIN_VERSION "5.23.0")
set(KF5_MIN_VERSION "5.24.0")
set(CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/cmake/modules ${CMAKE_MODULE_PATH} )

View file

@ -147,6 +147,7 @@ void PlasmaSurfaceTest::testRoleOnAllDesktops_data()
QTest::newRow("Panel") << PlasmaShellSurface::Role::Panel << true;
QTest::newRow("OSD") << PlasmaShellSurface::Role::OnScreenDisplay << true;
QTest::newRow("Normal") << PlasmaShellSurface::Role::Normal << false;
QTest::newRow("Notification") << PlasmaShellSurface::Role::Notification << true;
}
void PlasmaSurfaceTest::testRoleOnAllDesktops()
@ -204,6 +205,7 @@ void PlasmaSurfaceTest::testRoleOnAllDesktops()
QEXPECT_FAIL("Desktop", "PS before WS not supported", Continue);
QEXPECT_FAIL("Panel", "PS before WS not supported", Continue);
QEXPECT_FAIL("OSD", "PS before WS not supported", Continue);
QEXPECT_FAIL("Notification", "PS before WS not supported", Continue);
QCOMPARE(c->isOnAllDesktops(), expectedOnAllDesktops);
}
@ -217,6 +219,7 @@ void PlasmaSurfaceTest::testAcceptsFocus_data()
QTest::newRow("Panel") << PlasmaShellSurface::Role::Panel << true << false;
QTest::newRow("OSD") << PlasmaShellSurface::Role::OnScreenDisplay << false << false;
QTest::newRow("Normal") << PlasmaShellSurface::Role::Normal << true << true;
QTest::newRow("Notification") << PlasmaShellSurface::Role::Notification << false << false;
}
void PlasmaSurfaceTest::testAcceptsFocus()

View file

@ -734,7 +734,8 @@ bool ShellClient::acceptsFocus() const
return false;
}
if (m_plasmaShellSurface) {
if (m_plasmaShellSurface->role() == PlasmaShellSurfaceInterface::Role::OnScreenDisplay) {
if (m_plasmaShellSurface->role() == PlasmaShellSurfaceInterface::Role::OnScreenDisplay ||
m_plasmaShellSurface->role() == PlasmaShellSurfaceInterface::Role::Notification) {
return false;
}
}
@ -893,6 +894,9 @@ void ShellClient::installPlasmaShellSurface(PlasmaShellSurfaceInterface *surface
case PlasmaShellSurfaceInterface::Role::OnScreenDisplay:
type = NET::OnScreenDisplay;
break;
case PlasmaShellSurfaceInterface::Role::Notification:
type = NET::Notification;
break;
case PlasmaShellSurfaceInterface::Role::Normal:
default:
type = NET::Normal;
@ -900,7 +904,7 @@ void ShellClient::installPlasmaShellSurface(PlasmaShellSurfaceInterface *surface
}
if (type != m_windowType) {
m_windowType = type;
if (m_windowType == NET::Desktop || type == NET::Dock || type == NET::OnScreenDisplay) {
if (m_windowType == NET::Desktop || type == NET::Dock || type == NET::OnScreenDisplay || type == NET::Notification) {
setOnAllDesktops(true);
}
workspace()->updateClientArea();