Honour panelTakesFocus for other plasmashell types

The semantics of a window taking focus on user interaction apply to more roles. See D25851.

Given it is used by KWindowSystem::forceActivateWindow in kwayland-integration,
it makes sense to pass focus to the window once it gets this property set.

Differential Revision: https://phabricator.kde.org/D25968
This commit is contained in:
Kai Uwe Broulik 2019-12-23 13:04:59 +01:00
parent c29c165032
commit a823474ec3

View file

@ -1011,11 +1011,14 @@ bool XdgShellClient::acceptsFocus() const
}
if (m_plasmaShellSurface) {
if (m_plasmaShellSurface->role() == PlasmaShellSurfaceInterface::Role::OnScreenDisplay ||
m_plasmaShellSurface->role() == PlasmaShellSurfaceInterface::Role::ToolTip ||
m_plasmaShellSurface->role() == PlasmaShellSurfaceInterface::Role::Notification ||
m_plasmaShellSurface->role() == PlasmaShellSurfaceInterface::Role::CriticalNotification) {
m_plasmaShellSurface->role() == PlasmaShellSurfaceInterface::Role::ToolTip) {
return false;
}
if (m_plasmaShellSurface->role() == PlasmaShellSurfaceInterface::Role::Notification ||
m_plasmaShellSurface->role() == PlasmaShellSurfaceInterface::Role::CriticalNotification) {
return m_plasmaShellSurface->panelTakesFocus();
}
}
if (m_closing) {
// a closing window does not accept focus