From 45c3835fd7885ee71926d506d5abd7d9b51fd37c Mon Sep 17 00:00:00 2001 From: l10n daemon script Date: Tue, 14 Jan 2014 07:28:35 +0000 Subject: [PATCH 1/8] SVN_SILENT made messages (.desktop file) --- kcmkwin/kwinoptions/kwinoptions.desktop | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/kcmkwin/kwinoptions/kwinoptions.desktop b/kcmkwin/kwinoptions/kwinoptions.desktop index f3ddc2cbd9..fc93ac2f2d 100644 --- a/kcmkwin/kwinoptions/kwinoptions.desktop +++ b/kcmkwin/kwinoptions/kwinoptions.desktop @@ -201,7 +201,7 @@ X-KDE-Keywords[et]=fookus,asetus,paigutus,akende käitumine,animeerimine,animats X-KDE-Keywords[fi]=kohdistus,sijoittelu,sijoitus,ikkunoiden toiminta,animaatio,nosta,automaattinen nosto,ikkunat,kehys,otsikkopalkki,kaksoisnapsautus,tuplanapsautus,kaksoisklikkaus,tuplaklikkaus X-KDE-Keywords[fr]=focus, placement, comportement de la fenêtre, animation, agrandissement, agrandissement automatique, fenêtres, cadre, barre de titre, double clic X-KDE-Keywords[ga]=fócas,láithriú,oibriú na bhfuinneog,beochan,ardaigh,uathardaigh,fuinneoga,fráma,ceannteideal,déchliceáil -X-KDE-Keywords[gl]=foco,posicionamento,comportamento da xanela, animación,xanelas,moldura,barra de título +X-KDE-Keywords[gl]=foco,posicionamento,comportamento da xanela, animación,xanelas,moldura,barra de título,marco X-KDE-Keywords[hu]=fókus,elhelyezés,ablakműködés,animáció,felemelés,automatikus felemelés,ablakok,keret,címsor,dupla kattintás X-KDE-Keywords[ia]=focus,placiamento,comportamento de fenestra,animation,altiar,auto altiar,fenestras,quadro,barra de titulo,duple click X-KDE-Keywords[it]=fuoco,posizionamento,comportamento della finestra,animazione,sollevamento,sollevamento automatico,finestre,riquadro,barra del titolo,doppio clic From 03b23e21d9702db50e5b1ac956613b38ee00e695 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thomas=20L=C3=BCbking?= Date: Mon, 23 Dec 2013 02:28:54 +0100 Subject: [PATCH 2/8] fix shortcut driven quicktiling 1. swapping direction would rather toggle tiling 2. the next screen was calculated wrongly (found outmost) 3. the electrictborder geometry was not updated when swapping the mode on screen changes BUG: 329136 FIXED-IN: 4.11.6 CCBUG: 222921 REVIEW: 114648 --- geometry.cpp | 86 +++++++++++++++++++++++++++------------------------- 1 file changed, 44 insertions(+), 42 deletions(-) diff --git a/geometry.cpp b/geometry.cpp index 07be3cd9db..e0d0aebdac 100644 --- a/geometry.cpp +++ b/geometry.cpp @@ -3146,14 +3146,12 @@ void Client::setQuickTileMode(QuickTileMode mode, bool keyboard) if (!isResizable() && maximizeMode() != MaximizeFull) return; - if (mode == QuickTileMaximize) - { + if (mode == QuickTileMaximize) { TabSynchronizer syncer(this, TabGroup::QuickTile|TabGroup::Geometry|TabGroup::Maximized); quick_tile_mode = QuickTileNone; - if (maximizeMode() == MaximizeFull) + if (maximizeMode() == MaximizeFull) { setMaximize(false, false); - else - { + } else { setMaximize(true, true); QRect clientArea = workspace()->clientArea(MaximizeArea, this); if (geometry().top() != clientArea.top()) { @@ -3194,27 +3192,13 @@ void Client::setQuickTileMode(QuickTileMode mode, bool keyboard) return; } - // First, check if the requested tile negates the tile we're in now: move right when left or left when right - // is the same as explicitly untiling this window, so allow it. - if (mode == QuickTileNone || ((quick_tile_mode & QuickTileHorizontal) && (mode & QuickTileHorizontal))) { - TabSynchronizer syncer(this, TabGroup::QuickTile|TabGroup::Geometry); - - quick_tile_mode = QuickTileNone; - // Untiling, so just restore geometry, and we're done. - if (!geom_restore.isValid()) // invalid if we started maximized and wait for placement - geom_restore = geometry(); - // decorations may turn off some borders when tiled - const ForceGeometry_t geom_mode = decoration && checkBorderSizes(false) ? ForceGeometrySet : NormalGeometrySet; - setGeometry(geom_restore, geom_mode); - checkWorkspacePosition(); // Just in case it's a different screen - return; - } else { + if (mode != QuickTileNone) { TabSynchronizer syncer(this, TabGroup::QuickTile|TabGroup::Geometry); QPoint whichScreen = keyboard ? geometry().center() : cursorPos(); // If trying to tile to the side that the window is already tiled to move the window to the next - // screen if it exists, otherwise ignore the request to prevent corrupting geom_restore. + // screen if it exists, otherwise toggle the mode (set QuickTileNone) if (quick_tile_mode == mode) { const int numScreens = screens()->count(); const int curScreen = screen(); @@ -3223,32 +3207,37 @@ void Client::setQuickTileMode(QuickTileMode mode, bool keyboard) for (int i = 0; i < numScreens; ++i) // Cache screens[i] = Screens::self()->geometry(i); for (int i = 0; i < numScreens; ++i) { + if (i == curScreen) continue; - if (((mode == QuickTileLeft && - screens[i].center().x() < screens[nextScreen].center().x()) || - (mode == QuickTileRight && - screens[i].center().x() > screens[nextScreen].center().x())) && - // Must be in horizontal line - (screens[i].bottom() > screens[nextScreen].top() || - screens[i].top() < screens[nextScreen].bottom())) - nextScreen = i; + + if (screens[i].bottom() <= screens[curScreen].top() || screens[i].top() >= screens[curScreen].bottom()) + continue; // not in horizontal line + + const int x = screens[i].center().x(); + if ((mode & QuickTileHorizontal) == QuickTileLeft) { + if (x >= screens[curScreen].center().x() || (curScreen != nextScreen && x <= screens[nextScreen].center().x())) + continue; // not left of current or more left then found next + } else if ((mode & QuickTileHorizontal) == QuickTileRight) { + if (x <= screens[curScreen].center().x() || (curScreen != nextScreen && x >= screens[nextScreen].center().x())) + continue; // not right of current or more right then found next + } + + nextScreen = i; } - if (nextScreen == curScreen) - return; // No other screens - // Move to other screen - geom_restore.translate( - screens[nextScreen].x() - screens[curScreen].x(), - screens[nextScreen].y() - screens[curScreen].y()); - whichScreen = screens[nextScreen].center(); + if (nextScreen == curScreen) { + mode = QuickTileNone; // No other screens, toggle tiling + } else { + // Move to other screen + geom_restore.translate(screens[nextScreen].topLeft() - screens[curScreen].topLeft()); + whichScreen = screens[nextScreen].center(); - // Swap sides - if (mode == QuickTileLeft) - mode = QuickTileRight; - else - mode = QuickTileLeft; - } else { + // Swap sides + mode = ~mode & QuickTileHorizontal; + } + setElectricBorderMode(mode); // used by ::electricBorderMaximizeGeometry(.) + } else if (quick_tile_mode == QuickTileNone) { // Not coming out of an existing tile, not shifting monitors, we're setting a brand new tile. // Store geometry first, so we can go out of this tile later. geom_restore = geometry(); @@ -3266,6 +3255,19 @@ void Client::setQuickTileMode(QuickTileMode mode, bool keyboard) // Store the mode change quick_tile_mode = mode; } + + if (mode == QuickTileNone) { + TabSynchronizer syncer(this, TabGroup::QuickTile|TabGroup::Geometry); + + quick_tile_mode = QuickTileNone; + // Untiling, so just restore geometry, and we're done. + if (!geom_restore.isValid()) // invalid if we started maximized and wait for placement + geom_restore = geometry(); + // decorations may turn off some borders when tiled + const ForceGeometry_t geom_mode = decoration && checkBorderSizes(false) ? ForceGeometrySet : NormalGeometrySet; + setGeometry(geom_restore, geom_mode); + checkWorkspacePosition(); // Just in case it's a different screen + } } } // namespace From c378bf4f7cdd496c1526eb5f3d97bcedd7b5890a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thomas=20L=C3=BCbking?= Date: Sun, 17 Nov 2013 21:45:21 +0100 Subject: [PATCH 3/8] emit desktopPresenceChanged from Client:setDesktop and forward it to scripted effects CCBUG: 326903 REVIEW: 114080 --- client.cpp | 3 +++ client.h | 1 + effects.cpp | 6 ++++++ effects.h | 1 + libkwineffects/kwineffects.h | 9 +++++++++ workspace.cpp | 3 +-- 6 files changed, 21 insertions(+), 2 deletions(-) diff --git a/client.cpp b/client.cpp index 4b88f22a24..b576353ac7 100644 --- a/client.cpp +++ b/client.cpp @@ -1457,6 +1457,7 @@ void Client::setDesktop(int desktop) return; int was_desk = desk; + const bool wasOnCurrentDesktop = isOnCurrentDesktop(); desk = desktop; info->setDesktop(desktop); if ((was_desk == NET::OnAllDesktops) != (desktop == NET::OnAllDesktops)) { @@ -1486,6 +1487,8 @@ void Client::setDesktop(int desktop) if (tabGroup()) tabGroup()->updateStates(this, TabGroup::Desktop); emit desktopChanged(); + if (wasOnCurrentDesktop != isOnCurrentDesktop()) + emit desktopPresenceChanged(this, was_desk); } /** diff --git a/client.h b/client.h index a2b3365e3d..064e82fb9e 100644 --- a/client.h +++ b/client.h @@ -719,6 +719,7 @@ signals: void activeChanged(); void captionChanged(); void desktopChanged(); + void desktopPresenceChanged(KWin::Client*, int); // to be forwarded by Workspace void fullScreenChanged(); void transientChanged(); void modalChanged(); diff --git a/effects.cpp b/effects.cpp index 087eef8f79..1df757df4d 100644 --- a/effects.cpp +++ b/effects.cpp @@ -228,6 +228,7 @@ EffectsHandlerImpl::EffectsHandlerImpl(Compositor *compositor, Scene *scene) Workspace *ws = Workspace::self(); VirtualDesktopManager *vds = VirtualDesktopManager::self(); connect(ws, SIGNAL(currentDesktopChanged(int,KWin::Client*)), SLOT(slotDesktopChanged(int,KWin::Client*))); + connect(ws, SIGNAL(desktopPresenceChanged(KWin::Client*,int)), SLOT(slotDesktopPresenceChanged(KWin::Client*,int))); connect(ws, SIGNAL(clientAdded(KWin::Client*)), this, SLOT(slotClientAdded(KWin::Client*))); connect(ws, SIGNAL(unmanagedAdded(KWin::Unmanaged*)), this, SLOT(slotUnmanagedAdded(KWin::Unmanaged*))); connect(ws, SIGNAL(clientActivated(KWin::Client*)), this, SLOT(slotClientActivated(KWin::Client*))); @@ -642,6 +643,11 @@ void EffectsHandlerImpl::slotDesktopChanged(int old, Client *c) } } +void EffectsHandlerImpl::slotDesktopPresenceChanged(Client *c, int old) +{ + emit desktopPresenceChanged(c->effectWindow(), old, c->desktop()); +} + void EffectsHandlerImpl::slotWindowDamaged(Toplevel* t, const QRect& r) { if (!t->effectWindow()) { diff --git a/effects.h b/effects.h index 43f2c14642..b02dc839a0 100644 --- a/effects.h +++ b/effects.h @@ -214,6 +214,7 @@ public Q_SLOTS: protected Q_SLOTS: void slotDesktopChanged(int old, KWin::Client *withClient); + void slotDesktopPresenceChanged(KWin::Client *c, int old); void slotClientAdded(KWin::Client *c); void slotClientShown(KWin::Toplevel*); void slotUnmanagedAdded(KWin::Unmanaged *u); diff --git a/libkwineffects/kwineffects.h b/libkwineffects/kwineffects.h index 62b0a4f0c3..9a03eeb335 100644 --- a/libkwineffects/kwineffects.h +++ b/libkwineffects/kwineffects.h @@ -947,6 +947,15 @@ Q_SIGNALS: * @deprecated */ void desktopChanged(int oldDesktop, int newDesktop); + /** + * Signal emitted when a window moved to another desktop + * NOTICE that this does NOT imply that the desktop has changed + * The @param window which is moved to the new desktop + * @param oldDesktop The previous desktop of the window + * @param newDesktop The new desktop of the window + * @since 4.11.4 + */ + void desktopPresenceChanged(KWin::EffectWindow *window, int oldDesktop, int newDesktop); /** * Signal emitted when the number of currently existing desktops is changed. * @param old The previous number of desktops in used. diff --git a/workspace.cpp b/workspace.cpp index 8235aaa48a..e7f103f99c 100644 --- a/workspace.cpp +++ b/workspace.cpp @@ -471,6 +471,7 @@ Client* Workspace::createClient(xcb_window_t w, bool is_mapped) #ifdef KWIN_BUILD_SCREENEDGES connect(c, SIGNAL(clientFullScreenSet(KWin::Client*,bool,bool)), ScreenEdges::self(), SIGNAL(checkBlocking())); #endif + connect(c, SIGNAL(desktopPresenceChanged(KWin::Client*,int)), SIGNAL(desktopPresenceChanged(KWin::Client*,int)), Qt::QueuedConnection); if (!c->manage(w, is_mapped)) { Client::deleteClient(c); return NULL; @@ -1166,8 +1167,6 @@ void Workspace::sendClientToDesktop(Client* c, int desk, bool dont_activate) return; desk = c->desktop(); // Client did range checking - emit desktopPresenceChanged(c, old_desktop); - if (c->isOnDesktop(VirtualDesktopManager::self()->current())) { if (c->wantsTabFocus() && options->focusPolicyIsReasonable() && !was_on_desktop && // for stickyness changes From fac85516ad6035f5b1a906de6d8828e1e4cee6e7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thomas=20L=C3=BCbking?= Date: Sun, 17 Nov 2013 21:43:38 +0100 Subject: [PATCH 4/8] bind desktopPresenceChanged in scripted effects translucency and dialogparent BUG: 326903 FIXED-IN: 4.11.6 REVIEW: 114083 --- effects/dialogparent/package/contents/code/main.js | 4 +++- effects/translucency/package/contents/code/main.js | 2 ++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/effects/dialogparent/package/contents/code/main.js b/effects/dialogparent/package/contents/code/main.js index 52ee202631..d42c7b3ec5 100644 --- a/effects/dialogparent/package/contents/code/main.js +++ b/effects/dialogparent/package/contents/code/main.js @@ -104,7 +104,7 @@ var dialogParentEffect = { windows = effects.stackingOrder; for (i = 0; i < windows.length; i += 1) { window = windows[i]; - dialogParentEffect.cancelAnimation(window); + dialogParentEffect.cancelAnimation(window); dialogParentEffect.restartAnimation(window); } }, @@ -131,6 +131,8 @@ var dialogParentEffect = { effects.windowUnminimized.connect(dialogParentEffect.restartAnimation); effects.windowModalityChanged.connect(dialogParentEffect.modalDialogChanged) effects['desktopChanged(int,int)'].connect(dialogParentEffect.desktopChanged); + effects.desktopPresenceChanged.connect(dialogParentEffect.cancelAnimation); + effects.desktopPresenceChanged.connect(dialogParentEffect.restartAnimation); // start animation windows = effects.stackingOrder; diff --git a/effects/translucency/package/contents/code/main.js b/effects/translucency/package/contents/code/main.js index ed763b4276..27ccbe3433 100644 --- a/effects/translucency/package/contents/code/main.js +++ b/effects/translucency/package/contents/code/main.js @@ -239,6 +239,8 @@ var translucencyEffect = { init: function () { "use strict"; effect.configChanged.connect(translucencyEffect.loadConfig); + effects.desktopPresenceChanged.connect(translucencyEffect.cancelAnimations); + effects.desktopPresenceChanged.connect(translucencyEffect.startAnimation); effects.windowAdded.connect(translucencyEffect.startAnimation); effects.windowUnminimized.connect(translucencyEffect.startAnimation); effects.windowClosed.connect(translucencyEffect.cancelAnimations); From c4d014eb8cfd29d479168d417e3564b6972fb7ea Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thomas=20L=C3=BCbking?= Date: Mon, 25 Nov 2013 23:45:31 +0100 Subject: [PATCH 5/8] do not ask the deco for borders on every move REVIEW: 114126 --- geometry.cpp | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/geometry.cpp b/geometry.cpp index e0d0aebdac..d090a57956 100644 --- a/geometry.cpp +++ b/geometry.cpp @@ -2807,11 +2807,7 @@ void Client::handleMoveResize(int x, int y, int x_root, int y_root) // When doing a restricted move we must always keep 100px of the titlebar // visible to allow the user to be able to move it again. - int frameLeft, frameRight, frameTop, frameBottom; - if (decoration) - decoration->borders(frameLeft, frameRight, frameTop, frameBottom); - else - frameTop = 10; + const int frameTop = border_top; int titlebarArea = qMin(frameTop * 100, moveResizeGeom.width() * moveResizeGeom.height()); bool update = false; From 3d389961ffc6ad7dec481288a9e22e690b87106f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thomas=20L=C3=BCbking?= Date: Sun, 17 Nov 2013 17:37:46 +0100 Subject: [PATCH 6/8] preserve offsets when sending client to screen for that purpose, move sendToScreen and updateLayer functions from Workspace to Client, keep wrappers BUG: 327361 FIXED-IN: 4.11.6 REVIEW: 114078 --- client.h | 3 +++ geometry.cpp | 63 +++++++++++++++++++++++++++++++++++++++++++++++++++ layers.cpp | 23 +++++++++++-------- workspace.cpp | 36 +---------------------------- 4 files changed, 80 insertions(+), 45 deletions(-) diff --git a/client.h b/client.h index 064e82fb9e..c9236993c1 100644 --- a/client.h +++ b/client.h @@ -346,6 +346,8 @@ public: void setDesktop(int); void setOnAllDesktops(bool set); + void sendToScreen(int screen); + virtual QStringList activities() const; void setOnActivity(const QString &activity, bool enable); void setOnAllActivities(bool set); @@ -405,6 +407,7 @@ public: virtual Layer layer() const; Layer belongsToLayer() const; void invalidateLayer(); + void updateLayer(); int sessionStackingOrder() const; void setModal(bool modal); diff --git a/geometry.cpp b/geometry.cpp index d090a57956..aa1c99ddf6 100644 --- a/geometry.cpp +++ b/geometry.cpp @@ -3266,4 +3266,67 @@ void Client::setQuickTileMode(QuickTileMode mode, bool keyboard) } } +void Client::sendToScreen(int newScreen) +{ + newScreen = rules()->checkScreen(newScreen); + if (isActive()) { + screens()->setCurrent(newScreen); + // might impact the layer of a fullscreen window + foreach (Client *cc, workspace()->clientList()) { + if (cc->isFullScreen() && cc->screen() == newScreen) { + cc->updateLayer(); + } + } + } + if (screen() == newScreen) // Don't use isOnScreen(), that's true even when only partially + return; + + GeometryUpdatesBlocker blocker(this); + + // operating on the maximized / quicktiled window would leave the old geom_restore behind, + // so we clear the state first + MaximizeMode maxMode = maximizeMode(); + QuickTileMode qtMode = (QuickTileMode)quick_tile_mode; + maximize(MaximizeRestore); + setQuickTileMode(QuickTileNone); + + QRect oldScreenArea = workspace()->clientArea(MaximizeArea, this); + QRect screenArea = workspace()->clientArea(MaximizeArea, newScreen, desktop()); + QRect oldGeom = geometry(); + QRect newGeom = oldGeom; + // move the window to have the same relative position to the center of the screen + // (i.e. one near the middle of the right edge will also end up near the middle of the right edge) + QPoint center = newGeom.center() - oldScreenArea.center(); + center.setX(center.x() * screenArea.width() / oldScreenArea.width()); + center.setY(center.y() * screenArea.height() / oldScreenArea.height()); + center += screenArea.center(); + newGeom.moveCenter(center); + setGeometry(newGeom); + // align geom_restore - checkWorkspacePosition operates on it + geom_restore = newGeom; + + // If the window was inside the old screen area, explicitly make sure its inside also the new screen area. + // Calling checkWorkspacePosition() should ensure that, but when moving to a small screen the window could + // be big enough to overlap outside of the new screen area, making struts from other screens come into effect, + // which could alter the resulting geometry. + if (oldScreenArea.contains(oldGeom)) + keepInArea(screenArea); + checkWorkspacePosition(oldGeom); + + // re-align geom_restore to contrained geometry + geom_restore = geometry(); + + // finally reset special states + // NOTICE that MaximizeRestore/QuickTileNone checks are required. + // eg. setting QuickTileNone would break maximization + if (maxMode != MaximizeRestore) + maximize(maxMode); + if (qtMode != QuickTileNone) + setQuickTileMode(qtMode); + + ClientList tso = workspace()->ensureStackingOrder(transients()); + for (ClientList::ConstIterator it = tso.constBegin(), end = tso.constEnd(); it != end; ++it) + (*it)->sendToScreen(newScreen); +} + } // namespace diff --git a/layers.cpp b/layers.cpp index 9ac899274c..ed373b89ac 100644 --- a/layers.cpp +++ b/layers.cpp @@ -103,16 +103,8 @@ namespace KWin void Workspace::updateClientLayer(Client* c) { - if (c == NULL) - return; - if (c->layer() == c->belongsToLayer()) - return; - StackingUpdatesBlocker blocker(this); - c->invalidateLayer(); // invalidate, will be updated when doing restacking - for (ClientList::ConstIterator it = c->transients().constBegin(); - it != c->transients().constEnd(); - ++it) - updateClientLayer(*it); + if (c) + c->updateLayer(); } void Workspace::updateStackingOrder(bool propagate_new_clients) @@ -851,6 +843,17 @@ Layer Client::belongsToLayer() const return NormalLayer; } +void Client::updateLayer() +{ + if (layer() == belongsToLayer()) + return; + StackingUpdatesBlocker blocker(workspace()); + invalidateLayer(); // invalidate, will be updated when doing restacking + for (ClientList::ConstIterator it = transients().constBegin(), + end = transients().constEnd(); it != end; ++it) + (*it)->updateLayer(); +} + bool rec_checkTransientOnTop(const ClientList &transients, const Client *topmost) { foreach (const Client *transient, transients) { diff --git a/workspace.cpp b/workspace.cpp index e7f103f99c..82a7567c96 100644 --- a/workspace.cpp +++ b/workspace.cpp @@ -1217,41 +1217,7 @@ bool Workspace::isOnCurrentHead() void Workspace::sendClientToScreen(Client* c, int screen) { - screen = c->rules()->checkScreen(screen); - if (c->isActive()) { - screens()->setCurrent(screen); - // might impact the layer of a fullscreen window - foreach (Client *cc, clientList()) { - if (cc->isFullScreen() && cc->screen() == screen) { - updateClientLayer(cc); - } - } - } - if (c->screen() == screen) // Don't use isOnScreen(), that's true even when only partially - return; - GeometryUpdatesBlocker blocker(c); - QRect old_sarea = clientArea(MaximizeArea, c); - QRect sarea = clientArea(MaximizeArea, screen, c->desktop()); - QRect oldgeom = c->geometry(); - QRect geom = c->geometry(); - // move the window to have the same relative position to the center of the screen - // (i.e. one near the middle of the right edge will also end up near the middle of the right edge) - geom.moveCenter( - QPoint(( geom.center().x() - old_sarea.center().x()) * sarea.width() / old_sarea.width() + sarea.center().x(), - ( geom.center().y() - old_sarea.center().y()) * sarea.height() / old_sarea.height() + sarea.center().y())); - c->setGeometry( geom ); - // If the window was inside the old screen area, explicitly make sure its inside also the new screen area. - // Calling checkWorkspacePosition() should ensure that, but when moving to a small screen the window could - // be big enough to overlap outside of the new screen area, making struts from other screens come into effect, - // which could alter the resulting geometry. - if( old_sarea.contains( oldgeom )) - c->keepInArea( sarea ); - c->checkWorkspacePosition( oldgeom ); - ClientList transients_stacking_order = ensureStackingOrder(c->transients()); - for (ClientList::ConstIterator it = transients_stacking_order.constBegin(); - it != transients_stacking_order.constEnd(); - ++it) - sendClientToScreen(*it, screen); + c->sendToScreen(screen); } void Workspace::sendPingToWindow(xcb_window_t window, xcb_timestamp_t timestamp) From 2ee0f27d43a1b2bfa0eacae6cc234f1a8e533528 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thomas=20L=C3=BCbking?= Date: Mon, 23 Dec 2013 02:36:34 +0100 Subject: [PATCH 7/8] fix laptop deco painting REVIEW: 114511 BUG: 329326 FIXED-IN: 4.11.6 --- clients/laptop/laptopclient.cpp | 77 +++++++++++++++++++-------------- 1 file changed, 44 insertions(+), 33 deletions(-) diff --git a/clients/laptop/laptopclient.cpp b/clients/laptop/laptopclient.cpp index 6462bd7cbe..1b03865c73 100644 --- a/clients/laptop/laptopclient.cpp +++ b/clients/laptop/laptopclient.cpp @@ -495,59 +495,75 @@ void LaptopClient::paintEvent( QPaintEvent* ) QPalette g = options()->palette(KDecoration::ColorFrame, isActive()); g.setCurrentColorGroup( QPalette::Active ); + const int borderBottom = layoutMetric(LM_BorderBottom); + const int borderLeft = layoutMetric(LM_BorderLeft); + const int titleEdgeTop = layoutMetric(LM_TitleEdgeTop); + QRect r(widget()->rect()); - p.setPen(Qt::black); - p.drawRect(r.adjusted(0, 0, -1, -1)); // fill mid frame... p.setPen(g.background().color()); + p.drawRect(r.adjusted(0,0,-1,-1)); p.drawLine(r.x()+2, r.y()+2, r.right()-2, r.y()+2); - p.drawLine(r.left()+2, r.y()+3, r.left()+2, r.bottom()-layoutMetric(LM_BorderBottom)+1); - p.drawLine(r.right()-2, r.y()+3, r.right()-2, r.bottom()-layoutMetric(LM_BorderBottom)+1); + const int boff = borderBottom ? borderBottom - 1 : 1; + p.drawLine(r.left()+2, r.y()+3, r.left()+2, r.bottom() - boff); + p.drawLine(r.right()-2, r.y()+3, r.right()-2, r.bottom() - boff); p.drawLine(r.left()+3, r.y()+3, r.left()+3, r.y()+layoutMetric(LM_TitleEdgeTop)+layoutMetric(LM_TitleHeight)+layoutMetric(LM_TitleEdgeTop) ); p.drawLine(r.right()-3, r.y()+3, r.right()-3, r.y()+layoutMetric(LM_TitleEdgeTop)+layoutMetric(LM_TitleHeight)+layoutMetric(LM_TitleEdgeTop) ); - if (!mustDrawHandle() ) + if (borderBottom) p.drawLine(r.left()+1, r.bottom()-2, r.right()-1, r.bottom()-2); // outer frame - p.setPen(g.color(QPalette::Light)); + if (borderBottom) + p.setPen(g.color(QPalette::Light)); p.drawLine(r.x()+1, r.y()+1, r.right()-1, r.y()+1); p.drawLine(r.x()+1, r.y()+1, r.x()+1, r.bottom()-1); - p.setPen(g.dark().color()); + if (borderBottom) + p.setPen(g.dark().color()); p.drawLine(r.right()-1, r.y()+1, r.right()-1, r.bottom()-1); p.drawLine(r.x()+1, r.bottom()-1, r.right()-1, r.bottom()-1); int th = titleHeight; int bb = handleSize + 2; // Bottom border int bs = handleSize - 2; // inner size of bottom border + int tb = layoutMetric(LM_TitleEdgeTop, false, NULL); // top border + int sb = layoutMetric(LM_BorderRight, false, NULL) - 1; // side border if (!mustDrawHandle()) { - bb = 6; - bs = 0; + bb = borderBottom + 2; + bs = 0; } if ( isToolWindow() ) - th -= 2; + th -= 2; // inner rect - p.drawRect(r.x() + 3, r.y() + th + 3, r.width() - 7, r.height() - th - bb - 1); + p.drawRect(r.x() + sb, r.y() + th + tb, r.width() - (2*sb + 1), r.height() - (th + bb + 1)); + + p.setPen(Qt::black); + if (titleEdgeTop) + p.drawLine(r.topLeft(), r.topRight()); + if (borderBottom) + p.drawLine(r.bottomLeft(), r.bottomRight()); + if (borderLeft) { + p.drawLine(r.topLeft(), r.bottomLeft()); + p.drawLine(r.topRight(), r.bottomRight()); + } // handles if (mustDrawHandle()) { - if (r.width() > 3*handleSize + 20) { - int range = 8 + 3*handleSize/2; - qDrawShadePanel(&p, r.x() + 1, r.bottom() - bs, range, + if (r.width() > 3*handleSize + 20) { + int range = 8 + 3*handleSize/2; + qDrawShadePanel(&p, r.x() + 1, r.bottom() - bs, range, handleSize - 2, g, false, 1, &g.brush(QPalette::Mid)); - qDrawShadePanel(&p, r.x() + range + 1, r.bottom() - bs, - r.width() - 2*range - 2, handleSize - 2, g, false, 1, - isActive() ? &g.brush(QPalette::Background) : - &g.brush(QPalette::Mid)); - qDrawShadePanel(&p, r.right() - range, r.bottom() - bs, - range, bs, g, false, 1, &g.brush(QPalette::Mid)); - } else { - qDrawShadePanel(&p, r.x() + 1, r.bottom() - bs, - r.width() - 2, bs, g, false, 1, - isActive() ? &g.brush(QPalette::Background) : - &g.brush(QPalette::Mid)); - } + qDrawShadePanel(&p, r.x() + range + 1, r.bottom() - bs, + r.width() - 2*range - 2, handleSize - 2, g, false, 1, + isActive() ? &g.brush(QPalette::Background) : &g.brush(QPalette::Mid)); + qDrawShadePanel(&p, r.right() - range, r.bottom() - bs, + range, bs, g, false, 1, &g.brush(QPalette::Mid)); + } else { + qDrawShadePanel(&p, r.x() + 1, r.bottom() - bs, + r.width() - 2, bs, g, false, 1, + isActive() ? &g.brush(QPalette::Background) : &g.brush(QPalette::Mid)); + } } r = titleRect(); @@ -621,12 +637,7 @@ QRegion LaptopClient::cornerShape(WindowCorner corner) bool LaptopClient::mustDrawHandle() const { - bool drawSmallBorders = !options()->moveResizeMaximizedWindows(); - if (drawSmallBorders && (maximizeMode() & MaximizeVertical)) { - return false; - } else { - return isResizable(); - } + return isResizable() && !(maximizeMode() & MaximizeVertical); } void LaptopClient::updateActiveBuffer( ) @@ -635,7 +646,7 @@ void LaptopClient::updateActiveBuffer( ) if( !bufferDirty && (lastBufferWidth == rTitle.width())) return; if ( rTitle.width() <= 0 || rTitle.height() <= 0 ) - return; + return; lastBufferWidth = rTitle.width(); bufferDirty = false; From 9de60604c08499fc6eb7ccf368e48d703ee47ee1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thomas=20L=C3=BCbking?= Date: Tue, 14 Jan 2014 01:31:49 +0100 Subject: [PATCH 8/8] properly reset quick_tile_mode on MaxRestore BUG: 329864 FIXED-IN: 4.11.6 --- geometry.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/geometry.cpp b/geometry.cpp index aa1c99ddf6..13b157d21e 100644 --- a/geometry.cpp +++ b/geometry.cpp @@ -2347,6 +2347,7 @@ void Client::changeMaximize(bool vertical, bool horizontal, bool adjust) if (!clientArea.contains(geom_restore.center())) // Not restoring to the same screen Placement::self()->place(this, clientArea); info->setState(0, NET::Max); + quick_tile_mode = QuickTileNone; break; }