ShadeHover highlighted windows in tabbox
The setting says "show selected window" ;-) BUG: 186206 FIXED-IN: 5.3 REVIEW: 122472icc-effect-5.14.5
parent
ea5a5f196d
commit
40a06a23a9
|
@ -56,6 +56,10 @@ public:
|
||||||
Q_UNUSED(tabbox)
|
Q_UNUSED(tabbox)
|
||||||
Q_UNUSED(elevate)
|
Q_UNUSED(elevate)
|
||||||
}
|
}
|
||||||
|
virtual void shadeClient(TabBox::TabBoxClient *c, bool b) const {
|
||||||
|
Q_UNUSED(c)
|
||||||
|
Q_UNUSED(b)
|
||||||
|
}
|
||||||
virtual void hideOutline() {
|
virtual void hideOutline() {
|
||||||
}
|
}
|
||||||
virtual QWeakPointer< TabBox::TabBoxClient > nextClientFocusChain(TabBox::TabBoxClient *client) const;
|
virtual QWeakPointer< TabBox::TabBoxClient > nextClientFocusChain(TabBox::TabBoxClient *client) const;
|
||||||
|
|
|
@ -311,6 +311,15 @@ void TabBoxHandlerImpl::elevateClient(TabBoxClient *c, WId tabbox, bool b) const
|
||||||
w->elevate(b);
|
w->elevate(b);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void TabBoxHandlerImpl::shadeClient(TabBoxClient *c, bool b) const
|
||||||
|
{
|
||||||
|
Client *cl = static_cast<TabBoxClientImpl*>(c)->client();
|
||||||
|
cl->cancelShadeHoverTimer(); // stop core shading action
|
||||||
|
if (!b && cl->shadeMode() == ShadeNormal)
|
||||||
|
cl->setShade(ShadeHover);
|
||||||
|
else if (b && cl->shadeMode() == ShadeHover)
|
||||||
|
cl->setShade(ShadeNormal);
|
||||||
|
}
|
||||||
|
|
||||||
QWeakPointer<TabBoxClient> TabBoxHandlerImpl::desktopClient() const
|
QWeakPointer<TabBoxClient> TabBoxHandlerImpl::desktopClient() const
|
||||||
{
|
{
|
||||||
|
@ -1107,6 +1116,12 @@ void TabBox::slotWalkBackThroughDesktopList()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void TabBox::shadeActivate(Client *c)
|
||||||
|
{
|
||||||
|
if ((c->shadeMode() == ShadeNormal || c->shadeMode() == ShadeHover) && options->isShadeHover())
|
||||||
|
c->setShade(ShadeActivated);
|
||||||
|
}
|
||||||
|
|
||||||
bool TabBox::toggle(ElectricBorder eb)
|
bool TabBox::toggle(ElectricBorder eb)
|
||||||
{
|
{
|
||||||
if (!options->focusPolicyIsReasonable())
|
if (!options->focusPolicyIsReasonable())
|
||||||
|
@ -1216,8 +1231,7 @@ void TabBox::CDEWalkThroughWindows(bool forward)
|
||||||
Workspace::self()->lowerClient(c);
|
Workspace::self()->lowerClient(c);
|
||||||
if (options->focusPolicyIsReasonable()) {
|
if (options->focusPolicyIsReasonable()) {
|
||||||
Workspace::self()->activateClient(nc);
|
Workspace::self()->activateClient(nc);
|
||||||
if (nc->isShade() && options->isShadeHover())
|
shadeActivate(nc);
|
||||||
nc->setShade(ShadeActivated);
|
|
||||||
} else {
|
} else {
|
||||||
if (!nc->isOnDesktop(currentDesktop()))
|
if (!nc->isOnDesktop(currentDesktop()))
|
||||||
setCurrentDesktop(nc->desktop());
|
setCurrentDesktop(nc->desktop());
|
||||||
|
@ -1233,8 +1247,7 @@ void TabBox::KDEOneStepThroughWindows(bool forward, TabBoxMode mode)
|
||||||
nextPrev(forward);
|
nextPrev(forward);
|
||||||
if (Client* c = currentClient()) {
|
if (Client* c = currentClient()) {
|
||||||
Workspace::self()->activateClient(c);
|
Workspace::self()->activateClient(c);
|
||||||
if (c->isShade() && options->isShadeHover())
|
shadeActivate(c);
|
||||||
c->setShade(ShadeActivated);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1426,8 +1439,7 @@ void TabBox::accept()
|
||||||
close();
|
close();
|
||||||
if (c) {
|
if (c) {
|
||||||
Workspace::self()->activateClient(c);
|
Workspace::self()->activateClient(c);
|
||||||
if (c->isShade() && options->isShadeHover())
|
shadeActivate(c);
|
||||||
c->setShade(ShadeActivated);
|
|
||||||
if (c->isDesktop())
|
if (c->isDesktop())
|
||||||
Workspace::self()->setShowingDesktop(!Workspace::self()->showingDesktop());
|
Workspace::self()->setShowingDesktop(!Workspace::self()->showingDesktop());
|
||||||
}
|
}
|
||||||
|
|
|
@ -67,6 +67,7 @@ public:
|
||||||
virtual void elevateClient(TabBoxClient* c, WId tabbox, bool elevate) const;
|
virtual void elevateClient(TabBoxClient* c, WId tabbox, bool elevate) const;
|
||||||
virtual void raiseClient(TabBoxClient *client) const;
|
virtual void raiseClient(TabBoxClient *client) const;
|
||||||
virtual void restack(TabBoxClient *c, TabBoxClient *under);
|
virtual void restack(TabBoxClient *c, TabBoxClient *under);
|
||||||
|
virtual void shadeClient(TabBoxClient *c, bool b) const;
|
||||||
virtual QWeakPointer< TabBoxClient > clientToAddToList(KWin::TabBox::TabBoxClient* client, int desktop) const;
|
virtual QWeakPointer< TabBoxClient > clientToAddToList(KWin::TabBox::TabBoxClient* client, int desktop) const;
|
||||||
virtual QWeakPointer< TabBoxClient > desktopClient() const;
|
virtual QWeakPointer< TabBoxClient > desktopClient() const;
|
||||||
virtual void activateAndClose();
|
virtual void activateAndClose();
|
||||||
|
@ -231,6 +232,8 @@ private:
|
||||||
template <typename Slot>
|
template <typename Slot>
|
||||||
void key(const char *actionName, Slot slot, const QKeySequence &shortcut = QKeySequence());
|
void key(const char *actionName, Slot slot, const QKeySequence &shortcut = QKeySequence());
|
||||||
|
|
||||||
|
void shadeActivate(Client *c);
|
||||||
|
|
||||||
private Q_SLOTS:
|
private Q_SLOTS:
|
||||||
void reconfigure();
|
void reconfigure();
|
||||||
void globalShortcutChanged(QAction *action, const QKeySequence &seq);
|
void globalShortcutChanged(QAction *action, const QKeySequence &seq);
|
||||||
|
|
|
@ -176,6 +176,7 @@ void TabBoxHandlerPrivate::updateHighlightWindows()
|
||||||
q->elevateClient(currentClient, w ? w->winId() : 0, true);
|
q->elevateClient(currentClient, w ? w->winId() : 0, true);
|
||||||
} else {
|
} else {
|
||||||
if (lastRaisedClient) {
|
if (lastRaisedClient) {
|
||||||
|
q->shadeClient(lastRaisedClient, true);
|
||||||
if (lastRaisedClientSucc)
|
if (lastRaisedClientSucc)
|
||||||
q->restack(lastRaisedClient, lastRaisedClientSucc);
|
q->restack(lastRaisedClient, lastRaisedClientSucc);
|
||||||
// TODO lastRaisedClient->setMinimized( lastRaisedClientWasMinimized );
|
// TODO lastRaisedClient->setMinimized( lastRaisedClientWasMinimized );
|
||||||
|
@ -183,6 +184,7 @@ void TabBoxHandlerPrivate::updateHighlightWindows()
|
||||||
|
|
||||||
lastRaisedClient = currentClient;
|
lastRaisedClient = currentClient;
|
||||||
if (lastRaisedClient) {
|
if (lastRaisedClient) {
|
||||||
|
q->shadeClient(lastRaisedClient, false);
|
||||||
// TODO if ( (lastRaisedClientWasMinimized = lastRaisedClient->isMinimized()) )
|
// TODO if ( (lastRaisedClientWasMinimized = lastRaisedClient->isMinimized()) )
|
||||||
// lastRaisedClient->setMinimized( false );
|
// lastRaisedClient->setMinimized( false );
|
||||||
TabBoxClientList order = q->stackingOrder();
|
TabBoxClientList order = q->stackingOrder();
|
||||||
|
@ -216,6 +218,13 @@ void TabBoxHandlerPrivate::updateHighlightWindows()
|
||||||
void TabBoxHandlerPrivate::endHighlightWindows(bool abort)
|
void TabBoxHandlerPrivate::endHighlightWindows(bool abort)
|
||||||
{
|
{
|
||||||
TabBoxClient *currentClient = q->client(index);
|
TabBoxClient *currentClient = q->client(index);
|
||||||
|
if (config.isHighlightWindows() && q->isKWinCompositing()) {
|
||||||
|
foreach (const QWeakPointer<TabBoxClient> &clientPointer, q->stackingOrder()) {
|
||||||
|
if (QSharedPointer<TabBoxClient> client = clientPointer.toStrongRef())
|
||||||
|
if (client != currentClient) // to not mess up with wanted ShadeActive/ShadeHover state
|
||||||
|
q->shadeClient(client.data(), true);
|
||||||
|
}
|
||||||
|
}
|
||||||
QWindow *w = window();
|
QWindow *w = window();
|
||||||
if (currentClient)
|
if (currentClient)
|
||||||
q->elevateClient(currentClient, w ? w->winId() : 0, false);
|
q->elevateClient(currentClient, w ? w->winId() : 0, false);
|
||||||
|
@ -373,15 +382,21 @@ void TabBoxHandler::show()
|
||||||
if (d->config.isHighlightWindows()) {
|
if (d->config.isHighlightWindows()) {
|
||||||
Xcb::sync();
|
Xcb::sync();
|
||||||
// TODO this should be
|
// TODO this should be
|
||||||
// QMetaObject::invokeMethod(this, "updateHighlightWindows", Qt::QueuedConnection);
|
// QMetaObject::invokeMethod(this, "initHighlightWindows", Qt::QueuedConnection);
|
||||||
// but we somehow need to cross > 1 event cycle (likely because of queued invocation in the effects)
|
// but we somehow need to cross > 1 event cycle (likely because of queued invocation in the effects)
|
||||||
// to ensure the EffectWindow is present when updateHighlightWindows, thus elevating the window/tabbox
|
// to ensure the EffectWindow is present when updateHighlightWindows, thus elevating the window/tabbox
|
||||||
QTimer::singleShot(1, this, SLOT(updateHighlightWindows()));
|
QTimer::singleShot(1, this, SLOT(initHighlightWindows()));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void TabBoxHandler::updateHighlightWindows()
|
void TabBoxHandler::initHighlightWindows()
|
||||||
{
|
{
|
||||||
|
if (isKWinCompositing()) {
|
||||||
|
foreach (const QWeakPointer<TabBoxClient> &clientPointer, stackingOrder()) {
|
||||||
|
if (QSharedPointer<TabBoxClient> client = clientPointer.toStrongRef())
|
||||||
|
shadeClient(client.data(), false);
|
||||||
|
}
|
||||||
|
}
|
||||||
d->updateHighlightWindows();
|
d->updateHighlightWindows();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -180,6 +180,13 @@ public:
|
||||||
*/
|
*/
|
||||||
virtual void restack(TabBoxClient *c, TabBoxClient *under) = 0;
|
virtual void restack(TabBoxClient *c, TabBoxClient *under) = 0;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Toggle between ShadeHover and ShadeNormal - not shaded windows are unaffected
|
||||||
|
* @param c The client to be shaded
|
||||||
|
* @param b Whether to un- or shade
|
||||||
|
*/
|
||||||
|
virtual void shadeClient(TabBoxClient *c, bool b) const = 0;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @return The current stacking order of TabBoxClients
|
* @return The current stacking order of TabBoxClients
|
||||||
*/
|
*/
|
||||||
|
@ -334,7 +341,7 @@ Q_SIGNALS:
|
||||||
void selectedIndexChanged();
|
void selectedIndexChanged();
|
||||||
|
|
||||||
private Q_SLOTS:
|
private Q_SLOTS:
|
||||||
void updateHighlightWindows();
|
void initHighlightWindows();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
friend class TabBoxHandlerPrivate;
|
friend class TabBoxHandlerPrivate;
|
||||||
|
|
Loading…
Reference in New Issue