tabbox: Drop support for _KDE_FIRST_IN_WINDOWLIST

LXR search shows that _KDE_FIRST_IN_WINDOWLIST is not used anywhere in
KDE codebase besides KWin.
This commit is contained in:
Vlad Zahorodnii 2023-03-25 10:19:33 +02:00
parent 09cc312f31
commit cf1d66ef59
12 changed files with 7 additions and 73 deletions

View file

@ -41,10 +41,6 @@ public:
{
return true;
}
bool isFirstInTabBox() const override
{
return false;
}
int width() const override
{
return 100;

View file

@ -48,7 +48,6 @@ Atoms::Atoms()
, net_wm_sync_request_counter(QByteArrayLiteral("_NET_WM_SYNC_REQUEST_COUNTER"))
, net_wm_sync_request(QByteArrayLiteral("_NET_WM_SYNC_REQUEST"))
, kde_net_wm_shadow(QByteArrayLiteral("_KDE_NET_WM_SHADOW"))
, kde_first_in_window_list(QByteArrayLiteral("_KDE_FIRST_IN_WINDOWLIST"))
, kde_color_sheme(QByteArrayLiteral("_KDE_NET_WM_COLOR_SCHEME"))
, kde_skip_close_animation(QByteArrayLiteral("_KDE_NET_WM_SKIP_CLOSE_ANIMATION"))
, kde_screen_edge_show(QByteArrayLiteral("_KDE_NET_WM_SCREEN_EDGE_SHOW"))

View file

@ -56,7 +56,6 @@ public:
Xcb::Atom net_wm_sync_request_counter;
Xcb::Atom net_wm_sync_request;
Xcb::Atom kde_net_wm_shadow;
Xcb::Atom kde_first_in_window_list;
Xcb::Atom kde_color_sheme;
Xcb::Atom kde_skip_close_animation;
Xcb::Atom kde_screen_edge_show;

View file

@ -674,8 +674,6 @@ void X11Window::propertyNotifyEvent(xcb_property_notify_event_t *e)
getSyncCounter();
} else if (e->atom == atoms->activities) {
checkActivities();
} else if (e->atom == atoms->kde_first_in_window_list) {
updateFirstInTabBox();
} else if (e->atom == atoms->kde_color_sheme) {
updateColorScheme();
} else if (e->atom == atoms->kde_screen_edge_show) {

View file

@ -70,8 +70,7 @@ QVariant ClientModel::data(const QModelIndex &index, int role) const
case MinimizedRole:
return client->isMinimized();
case CloseableRole:
// clients that claim to be first are not closeable
return client->isCloseable() && !client->isFirstInTabBox();
return client->isCloseable();
case IconRole:
return client->icon();
default:
@ -155,8 +154,7 @@ void ClientModel::createClientList(bool partialReset)
createClientList(tabBox->currentDesktop(), partialReset);
}
void ClientModel::createFocusChainClientList(int desktop,
const std::shared_ptr<TabBoxClient> &start, TabBoxClientList &stickyClients)
void ClientModel::createFocusChainClientList(int desktop, const std::shared_ptr<TabBoxClient> &start)
{
auto c = start;
if (!tabBox->isInFocusChain(c.get())) {
@ -170,16 +168,12 @@ void ClientModel::createFocusChainClientList(int desktop,
std::shared_ptr<TabBoxClient> add = tabBox->clientToAddToList(c.get(), desktop).lock();
if (add) {
m_mutableClientList += add;
if (add->isFirstInTabBox()) {
stickyClients << add;
}
}
c = tabBox->nextClientFocusChain(c.get()).lock();
} while (c && c != stop);
}
void ClientModel::createStackingOrderClientList(int desktop,
const std::shared_ptr<TabBoxClient> &start, TabBoxClientList &stickyClients)
void ClientModel::createStackingOrderClientList(int desktop, const std::shared_ptr<TabBoxClient> &start)
{
// TODO: needs improvement
const TabBoxClientList stacking = tabBox->stackingOrder();
@ -198,9 +192,6 @@ void ClientModel::createStackingOrderClientList(int desktop,
} else {
m_mutableClientList += add;
}
if (add->isFirstInTabBox()) {
stickyClients << add;
}
}
if (index >= stacking.size() - 1) {
c = nullptr;
@ -226,15 +217,14 @@ void ClientModel::createClientList(int desktop, bool partialReset)
}
m_mutableClientList.clear();
TabBoxClientList stickyClients;
switch (tabBox->config().clientSwitchingMode()) {
case TabBoxConfig::FocusChainSwitching: {
createFocusChainClientList(desktop, start, stickyClients);
createFocusChainClientList(desktop, start);
break;
}
case TabBoxConfig::StackingOrderSwitching: {
createStackingOrderClientList(desktop, start, stickyClients);
createStackingOrderClientList(desktop, start);
break;
}
}
@ -246,13 +236,6 @@ void ClientModel::createClientList(int desktop, bool partialReset)
});
}
for (const std::weak_ptr<TabBoxClient> &c : std::as_const(stickyClients)) {
m_mutableClientList.erase(std::remove_if(m_mutableClientList.begin(), m_mutableClientList.end(), [c = c.lock()](auto &client) {
return client.lock() == c;
}),
m_mutableClientList.end());
m_mutableClientList.prepend(c);
}
if (tabBox->config().clientApplicationsMode() != TabBoxConfig::AllWindowsCurrentApplication
&& (tabBox->config().showDesktopMode() == TabBoxConfig::ShowDesktopClient || m_mutableClientList.isEmpty())) {
std::weak_ptr<TabBoxClient> desktopClient = tabBox->desktopClient();

View file

@ -93,10 +93,8 @@ public Q_SLOTS:
void activate(int index);
private:
void createFocusChainClientList(int desktop, const std::shared_ptr<TabBoxClient> &start,
TabBoxClientList &stickyClients);
void createStackingOrderClientList(int desktop, const std::shared_ptr<TabBoxClient> &start,
TabBoxClientList &stickyClients);
void createFocusChainClientList(int desktop, const std::shared_ptr<TabBoxClient> &start);
void createStackingOrderClientList(int desktop, const std::shared_ptr<TabBoxClient> &start);
TabBoxClientList m_clientList;
TabBoxClientList m_mutableClientList;

View file

@ -390,11 +390,6 @@ void TabBoxClientImpl::close()
m_client->closeWindow();
}
bool TabBoxClientImpl::isFirstInTabBox() const
{
return m_client->isFirstInTabBox();
}
QUuid TabBoxClientImpl::internalId() const
{
return m_client->internalId();

View file

@ -84,7 +84,6 @@ public:
int height() const override;
bool isCloseable() const override;
void close() override;
bool isFirstInTabBox() const override;
QUuid internalId() const override;
Window *client() const

View file

@ -334,7 +334,6 @@ public:
virtual int height() const = 0;
virtual bool isCloseable() const = 0;
virtual void close() = 0;
virtual bool isFirstInTabBox() const = 0;
virtual QUuid internalId() const = 0;
};

