From 7e7846adce996c4c811077c68de6105a28abc4f1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thomas=20L=C3=BCbking?= Date: Mon, 13 Feb 2012 23:50:49 +0100 Subject: [PATCH 1/7] Focus window under mouse after MouseLowerOp BUG: 255052 REVIEW: 103975 --- activation.cpp | 39 +++++++++++++++++++++++---------------- useractions.cpp | 20 ++++++++++++-------- workspace.h | 2 ++ 3 files changed, 37 insertions(+), 24 deletions(-) diff --git a/activation.cpp b/activation.cpp index 37f0070414..d5159bb967 100644 --- a/activation.cpp +++ b/activation.cpp @@ -408,6 +408,25 @@ static inline bool isUsableFocusCandidate(Client *c, Client *prev, bool respectS (!respectScreen || c->isOnScreen(prev ? prev->screen() : Workspace::self()->activeScreen())); } +Client *Workspace::clientUnderMouse(int screen) const +{ + QList::const_iterator it = stackingOrder().constEnd(); + while (it != stackingOrder().constBegin()) { + Client *client = *(--it); + + // rule out clients which are not really visible. + // the screen test is rather superflous for xrandr & twinview since the geometry would differ -> TODO: might be dropped + if (!(client->isShown(false) && client->isOnCurrentDesktop() && + client->isOnCurrentActivity() && client->isOnScreen(screen))) + continue; + + if (client->geometry().contains(QCursor::pos())) { + return client; + } + } + return 0; +} + // deactivates 'c' and activates next client bool Workspace::activateNextClient(Client* c) { @@ -436,22 +455,10 @@ bool Workspace::activateNextClient(Client* c) Client* get_focus = NULL; if (options->nextFocusPrefersMouse) { - QList::const_iterator it = stackingOrder().constEnd(); - while (it != stackingOrder().constBegin()) { - Client *client = *(--it); - - // rule out clients which are not really visible. - // the screen test is rather superflous for xrandr & twinview since the geometry would differ -> TODO: might be dropped - if (!(client->isShown(false) && client->isOnCurrentDesktop() && - client->isOnCurrentActivity() && client->isOnScreen(c ? c->screen() : activeScreen()))) - continue; - - if (client->geometry().contains(QCursor::pos())) { - if (client != c && !client->isDesktop()) // should rather not happen, but it cannot get the focus. rest of usability is tested above - get_focus = client; - break; // unconditional break - we do not pass the focus to some client below an unusable one - } - + get_focus = clientUnderMouse(c ? c->screen() : activeScreen()); + if (get_focus && (get_focus == c || get_focus->isDesktop())) { + // should rather not happen, but it cannot get the focus. rest of usability is tested above + get_focus = 0; } } diff --git a/useractions.cpp b/useractions.cpp index b310a3929f..6eec1b15a1 100644 --- a/useractions.cpp +++ b/useractions.cpp @@ -816,13 +816,17 @@ bool Client::performMouseCommand(Options::MouseCommand command, const QPoint &gl case Options::MouseRaise: workspace()->raiseClient(this); break; - case Options::MouseLower: + case Options::MouseLower: { workspace()->lowerClient(this); - // As this most likely makes the window no longer visible change the - // keyboard focus to the next available window. - //workspace()->activateNextClient( this ); // Doesn't work when we lower a child window - workspace()->activateClient(workspace()->topClientOnDesktop(workspace()->currentDesktop(), -1)); + // used to be activateNextClient(this), then topClientOnDesktop + // since this is a mouseOp it's however safe to use the client under the mouse instead + if (isActive()) { + Client *next = workspace()->clientUnderMouse(screen()); + if (next && next != this) + workspace()->requestFocus(next, false); + } break; + } case Options::MouseShade : toggleShade(); cancelShadeHoverTimer(); @@ -1238,13 +1242,13 @@ void Workspace::slotWindowRaise() */ void Workspace::slotWindowLower() { - Client* c = active_popup_client ? active_popup_client : active_client; - if (c) { + if ((Client* c = active_popup_client ? active_popup_client : active_client)) { lowerClient(c); // As this most likely makes the window no longer visible change the // keyboard focus to the next available window. //activateNextClient( c ); // Doesn't work when we lower a child window - activateClient(topClientOnDesktop(currentDesktop(), -1)); + if (c->isActive()) + activateClient(topClientOnDesktop(currentDesktop(), -1)); } } diff --git a/workspace.h b/workspace.h index 092b6a72ff..d5942dca38 100644 --- a/workspace.h +++ b/workspace.h @@ -144,6 +144,8 @@ public: */ Client* mostRecentlyActivatedClient() const; + Client* clientUnderMouse(int screen) const; + void activateClient(Client*, bool force = false); void requestFocus(Client* c, bool force = false); void takeActivity(Client* c, int flags, bool handled); // Flags are ActivityFlags From 2123fb8dbdf8ca52eb2a678954e1e8097b9af42e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thomas=20L=C3=BCbking?= Date: Thu, 16 Feb 2012 23:44:00 +0100 Subject: [PATCH 2/7] select proper client for shortcuts and guard pointer REVIEW: 103998 --- useractions.cpp | 189 ++++++++++++++++++++++-------------------------- 1 file changed, 87 insertions(+), 102 deletions(-) diff --git a/useractions.cpp b/useractions.cpp index 6eec1b15a1..e66c197495 100644 --- a/useractions.cpp +++ b/useractions.cpp @@ -419,10 +419,8 @@ void Workspace::initDesktopPopup() desk_popup = new QMenu(popup); desk_popup->setFont(KGlobalSettings::menuFont()); - connect(desk_popup, SIGNAL(triggered(QAction*)), - this, SLOT(slotSendToDesktop(QAction*))); - connect(desk_popup, SIGNAL(aboutToShow()), - this, SLOT(desktopPopupAboutToShow())); + connect(desk_popup, SIGNAL(triggered(QAction*)), SLOT(slotSendToDesktop(QAction*))); + connect(desk_popup, SIGNAL(aboutToShow()), SLOT(desktopPopupAboutToShow())); QAction *action = desk_popup->menuAction(); // set it as the first item @@ -627,6 +625,8 @@ void Workspace::clientPopupActivated(QAction *action) WindowOperation op = static_cast< WindowOperation >(action->data().toInt()); Client* c = active_popup_client ? active_popup_client : active_client; + if (!c) + return; QString type; switch(op) { case FullScreenOp: @@ -1130,17 +1130,18 @@ void Workspace::slotSwitchToDesktop() setCurrentDesktop(i); } +#define USABLE_ACTIVE_CLIENT (!active_client || (active_client->isDesktop() || active_client->isDock())) void Workspace::slotWindowToDesktop() { - const int i = senderValue(sender()); - if (i < 1) - return; - Client* c = active_popup_client ? active_popup_client : active_client; - if (i >= 1 && i <= numberOfDesktops() && c - && !c->isDesktop() - && !c->isDock()) - sendClientToDesktop(c, i, true); + if (USABLE_ACTIVE_CLIENT) { + const int i = senderValue(sender()); + if (i < 1) + return; + + if (i >= 1 && i <= numberOfDesktops()) + sendClientToDesktop(active_client, i, true); + } } void Workspace::slotSwitchToScreen() @@ -1157,25 +1158,20 @@ void Workspace::slotSwitchToNextScreen() void Workspace::slotWindowToScreen() { - const int i = senderValue(sender()); - if (i < 0) - return; - Client* c = active_popup_client ? active_popup_client : active_client; - if (i >= 0 && i <= numScreens() && c - && !c->isDesktop() - && !c->isDock()) { - sendClientToScreen(c, i); + if (USABLE_ACTIVE_CLIENT) { + const int i = senderValue(sender()); + if (i < 0) + return; + if (i >= 0 && i <= numScreens()) { + sendClientToScreen(active_client, i); + } } } void Workspace::slotWindowToNextScreen() { - Client* c = active_popup_client ? active_popup_client : active_client; - if (c - && !c->isDesktop() - && !c->isDock()) { - sendClientToScreen(c, (c->screen() + 1) % numScreens()); - } + if (USABLE_ACTIVE_CLIENT) + sendClientToScreen(active_client, (active_client->screen() + 1) % numScreens()); } /*! @@ -1183,9 +1179,8 @@ void Workspace::slotWindowToNextScreen() */ void Workspace::slotWindowMaximize() { - Client* c = active_popup_client ? active_popup_client : active_client; - if (c) - performWindowOperation(c, Options::MaximizeOp); + if (USABLE_ACTIVE_CLIENT) + performWindowOperation(active_client, Options::MaximizeOp); } /*! @@ -1193,9 +1188,8 @@ void Workspace::slotWindowMaximize() */ void Workspace::slotWindowMaximizeVertical() { - Client* c = active_popup_client ? active_popup_client : active_client; - if (c) - performWindowOperation(c, Options::VMaximizeOp); + if (USABLE_ACTIVE_CLIENT) + performWindowOperation(active_client, Options::VMaximizeOp); } /*! @@ -1203,9 +1197,8 @@ void Workspace::slotWindowMaximizeVertical() */ void Workspace::slotWindowMaximizeHorizontal() { - Client* c = active_popup_client ? active_popup_client : active_client; - if (c) - performWindowOperation(c, Options::HMaximizeOp); + if (USABLE_ACTIVE_CLIENT) + performWindowOperation(active_client, Options::HMaximizeOp); } @@ -1214,8 +1207,8 @@ void Workspace::slotWindowMaximizeHorizontal() */ void Workspace::slotWindowMinimize() { - Client* c = active_popup_client ? active_popup_client : active_client; - performWindowOperation(c, Options::MinimizeOp); + if (USABLE_ACTIVE_CLIENT) + performWindowOperation(active_client, Options::MinimizeOp); } /*! @@ -1223,8 +1216,8 @@ void Workspace::slotWindowMinimize() */ void Workspace::slotWindowShade() { - Client* c = active_popup_client ? active_popup_client : active_client; - performWindowOperation(c, Options::ShadeOp); + if (USABLE_ACTIVE_CLIENT) + performWindowOperation(active_client, Options::ShadeOp); } /*! @@ -1232,9 +1225,8 @@ void Workspace::slotWindowShade() */ void Workspace::slotWindowRaise() { - Client* c = active_popup_client ? active_popup_client : active_client; - if (c) - raiseClient(c); + if (USABLE_ACTIVE_CLIENT) + raiseClient(active_client); } /*! @@ -1242,12 +1234,12 @@ void Workspace::slotWindowRaise() */ void Workspace::slotWindowLower() { - if ((Client* c = active_popup_client ? active_popup_client : active_client)) { - lowerClient(c); + if (USABLE_ACTIVE_CLIENT) { + lowerClient(active_client); // As this most likely makes the window no longer visible change the // keyboard focus to the next available window. //activateNextClient( c ); // Doesn't work when we lower a child window - if (c->isActive()) + if (active_client->isActive()) activateClient(topClientOnDesktop(currentDesktop(), -1)); } } @@ -1257,50 +1249,43 @@ void Workspace::slotWindowLower() */ void Workspace::slotWindowRaiseOrLower() { - Client* c = active_popup_client ? active_popup_client : active_client; - if (c) - raiseOrLowerClient(c); + if (USABLE_ACTIVE_CLIENT) + raiseOrLowerClient(active_client); } void Workspace::slotWindowOnAllDesktops() { - Client* c = active_popup_client ? active_popup_client : active_client; - if (c) - c->setOnAllDesktops(!c->isOnAllDesktops()); + if (USABLE_ACTIVE_CLIENT) + active_client->setOnAllDesktops(!active_client->isOnAllDesktops()); } void Workspace::slotWindowFullScreen() { - Client* c = active_popup_client ? active_popup_client : active_client; - if (c) - performWindowOperation(c, Options::FullScreenOp); + if (USABLE_ACTIVE_CLIENT) + performWindowOperation(active_client, Options::FullScreenOp); } void Workspace::slotWindowNoBorder() { - Client* c = active_popup_client ? active_popup_client : active_client; - if (c) - performWindowOperation(c, Options::NoBorderOp); + if (USABLE_ACTIVE_CLIENT) + performWindowOperation(active_client, Options::NoBorderOp); } void Workspace::slotWindowAbove() { - Client* c = active_popup_client ? active_popup_client : active_client; - if (c) - performWindowOperation(c, Options::KeepAboveOp); + if (USABLE_ACTIVE_CLIENT) + performWindowOperation(active_client, Options::KeepAboveOp); } void Workspace::slotWindowBelow() { - Client* c = active_popup_client ? active_popup_client : active_client; - if (c) - performWindowOperation(c, Options::KeepBelowOp); + if (USABLE_ACTIVE_CLIENT) + performWindowOperation(active_client, Options::KeepBelowOp); } void Workspace::slotSetupWindowShortcut() { - Client* c = active_popup_client ? active_popup_client : active_client; - if (c) - performWindowOperation(c, Options::SetupWindowShortcutOp); + if (USABLE_ACTIVE_CLIENT) + performWindowOperation(active_client, Options::SetupWindowShortcutOp); } /*! @@ -1316,7 +1301,8 @@ void Workspace::slotToggleShowDesktop() */ void Workspace::slotWindowToNextDesktop() { - windowToNextDesktop(active_popup_client ? active_popup_client : active_client); + if (USABLE_ACTIVE_CLIENT) + windowToNextDesktop(active_client); } void Workspace::windowToNextDesktop(Client* c) @@ -1337,7 +1323,8 @@ void Workspace::windowToNextDesktop(Client* c) */ void Workspace::slotWindowToPreviousDesktop() { - windowToPreviousDesktop(active_popup_client ? active_popup_client : active_client); + if (USABLE_ACTIVE_CLIENT) + windowToPreviousDesktop(active_client); } void Workspace::windowToPreviousDesktop(Client* c) @@ -1355,13 +1342,12 @@ void Workspace::windowToPreviousDesktop(Client* c) void Workspace::slotWindowToDesktopRight() { - int d = desktopToRight(currentDesktop(), options->rollOverDesktops); - if (d == currentDesktop()) - return; - Client* c = active_popup_client ? active_popup_client : active_client; - if (c && !c->isDesktop() - && !c->isDock()) { - setClientIsMoving(c); + if (USABLE_ACTIVE_CLIENT) { + int d = desktopToRight(currentDesktop(), options->rollOverDesktops); + if (d == currentDesktop()) + return; + + setClientIsMoving(active_client); setCurrentDesktop(d); setClientIsMoving(NULL); } @@ -1369,13 +1355,12 @@ void Workspace::slotWindowToDesktopRight() void Workspace::slotWindowToDesktopLeft() { - int d = desktopToLeft(currentDesktop(), options->rollOverDesktops); - if (d == currentDesktop()) - return; - Client* c = active_popup_client ? active_popup_client : active_client; - if (c && !c->isDesktop() - && !c->isDock()) { - setClientIsMoving(c); + if (USABLE_ACTIVE_CLIENT) { + int d = desktopToLeft(currentDesktop(), options->rollOverDesktops); + if (d == currentDesktop()) + return; + + setClientIsMoving(active_client); setCurrentDesktop(d); setClientIsMoving(NULL); } @@ -1383,13 +1368,12 @@ void Workspace::slotWindowToDesktopLeft() void Workspace::slotWindowToDesktopUp() { - int d = desktopAbove(currentDesktop(), options->rollOverDesktops); - if (d == currentDesktop()) - return; - Client* c = active_popup_client ? active_popup_client : active_client; - if (c && !c->isDesktop() - && !c->isDock()) { - setClientIsMoving(c); + if (USABLE_ACTIVE_CLIENT) { + int d = desktopAbove(currentDesktop(), options->rollOverDesktops); + if (d == currentDesktop()) + return; + + setClientIsMoving(active_client); setCurrentDesktop(d); setClientIsMoving(NULL); } @@ -1397,13 +1381,12 @@ void Workspace::slotWindowToDesktopUp() void Workspace::slotWindowToDesktopDown() { - int d = desktopBelow(currentDesktop(), options->rollOverDesktops); - if (d == currentDesktop()) - return; - Client* c = active_popup_client ? active_popup_client : active_client; - if (c && !c->isDesktop() - && !c->isDock()) { - setClientIsMoving(c); + if (USABLE_ACTIVE_CLIENT) { + int d = desktopBelow(currentDesktop(), options->rollOverDesktops); + if (d == currentDesktop()) + return; + + setClientIsMoving(active_client); setCurrentDesktop(d); setClientIsMoving(NULL); } @@ -1634,8 +1617,8 @@ void Workspace::slotWindowClose() // TODO: why? // if ( tab_box->isVisible()) // return; - Client* c = active_popup_client ? active_popup_client : active_client; - performWindowOperation(c, Options::CloseOp); + if (USABLE_ACTIVE_CLIENT) + performWindowOperation(active_client, Options::CloseOp); } /*! @@ -1643,8 +1626,8 @@ void Workspace::slotWindowClose() */ void Workspace::slotWindowMove() { - Client* c = active_popup_client ? active_popup_client : active_client; - performWindowOperation(c, Options::UnrestrictedMoveOp); + if (USABLE_ACTIVE_CLIENT) + performWindowOperation(active_client, Options::UnrestrictedMoveOp); } /*! @@ -1652,10 +1635,12 @@ void Workspace::slotWindowMove() */ void Workspace::slotWindowResize() { - Client* c = active_popup_client ? active_popup_client : active_client; - performWindowOperation(c, Options::UnrestrictedResizeOp); + if (USABLE_ACTIVE_CLIENT) + performWindowOperation(active_client, Options::UnrestrictedResizeOp); } +#undef USABLE_ACTIVE_CLIENT + void Client::setShortcut(const QString& _cut) { QString cut = rules()->checkShortcut(_cut); From 802abf09d17ecb69810e09c3a6cebcecbbdc44d3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thomas=20L=C3=BCbking?= Date: Fri, 17 Feb 2012 18:41:44 +0100 Subject: [PATCH 3/7] allow windows to withdraw XShape masks BUG: 293736 REVIEW: 104007 --- client.cpp | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/client.cpp b/client.cpp index da0fd466ee..22aa8dcdcb 100644 --- a/client.cpp +++ b/client.cpp @@ -831,10 +831,15 @@ void Client::updateShape() noborder = true; updateDecoration(true); } - } - if (shape() && noBorder()) - XShapeCombineShape(display(), frameId(), ShapeBounding, + if (noBorder()) + XShapeCombineShape(display(), frameId(), ShapeBounding, clientPos().x(), clientPos().y(), window(), ShapeBounding, ShapeSet); + } else if (app_noborder) { + XShapeCombineMask(display(), frameId(), ShapeBounding, 0, 0, None, ShapeSet); + detectNoBorder(); + app_noborder = noborder; + updateDecoration(true); + } // Decoration mask (i.e. 'else' here) setting is done in setMask() // when the decoration calls it or when the decoration is created/destroyed From 631fb0d4cbfcb5b558d1fbc99fe1cfa55f25a565 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thomas=20L=C3=BCbking?= Date: Fri, 17 Feb 2012 19:44:30 +0100 Subject: [PATCH 4/7] allow app_noborder clients to drop out of maximization REVIEW: 104010 CCBUG: 294211 --- geometry.cpp | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/geometry.cpp b/geometry.cpp index 7f36586a89..d9ae97ada3 100644 --- a/geometry.cpp +++ b/geometry.cpp @@ -1623,10 +1623,12 @@ void Client::configureRequest(int value_mask, int rx, int ry, int rw, int rh, in kDebug(1212) << this << bool(value_mask & (CWX|CWWidth|CWY|CWHeight)) << bool(maximizeMode() & MaximizeVertical) << bool(maximizeMode() & MaximizeHorizontal); - if (maximizeMode() & MaximizeVertical) - value_mask &= ~(CWY|CWHeight); // do not allow clients to drop out of vertical ... - if (maximizeMode() & MaximizeHorizontal) - value_mask &= ~(CWX|CWWidth); // .. or horizontal maximization (MaximizeFull == MaximizeVertical|MaximizeHorizontal) + if (!app_noborder) { // + if (maximizeMode() & MaximizeVertical) + value_mask &= ~(CWY|CWHeight); // do not allow clients to drop out of vertical ... + if (maximizeMode() & MaximizeHorizontal) + value_mask &= ~(CWX|CWWidth); // .. or horizontal maximization (MaximizeFull == MaximizeVertical|MaximizeHorizontal) + } if (!(value_mask & (CWX|CWWidth|CWY|CWHeight))) { kDebug(1212) << "DENIED"; return; // nothing to (left) to do for use - bugs #158974, #252314 From 152b7381812c7e60e5d0c02893ab70784152ecaa Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thomas=20L=C3=BCbking?= Date: Fri, 17 Feb 2012 20:35:21 +0100 Subject: [PATCH 5/7] don't allocate unused closeview and guard all pointers REVIEW: 104009 --- effects/presentwindows/presentwindows.cpp | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/effects/presentwindows/presentwindows.cpp b/effects/presentwindows/presentwindows.cpp index fc725d9ac8..039f84b079 100755 --- a/effects/presentwindows/presentwindows.cpp +++ b/effects/presentwindows/presentwindows.cpp @@ -453,7 +453,7 @@ void PresentWindowsEffect::slotWindowAdded(EffectWindow *w) m_motionManager.manage(w); rearrangeWindows(); } - if (w == effects->findWindow(m_closeView->winId())) { + if (m_closeView && w == effects->findWindow(m_closeView->winId())) { winData->visible = true; winData->highlight = 1.0; m_closeWindow = w; @@ -527,7 +527,7 @@ void PresentWindowsEffect::windowInputMouseEvent(Window w, QEvent *e) Q_UNUSED(w); QMouseEvent* me = static_cast< QMouseEvent* >(e); - if (m_closeView->geometry().contains(me->pos())) { + if (m_closeView && m_closeView->geometry().contains(me->pos())) { if (!m_closeView->isVisible()) { updateCloseWindow(); } @@ -557,7 +557,7 @@ void PresentWindowsEffect::windowInputMouseEvent(Window w, QEvent *e) } if (m_highlightedWindow && m_motionManager.transformedGeometry(m_highlightedWindow).contains(me->pos())) updateCloseWindow(); - else + else if (m_closeView) m_closeView->hide(); if (e->type() == QEvent::MouseButtonRelease) { @@ -966,7 +966,8 @@ void PresentWindowsEffect::rearrangeWindows() return; effects->addRepaintFull(); // Trigger the first repaint - m_closeView->hide(); + if (m_closeView) + m_closeView->hide(); // Work out which windows are on which screens EffectWindowList windowlist; @@ -1600,8 +1601,10 @@ void PresentWindowsEffect::setActive(bool active, bool closingTab) m_highlightedWindow = NULL; m_windowFilter.clear(); - m_closeView = new CloseWindowView(); - connect(m_closeView, SIGNAL(close()), SLOT(closeWindow())); + if (!m_doNotCloseWindows) { + m_closeView = new CloseWindowView(); + connect(m_closeView, SIGNAL(close()), SLOT(closeWindow())); + } // Add every single window to m_windowData (Just calling [w] creates it) foreach (EffectWindow * w, effects->stackingOrder()) { @@ -1770,7 +1773,7 @@ bool PresentWindowsEffect::isSelectableWindow(EffectWindow *w) return false; if (w->isSkipSwitcher()) return false; - if (w == effects->findWindow(m_closeView->winId())) + if (m_closeView && w == effects->findWindow(m_closeView->winId())) return false; if (m_tabBoxEnabled) return true; From e789daf1bc1df6ed7c8f4bf2b0ac6502c812c1b7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thomas=20L=C3=BCbking?= Date: Mon, 20 Feb 2012 02:24:49 +0100 Subject: [PATCH 6/7] clean dirty rect from repaints_region when updating shadow, skip double resetting of shadow rect REVIEW: 104028 --- scene.cpp | 6 ------ toplevel.cpp | 1 + 2 files changed, 1 insertion(+), 6 deletions(-) diff --git a/scene.cpp b/scene.cpp index bb92fc1098..05411988ad 100644 --- a/scene.cpp +++ b/scene.cpp @@ -214,9 +214,6 @@ void Scene::paintGenericScreen(int orig_mask, ScreenPaintData) // This has to be done here because many effects schedule a repaint for // the next frame within Effects::prePaintWindow. topw->resetRepaints(topw->decorationRect()); - if (topw->hasShadow()) { - topw->resetRepaints(topw->shadow()->shadowRegion().boundingRect()); - } WindowPrePaintData data; data.mask = orig_mask | (w->isOpaque() ? PAINT_WINDOW_OPAQUE : PAINT_WINDOW_TRANSLUCENT); @@ -273,9 +270,6 @@ void Scene::paintSimpleScreen(int orig_mask, QRegion region) // This has to be done here because many effects schedule a repaint for // the next frame within Effects::prePaintWindow. topw->resetRepaints(topw->decorationRect()); - if (topw->hasShadow()) { - topw->resetRepaints(topw->shadow()->shadowRegion().boundingRect()); - } // Clip out the decoration for opaque windows; the decoration is drawn in the second pass if (w->isOpaque()) { // the window is fully opaque diff --git a/toplevel.cpp b/toplevel.cpp index ffe7f0c6ca..0716c2f566 100644 --- a/toplevel.cpp +++ b/toplevel.cpp @@ -366,6 +366,7 @@ void Toplevel::getShadow() if (hasShadow()) dirtyRect |= shadow()->shadowRegion().boundingRect(); if (dirtyRect.isValid()) { + resetRepaints(dirtyRect); dirtyRect.translate(pos()); workspace()->addRepaint(dirtyRect); } From 67f484e8256bb1136add395bcb482e645ae5fba7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thomas=20L=C3=BCbking?= Date: Tue, 21 Feb 2012 18:42:09 +0100 Subject: [PATCH 7/7] fix negation logic error ... --- useractions.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/useractions.cpp b/useractions.cpp index e66c197495..5b74e2e2c5 100644 --- a/useractions.cpp +++ b/useractions.cpp @@ -1130,7 +1130,7 @@ void Workspace::slotSwitchToDesktop() setCurrentDesktop(i); } -#define USABLE_ACTIVE_CLIENT (!active_client || (active_client->isDesktop() || active_client->isDock())) +#define USABLE_ACTIVE_CLIENT (active_client && !(active_client->isDesktop() || active_client->isDock())) void Workspace::slotWindowToDesktop() {