diff --git a/abstract_client.h b/abstract_client.h --- a/abstract_client.h +++ b/abstract_client.h @@ -290,6 +290,12 @@ bool skipTaskbar() const { return m_skipTaskbar; } + + void setOriginalSkipSwitcher(bool set); + bool originalSkipSwitcher() const { + return m_originalSkipSwitcher; + } + void setSkipTaskbar(bool set); void setOriginalSkipTaskbar(bool set); bool originalSkipTaskbar() const { @@ -786,6 +792,7 @@ virtual void doSetSkipTaskbar(); virtual void doSetSkipPager(); + virtual void doSetSkipSwitcher(); void setupWindowManagementInterface(); void destroyWindowManagementInterface(); @@ -1034,12 +1041,13 @@ QSharedPointer m_tabBoxClient; bool m_firstInTabBox = false; bool m_skipTaskbar = false; + bool m_skipSwitcher = false; /** * Unaffected by KWin **/ bool m_originalSkipTaskbar = false; + bool m_originalSkipSwitcher = false; bool m_skipPager = false; - bool m_skipSwitcher = false; QIcon m_icon; bool m_active = false; bool m_keepAbove = false; diff --git a/abstract_client.cpp b/abstract_client.cpp --- a/abstract_client.cpp +++ b/abstract_client.cpp @@ -138,14 +138,23 @@ void AbstractClient::setSkipSwitcher(bool set) { + int was_wants_tab_focus = wantsTabFocus(); set = rules()->checkSkipSwitcher(set); if (set == skipSwitcher()) return; m_skipSwitcher = set; + doSetSkipSwitcher(); updateWindowRules(Rules::SkipSwitcher); + if (was_wants_tab_focus != wantsTabFocus()) { + FocusChain::self()->update(this, isActive() ? FocusChain::MakeFirst : FocusChain::Update); + } emit skipSwitcherChanged(); } +void AbstractClient::doSetSkipSwitcher() +{ +} + void AbstractClient::setSkipPager(bool b) { b = rules()->checkSkipPager(b); @@ -157,6 +166,12 @@ emit skipPagerChanged(); } +void AbstractClient::setOriginalSkipSwitcher(bool b) +{ + m_originalSkipSwitcher = rules()->checkSkipSwitcher(b); + setSkipSwitcher(m_originalSkipSwitcher); +} + void AbstractClient::doSetSkipPager() { } @@ -703,6 +718,7 @@ }; updateAppId(); w->setSkipTaskbar(skipTaskbar()); + w->setSkipSwitcher(skipSwitcher()); w->setPid(pid()); w->setShadeable(isShadeable()); w->setShaded(isShade()); @@ -716,6 +732,11 @@ w->setSkipTaskbar(skipTaskbar()); } ); + connect(this, &AbstractClient::skipSwitcherChanged, w, + [w, this] { + w->setSkipSwitcher(skipSwitcher()); + } + ); connect(this, &AbstractClient::captionChanged, w, [w, this] { w->setTitle(caption()); }); connect(this, &AbstractClient::desktopChanged, w, [w, this] { diff --git a/client.h b/client.h --- a/client.h +++ b/client.h @@ -388,6 +388,7 @@ void doMinimize() override; void doSetSkipPager() override; void doSetSkipTaskbar() override; + void doSetSkipSwitcher() override; bool belongsToDesktop() const override; void setGeometryRestore(const QRect &geo) override; void updateTabGroupStates(TabGroup::States states) override; diff --git a/client.cpp b/client.cpp --- a/client.cpp +++ b/client.cpp @@ -875,14 +875,17 @@ if (hidden && isCurrentTab()) { info->setState(NET::Hidden, NET::Hidden); setSkipTaskbar(true); // Also hide from taskbar + setSkipSwitcher(true); // and hide from switcher if (compositing() && options->hiddenPreviews() == HiddenPreviewsAlways) internalKeep(); else internalHide(); return; } - if (isCurrentTab()) + if (isCurrentTab()) { setSkipTaskbar(originalSkipTaskbar()); // Reset from 'hidden' + setSkipSwitcher(originalSkipSwitcher()); // Also reset switcher state + } if (isMinimized()) { info->setState(NET::Hidden, NET::Hidden); if (compositing() && options->hiddenPreviews() == HiddenPreviewsAlways) @@ -1196,6 +1199,11 @@ info->setState(skipPager() ? NET::SkipPager : NET::States(0), NET::SkipPager); } +void Client::doSetSkipSwitcher() +{ + info->setState(skipSwitcher() ? NET::SkipSwitcher : NET::States(0), NET::SkipSwitcher); +} + void Client::doSetDesktop(int desktop, int was_desk) { Q_UNUSED(desktop) diff --git a/kcmkwin/kwinrules/ruleswidget.cpp b/kcmkwin/kwinrules/ruleswidget.cpp --- a/kcmkwin/kwinrules/ruleswidget.cpp +++ b/kcmkwin/kwinrules/ruleswidget.cpp @@ -756,7 +756,7 @@ CHECKBOX_PREFILL(noborder, , info.frameGeometry() == info.geometry()); CHECKBOX_PREFILL(skiptaskbar, , info.state() & NET::SkipTaskbar); CHECKBOX_PREFILL(skippager, , info.state() & NET::SkipPager); - CHECKBOX_PREFILL(skipswitcher, , false); + CHECKBOX_PREFILL(skipswitcher, , info.state() & NET::SkipSwitcher); //CHECKBOX_PREFILL( acceptfocus, ); //CHECKBOX_PREFILL( closeable, ); //CHECKBOX_PREFILL( autogroup, ); diff --git a/manage.cpp b/manage.cpp --- a/manage.cpp +++ b/manage.cpp @@ -158,7 +158,9 @@ // TODO: Try to obey all state information from info->state() setOriginalSkipTaskbar((info->state() & NET::SkipTaskbar) != 0); + setOriginalSkipSwitcher((info->state() & NET::SkipSwitcher) != 0); setSkipPager((info->state() & NET::SkipPager) != 0); + setSkipSwitcher((info->state() & NET::SkipSwitcher) != 0); readFirstInTabBox(firstInTabBoxCookie); setupCompositing(); @@ -557,7 +559,7 @@ setKeepBelow(rules()->checkKeepBelow(info->state() & NET::KeepBelow, !isMapped)); setOriginalSkipTaskbar(rules()->checkSkipTaskbar(info->state() & NET::SkipTaskbar, !isMapped)); setSkipPager(rules()->checkSkipPager(info->state() & NET::SkipPager, !isMapped)); - setSkipSwitcher(rules()->checkSkipSwitcher(false, !isMapped)); + setSkipSwitcher(rules()->checkSkipSwitcher(info->state() & NET::SkipSwitcher, !isMapped)); if (info->state() & NET::DemandsAttention) demandAttention(); if (info->state() & NET::Modal) diff --git a/netinfo.cpp b/netinfo.cpp --- a/netinfo.cpp +++ b/netinfo.cpp @@ -95,7 +95,8 @@ NET::Hidden | NET::FullScreen | NET::KeepBelow | - NET::DemandsAttention; + NET::DemandsAttention | + NET::SkipSwitcher; NET::Properties2 properties2 = NET::WM2UserTime | NET::WM2StartupId | NET::WM2AllowedActions | @@ -284,6 +285,8 @@ m_client->setOriginalSkipTaskbar((state & NET::SkipTaskbar) != 0); if (mask & NET::SkipPager) m_client->setSkipPager((state & NET::SkipPager) != 0); + if (mask & NET::SkipSwitcher) + m_client->setSkipSwitcher((state & NET::SkipSwitcher) != 0); if (mask & NET::DemandsAttention) m_client->demandAttention((state & NET::DemandsAttention) != 0); if (mask & NET::Modal) diff --git a/shell_client.cpp b/shell_client.cpp --- a/shell_client.cpp +++ b/shell_client.cpp @@ -1299,6 +1299,11 @@ connect(surface, &PlasmaShellSurfaceInterface::skipTaskbarChanged, this, [this] { setSkipTaskbar(m_plasmaShellSurface->skipTaskbar()); }); + + setSkipSwitcher(surface->skipSwitcher()); + connect(surface, &PlasmaShellSurfaceInterface::skipSwitcherChanged, this, [this] { + setSkipSwitcher(m_plasmaShellSurface->skipSwitcher()); + }); } void ShellClient::updateShowOnScreenEdge()