View file

@ -825,10 +825,6 @@ public:
{
return m_tabBoxClient;
}
bool isFirstInTabBox() const
{
return m_firstInTabBox;
}
bool skipSwitcher() const
{
return m_skipSwitcher;
@ -1563,10 +1559,6 @@ protected:
protected:
Window();
void setFirstInTabBox(bool enable)
{
m_firstInTabBox = enable;
}
void setIcon(const QIcon &icon);
void startAutoRaise();
void autoRaise();
@ -1895,7 +1887,6 @@ private:
QRectF ensureSpecialStateGeometry(const QRectF &geometry);
std::shared_ptr<TabBox::TabBoxClientImpl> m_tabBoxClient;
bool m_firstInTabBox = false;
bool m_skipTaskbar = false;
/**
* Unaffected by KWin

View file

@ -495,7 +495,6 @@ bool X11Window::manage(xcb_window_t w, bool isMapped)
auto skipCloseAnimationCookie = fetchSkipCloseAnimation();
auto showOnScreenEdgeCookie = fetchShowOnScreenEdge();
auto colorSchemeCookie = fetchPreferredColorScheme();
auto firstInTabBoxCookie = fetchFirstInTabBox();
auto transientCookie = fetchTransient();
auto activitiesCookie = fetchActivities();
auto applicationMenuServiceNameCookie = fetchApplicationMenuServiceName();
@ -561,7 +560,6 @@ bool X11Window::manage(xcb_window_t w, bool isMapped)
setOriginalSkipTaskbar((info->state() & NET::SkipTaskbar) != 0);
setSkipPager((info->state() & NET::SkipPager) != 0);
setSkipSwitcher((info->state() & NET::SkipSwitcher) != 0);
readFirstInTabBox(firstInTabBoxCookie);
setupCompositing();
@ -2569,24 +2567,6 @@ void X11Window::setSessionActivityOverride(bool needed)
updateActivities(false);
}
Xcb::Property X11Window::fetchFirstInTabBox() const
{
return Xcb::Property(false, m_client, atoms->kde_first_in_window_list,
atoms->kde_first_in_window_list, 0, 1);
}
void X11Window::readFirstInTabBox(Xcb::Property &property)
{
setFirstInTabBox(property.toBool(32, atoms->kde_first_in_window_list));
}
void X11Window::updateFirstInTabBox()
{
// TODO: move into KWindowInfo
Xcb::Property property = fetchFirstInTabBox();
readFirstInTabBox(property);
}
Xcb::StringProperty X11Window::fetchPreferredColorScheme() const
{
return Xcb::StringProperty(m_client, atoms->kde_color_sheme);

View file

@ -241,9 +241,6 @@ public:
bool isClientSideDecorated() const;
Xcb::Property fetchFirstInTabBox() const;
void readFirstInTabBox(Xcb::Property &property);
void updateFirstInTabBox();
Xcb::StringProperty fetchPreferredColorScheme() const;
QString readPreferredColorScheme(Xcb::StringProperty &property) const;
QString preferredColorScheme() const override;