From 805495c8ea8ec291f6d907663b1e645250cc8085 Mon Sep 17 00:00:00 2001 From: Ralf Jung Date: Fri, 26 Oct 2012 16:18:16 +0200 Subject: [PATCH 1/3] do not resume compositing when it's suspended and a client blocks it REVIEW: 106900 CCBUG: 308438 --- composite.cpp | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/composite.cpp b/composite.cpp index 6ed8289bd8..f862f72e03 100644 --- a/composite.cpp +++ b/composite.cpp @@ -304,7 +304,7 @@ void Workspace::updateCompositeBlocking(Client *c) if (c) { // if c == 0 we just check if we can resume if (c->isBlockingCompositing()) { if (!compositingBlocked) // do NOT attempt to call suspendCompositing(true); from within the eventchain! - QMetaObject::invokeMethod(this, "slotToggleCompositing", Qt::QueuedConnection); + QMetaObject::invokeMethod(this, "suspendCompositing", Qt::QueuedConnection, Q_ARG(bool, true)); compositingBlocked = true; } } @@ -320,8 +320,7 @@ void Workspace::updateCompositeBlocking(Client *c) } if (resume) { // do NOT attempt to call suspendCompositing(false); from within the eventchain! compositingBlocked = false; - if (compositingSuspended) - QMetaObject::invokeMethod(this, "slotToggleCompositing", Qt::QueuedConnection); + QMetaObject::invokeMethod(this, "suspendCompositing", Qt::QueuedConnection, Q_ARG(bool, false)); } } } @@ -333,6 +332,10 @@ void Workspace::suspendCompositing() void Workspace::suspendCompositing(bool suspend) { + if (compositingSuspended == suspend) { + // nothing actually changes + return; + } compositingSuspended = suspend; finishCompositing(); setupCompositing(); // will do nothing if suspended From d1a914d8fb3807f71d73f60e3f6c589abc4001ea Mon Sep 17 00:00:00 2001 From: Hugo Pereira Da Costa Date: Thu, 1 Nov 2012 19:09:09 +0100 Subject: [PATCH 2/3] oxygenlistmodel: Added "contains" method to generic model, to check index validity better. oxygenexceptionlistwidget: better check index validity in "edit" method. Also update buttons status after removing items, since apparently selectionChanged signal is not sent by Qt. CCBUG: 309388 --- clients/oxygen/config/oxygenexceptionlistwidget.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/clients/oxygen/config/oxygenexceptionlistwidget.cpp b/clients/oxygen/config/oxygenexceptionlistwidget.cpp index 474f2b2a4b..faefbc63c9 100644 --- a/clients/oxygen/config/oxygenexceptionlistwidget.cpp +++ b/clients/oxygen/config/oxygenexceptionlistwidget.cpp @@ -156,7 +156,7 @@ namespace Oxygen // retrieve selection QModelIndex current( ui.exceptionListView->selectionModel()->currentIndex() ); - if( !current.isValid() ) return; + if( ! model().contains( current ) ) return; Exception& exception( model().get( current ) ); @@ -203,6 +203,7 @@ namespace Oxygen // remove model().remove( model().get( ui.exceptionListView->selectionModel()->selectedRows() ) ); resizeColumns(); + updateButtons(); emit changed(); return; @@ -212,7 +213,7 @@ namespace Oxygen void ExceptionListWidget::toggle( const QModelIndex& index ) { - if( !index.isValid() ) return; + if( !model().contains( index ) ) return; if( index.column() != ExceptionModel::ENABLED ) return; // get matching exception From 01d4fcec00cb90a432260b75fcdb995ec1b1207c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thomas=20L=C3=BCbking?= Date: Sun, 21 Oct 2012 17:42:30 +0200 Subject: [PATCH 3/3] update deco borders on shade before aligning tabs BUG: 308633 FIXED-IN: 4.9.3 --- client.cpp | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/client.cpp b/client.cpp index 7b2f029be7..152095b752 100644 --- a/client.cpp +++ b/client.cpp @@ -1070,6 +1070,11 @@ void Client::setShade(ShadeMode mode) ShadeMode was_shade_mode = shade_mode; shade_mode = mode; + // Decorations may turn off some borders when shaded + // this has to happen _before_ the tab alignment since it will restrict the minimum geometry + if (decoration) + decoration->borders(border_left, border_right, border_top, border_bottom); + // Update states of all other windows in this group if (tabGroup()) tabGroup()->updateStates(this, TabGroup::Shaded); @@ -1090,9 +1095,6 @@ void Client::setShade(ShadeMode mode) assert(decoration != NULL); // noborder windows can't be shaded GeometryUpdatesBlocker blocker(this); - // Decorations may turn off some borders when shaded - if (decoration) - decoration->borders(border_left, border_right, border_top, border_bottom); // TODO: All this unmapping, resizing etc. feels too much duplicated from elsewhere if (isShade()) {