Changeset View
Changeset View
Standalone View
Standalone View
shell_client.cpp
Show First 20 Lines • Show All 443 Lines • ▼ Show 20 Line(s) | |||||
444 | 444 | | |||
445 | void ShellClient::debug(QDebug &stream) const | 445 | void ShellClient::debug(QDebug &stream) const | ||
446 | { | 446 | { | ||
447 | stream.nospace(); | 447 | stream.nospace(); | ||
448 | stream << "\'ShellClient:" << surface() << ";WMCLASS:" << resourceClass() << ":" | 448 | stream << "\'ShellClient:" << surface() << ";WMCLASS:" << resourceClass() << ":" | ||
449 | << resourceName() << ";Caption:" << caption() << "\'"; | 449 | << resourceName() << ";Caption:" << caption() << "\'"; | ||
450 | } | 450 | } | ||
451 | 451 | | |||
452 | bool ShellClient::belongsToDesktop() const | ||||
453 | { | ||||
454 | const auto clients = waylandServer()->clients(); | ||||
455 | | ||||
456 | return std::any_of(clients.constBegin(), clients.constEnd(), | ||||
457 | [this](const ShellClient *client) { | ||||
458 | if (belongsToSameApplication(client, SameApplicationChecks())) { | ||||
459 | return client->isDesktop(); | ||||
460 | } | ||||
461 | return false; | ||||
462 | } | ||||
463 | ); | ||||
464 | } | ||||
465 | | ||||
452 | Layer ShellClient::layerForDock() const | 466 | Layer ShellClient::layerForDock() const | ||
453 | { | 467 | { | ||
454 | if (m_plasmaShellSurface) { | 468 | if (m_plasmaShellSurface) { | ||
455 | switch (m_plasmaShellSurface->panelBehavior()) { | 469 | switch (m_plasmaShellSurface->panelBehavior()) { | ||
456 | case PlasmaShellSurfaceInterface::PanelBehavior::WindowsCanCover: | 470 | case PlasmaShellSurfaceInterface::PanelBehavior::WindowsCanCover: | ||
457 | return NormalLayer; | 471 | return NormalLayer; | ||
458 | case PlasmaShellSurfaceInterface::PanelBehavior::AutoHide: | 472 | case PlasmaShellSurfaceInterface::PanelBehavior::AutoHide: | ||
459 | return AboveLayer; | 473 | return AboveLayer; | ||
▲ Show 20 Lines • Show All 517 Lines • ▼ Show 20 Line(s) | 990 | { | |||
977 | if (rules()->checkAcceptFocus(wantsInput())) { | 991 | if (rules()->checkAcceptFocus(wantsInput())) { | ||
978 | if (m_xdgShellSurface) { | 992 | if (m_xdgShellSurface) { | ||
979 | const qint32 pingSerial = static_cast<XdgShellInterface *>(m_xdgShellSurface->global())->ping(m_xdgShellSurface); | 993 | const qint32 pingSerial = static_cast<XdgShellInterface *>(m_xdgShellSurface->global())->ping(m_xdgShellSurface); | ||
980 | m_pingSerials.insert(pingSerial, PingReason::FocusWindow); | 994 | m_pingSerials.insert(pingSerial, PingReason::FocusWindow); | ||
981 | } | 995 | } | ||
982 | setActive(true); | 996 | setActive(true); | ||
983 | } | 997 | } | ||
984 | 998 | | |||
985 | bool breakShowingDesktop = !keepAbove() && !isOnScreenDisplay(); | 999 | if (!keepAbove() && !isOnScreenDisplay() && !belongsToDesktop()) { | ||
986 | if (breakShowingDesktop) { | | |||
987 | // check that it doesn't belong to the desktop | | |||
988 | const auto &clients = waylandServer()->clients(); | | |||
989 | for (auto c: clients) { | | |||
990 | if (!belongsToSameApplication(c, SameApplicationChecks())) { | | |||
991 | continue; | | |||
992 | } | | |||
993 | if (c->isDesktop()) { | | |||
994 | breakShowingDesktop = false; | | |||
995 | break; | | |||
996 | } | | |||
997 | } | | |||
998 | } | | |||
999 | if (breakShowingDesktop) | | |||
1000 | workspace()->setShowingDesktop(false); | 1000 | workspace()->setShowingDesktop(false); | ||
1001 | } | 1001 | } | ||
1002 | } | ||||
1002 | 1003 | | |||
1003 | void ShellClient::doSetActive() | 1004 | void ShellClient::doSetActive() | ||
1004 | { | 1005 | { | ||
1005 | if (!isActive()) { | 1006 | if (!isActive()) { | ||
1006 | return; | 1007 | return; | ||
1007 | } | 1008 | } | ||
1008 | StackingUpdatesBlocker blocker(workspace()); | 1009 | StackingUpdatesBlocker blocker(workspace()); | ||
1009 | workspace()->focusToNull(); | 1010 | workspace()->focusToNull(); | ||
▲ Show 20 Lines • Show All 866 Lines • Show Last 20 Lines |