Commit 3c5c079a authored by Ismael Asensio's avatar Ismael Asensio
Browse files

TabBox: Do not highlight selected window for fullscreen switchers

This helps improving performance on those effects, where the
highlighted window is not even shown.

BUG: 449180
FIXED-IN: 5.25.3
parent 7d08e5f2
Pipeline #199672 failed with stage
in 12 minutes and 36 seconds
......@@ -62,6 +62,8 @@ public:
ClientModel *clientModel() const;
DesktopModel *desktopModel() const;
bool isHighlightWindows() const;
TabBoxHandler *q; // public pointer
// members
TabBoxConfig config;
......@@ -144,6 +146,15 @@ DesktopModel *TabBoxHandlerPrivate::desktopModel() const
return m_desktopModel;
}
bool TabBoxHandlerPrivate::isHighlightWindows() const
{
const QQuickWindow *w = window();
if (w && w->visibility() == QWindow::FullScreen) {
return false;
}
return config.isHighlightWindows();
}
void TabBoxHandlerPrivate::updateHighlightWindows()
{
if (!isShown || config.tabBoxMode() != TabBoxConfig::ClientTabBox) {
......@@ -198,7 +209,7 @@ void TabBoxHandlerPrivate::updateHighlightWindows()
void TabBoxHandlerPrivate::endHighlightWindows(bool abort)
{
TabBoxClient *currentClient = q->client(index);
if (config.isHighlightWindows() && q->isKWinCompositing()) {
if (isHighlightWindows() && q->isKWinCompositing()) {
const auto stackingOrder = q->stackingOrder();
for (const QWeakPointer<TabBoxClient> &clientPointer : stackingOrder) {
if (QSharedPointer<TabBoxClient> client = clientPointer.toStrongRef()) {
......@@ -381,7 +392,7 @@ void TabBoxHandler::show()
if (d->config.isShowTabBox()) {
d->show();
}
if (d->config.isHighlightWindows()) {
if (d->isHighlightWindows()) {
if (kwinApp()->x11Connection()) {
Xcb::sync();
}
......@@ -409,7 +420,7 @@ void TabBoxHandler::initHighlightWindows()
void TabBoxHandler::hide(bool abort)
{
d->isShown = false;
if (d->config.isHighlightWindows()) {
if (d->isHighlightWindows()) {
d->endHighlightWindows(abort);
}
#ifndef KWIN_UNIT_TEST
......@@ -519,7 +530,7 @@ void TabBoxHandler::setCurrentIndex(const QModelIndex &index)
}
d->index = index;
if (d->config.tabBoxMode() == TabBoxConfig::ClientTabBox) {
if (d->config.isHighlightWindows()) {
if (d->isHighlightWindows()) {
d->updateHighlightWindows();
}
}
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment