[prev in list] [next in list] [prev in thread] [next in thread]
List: kde-commits
Subject: branches/KDE/4.5/kdebase/workspace/plasma/desktop/shell
From: Aaron J. Seigo <aseigo () kde ! org>
Date: 2010-09-09 21:24:31
Message-ID: 20100909212431.7011DAC884 () svn ! kde ! org
[Download RAW message or body]
SVN commit 1173626 by aseigo:
* reinstate the hide-the-controller-when-its-our-own-graphicswidget-and-we-lose-appropriate-focus \
feature
* delete our own graphicswidgets if they are replaced with others
* remove an unused variable
BUG:250395
M +15 -10 controllerwindow.cpp
--- branches/KDE/4.5/kdebase/workspace/plasma/desktop/shell/controllerwindow.cpp \
#1173625:1173626 @@ -35,6 +35,7 @@
#include <Plasma/FrameSvg>
#include <Plasma/Dialog>
#include <Plasma/WindowEffects>
+#include <Plasma/View>
#include "widgetsexplorer/widgetexplorer.h"
#include "activitymanager/activitymanager.h"
@@ -157,7 +158,14 @@
{
if (m_graphicsWidget) {
m_graphicsWidget->removeEventFilter(this);
+ if (m_graphicsWidget == m_widgetExplorer) {
+ m_widgetExplorer->deleteLater();
+ m_widgetExplorer = 0;
+ } else if (m_graphicsWidget == m_activityManager) {
+ m_activityManager->deleteLater();
+ m_activityManager = 0;
}
+ }
m_graphicsWidget = widget;
@@ -208,8 +216,6 @@
int left, top, right, bottom;
getContentsMargins(&left, &top, &right, &bottom);
- QDesktopWidget *desktop = QApplication::desktop();
-
QRect screenRect;
//Try to use the screenId directly from the containment, because it won't \
fail.
//If we dont' have containment. try to get the screen by using \
QWidget::pos(), but it @@ -386,7 +392,6 @@
m_watchedWidget = m_widgetExplorer;
setGraphicsWidget(m_widgetExplorer);
}
-
}
void ControllerWindow::showActivityManager()
@@ -415,7 +420,6 @@
m_activityManager->show();
setGraphicsWidget(m_activityManager);
}
-
}
bool ControllerWindow::isControllerViewVisible() const
@@ -432,14 +436,15 @@
{
Q_UNUSED(id)
- //if the active window isn't the plasma desktop and the widgets explorer is \
visible,
- //then close the panel controller
- if (QApplication::activeWindow() == 0 || (QApplication::activeWindow()->winId() \
!= KWindowSystem::activeWindow())) {
- if (m_view && m_view->isVisible() && !isActiveWindow()) {
- //close();
+ // if the active window isn't a Plasma::View and the widgets explorer is \
visible, + // or the activityManager is visible, and we are no longer the active \
window but still + // visible on-screen, then close up shop
+ if ((m_activityManager ||
+ (m_widgetExplorer && !qobject_cast<Plasma::View \
*>(QApplication::activeWindow()))) && + isControllerViewVisible() && \
!isActiveWindow()) { + close();
}
}
-}
void ControllerWindow::paintEvent(QPaintEvent *event)
{
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic