[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-panel-devel
Subject:    Change in plasma-framework[master]: Set visibility on mainItem to match Dialog
From:       "David Edmundson (Code Review)" <noreply () kde ! org>
Date:       2014-12-28 19:37:39
Message-ID: gerrit.1419795458269.I92b969e60b4fdbe4ff2c70f9cce6e3408482a862 () gerrit ! vesnicky ! cesnet ! cz
[Download RAW message or body]

David Edmundson has uploaded a new change for review.

  https://gerrit.vesnicky.cesnet.cz/r/282

Change subject: Set visibility on mainItem to match Dialog
......................................................................

Set visibility on mainItem to match Dialog

Otherwise we can have an invisible dialog in which the items think they
are visible.

QtQuick is smart enough to not redraw anything if the window isn't
visible, but a lot of bits of our code check the visibility flag to
enable/disable animations. These animation timers do still trigger when
the window isn't visible which wastes CPU cycles.

We are already meddling with the visibility flag so this shouldn't have
too much impact.

Change-Id: I92b969e60b4fdbe4ff2c70f9cce6e3408482a862
---
M src/plasmaquick/dialog.cpp
1 file changed, 6 insertions(+), 1 deletion(-)


  git pull ssh://gerrit.vesnicky.cesnet.cz:29418/plasma-framework refs/changes/82/282/1

diff --git a/src/plasmaquick/dialog.cpp b/src/plasmaquick/dialog.cpp
index 1c07ab0..74c68a6 100644
--- a/src/plasmaquick/dialog.cpp
+++ b/src/plasmaquick/dialog.cpp
@@ -237,6 +237,10 @@
 
 void DialogPrivate::updateVisibility(bool visible)
 {
+    if (mainItem) {
+        mainItem->setVisible(visible);
+    }
+
     if (visible) {
         if (visualParent && visualParent->window()) {
             q->setTransientParent(visualParent->window());
@@ -268,6 +272,7 @@
             }
         }
     }
+
 
     if (!(q->flags() & Qt::ToolTip)) {
         KWindowEffects::SlideFromLocation slideLocation = KWindowEffects::NoEdge;
@@ -675,7 +680,7 @@
         d->mainItem = mainItem;
 
         if (mainItem) {
-            d->mainItem->setVisible(true);
+            d->mainItem->setVisible(isVisible());
             mainItem->setParentItem(contentItem());
 
             connect(mainItem, SIGNAL(widthChanged()), this, SLOT(slotMainItemSizeChanged()));

-- 
To view, visit https://gerrit.vesnicky.cesnet.cz/r/282
To unsubscribe, visit https://gerrit.vesnicky.cesnet.cz/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I92b969e60b4fdbe4ff2c70f9cce6e3408482a862
Gerrit-PatchSet: 1
Gerrit-Project: plasma-framework
Gerrit-Branch: master
Gerrit-Owner: David Edmundson <david@davidedmundson.co.uk>
Gerrit-Reviewer: Marco Martin <notmart@gmail.com>
_______________________________________________
Plasma-devel mailing list
Plasma-devel@kde.org
https://mail.kde.org/mailman/listinfo/plasma-devel
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic