Changeset View
Changeset View
Standalone View
Standalone View
xdgshellclient.cpp
Show First 20 Lines • Show All 991 Lines • ▼ Show 20 Line(s) | |||||
1006 | 1006 | | |||
1007 | bool XdgShellClient::acceptsFocus() const | 1007 | bool XdgShellClient::acceptsFocus() const | ||
1008 | { | 1008 | { | ||
1009 | if (waylandServer()->inputMethodConnection() == surface()->client()) { | 1009 | if (waylandServer()->inputMethodConnection() == surface()->client()) { | ||
1010 | return false; | 1010 | return false; | ||
1011 | } | 1011 | } | ||
1012 | if (m_plasmaShellSurface) { | 1012 | if (m_plasmaShellSurface) { | ||
1013 | if (m_plasmaShellSurface->role() == PlasmaShellSurfaceInterface::Role::OnScreenDisplay || | 1013 | if (m_plasmaShellSurface->role() == PlasmaShellSurfaceInterface::Role::OnScreenDisplay || | ||
1014 | m_plasmaShellSurface->role() == PlasmaShellSurfaceInterface::Role::ToolTip || | 1014 | m_plasmaShellSurface->role() == PlasmaShellSurfaceInterface::Role::ToolTip) { | ||
1015 | m_plasmaShellSurface->role() == PlasmaShellSurfaceInterface::Role::Notification || | | |||
1016 | m_plasmaShellSurface->role() == PlasmaShellSurfaceInterface::Role::CriticalNotification) { | | |||
1017 | return false; | 1015 | return false; | ||
1018 | } | 1016 | } | ||
1017 | | ||||
1018 | if (m_plasmaShellSurface->role() == PlasmaShellSurfaceInterface::Role::Notification || | ||||
1019 | m_plasmaShellSurface->role() == PlasmaShellSurfaceInterface::Role::CriticalNotification) { | ||||
1020 | return m_plasmaShellSurface->panelTakesFocus(); | ||||
1021 | } | ||||
1019 | } | 1022 | } | ||
1020 | if (m_closing) { | 1023 | if (m_closing) { | ||
1021 | // a closing window does not accept focus | 1024 | // a closing window does not accept focus | ||
1022 | return false; | 1025 | return false; | ||
1023 | } | 1026 | } | ||
1024 | if (m_unmapped) { | 1027 | if (m_unmapped) { | ||
1025 | // an unmapped window does not accept focus | 1028 | // an unmapped window does not accept focus | ||
1026 | return false; | 1029 | return false; | ||
▲ Show 20 Lines • Show All 369 Lines • ▼ Show 20 Line(s) | 1373 | auto updateRole = [this, surface] { | |||
1396 | if (type != m_windowType) { | 1399 | if (type != m_windowType) { | ||
1397 | m_windowType = type; | 1400 | m_windowType = type; | ||
1398 | if (m_windowType == NET::Desktop || type == NET::Dock || type == NET::OnScreenDisplay || type == NET::Notification || type == NET::Tooltip || type == NET::CriticalNotification) { | 1401 | if (m_windowType == NET::Desktop || type == NET::Dock || type == NET::OnScreenDisplay || type == NET::Notification || type == NET::Tooltip || type == NET::CriticalNotification) { | ||
1399 | setOnAllDesktops(true); | 1402 | setOnAllDesktops(true); | ||
1400 | } | 1403 | } | ||
1401 | workspace()->updateClientArea(); | 1404 | workspace()->updateClientArea(); | ||
1402 | } | 1405 | } | ||
1403 | }; | 1406 | }; | ||
1407 | connect(surface, &PlasmaShellSurfaceInterface::panelTakesFocusChanged , this, [this, surface]() { | ||||
1408 | if (surface->panelTakesFocus()) { | ||||
1409 | workspace()->activateClient(this); | ||||
1410 | } | ||||
1411 | }); | ||||
1404 | connect(surface, &PlasmaShellSurfaceInterface::positionChanged, this, updatePosition); | 1412 | connect(surface, &PlasmaShellSurfaceInterface::positionChanged, this, updatePosition); | ||
1405 | connect(surface, &PlasmaShellSurfaceInterface::roleChanged, this, updateRole); | 1413 | connect(surface, &PlasmaShellSurfaceInterface::roleChanged, this, updateRole); | ||
1406 | connect(surface, &PlasmaShellSurfaceInterface::panelBehaviorChanged, this, | 1414 | connect(surface, &PlasmaShellSurfaceInterface::panelBehaviorChanged, this, | ||
1407 | [this] { | 1415 | [this] { | ||
1408 | updateShowOnScreenEdge(); | 1416 | updateShowOnScreenEdge(); | ||
1409 | workspace()->updateClientArea(); | 1417 | workspace()->updateClientArea(); | ||
1410 | } | 1418 | } | ||
1411 | ); | 1419 | ); | ||
▲ Show 20 Lines • Show All 574 Lines • Show Last 20 Lines |