summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEike Hein <[email protected]>2017-02-09 22:31:04 +0900
committerEike Hein <[email protected]>2017-02-16 22:30:25 +0900
commita261ff25a580759183d20725d9f37d9ba25365ee (patch)
tree1895b75cae4a43371cc9dc56fd46b9d9a859b37c
parent5e7cbdd445f6caf8fdf59ca7f098275cc160347d (diff)
Fix crash when invoking Present Windows with the group dialog open.
Summary: This fixes a regression from aeec4ae8 which unsets the taskManagerItem prop when the group dialog is shown to intentionally break window highlighting while the dialog is open. This patch instead fixes highlighting from the group dialog properly by including it in the highlight list. Also adds some extra crash guards. CCMAIL:[email protected] BUG:376205 BUG:376234 Reviewers: #plasma, anthonyfieroni Subscribers: plasma-devel Tags: #plasma Differential Revision: https://phabricator.kde.org/D4525
-rw-r--r--applets/taskmanager/package/contents/ui/Task.qml2
-rw-r--r--applets/taskmanager/package/contents/ui/main.qml3
-rw-r--r--applets/taskmanager/plugin/backend.cpp22
-rw-r--r--applets/taskmanager/plugin/backend.h6
4 files changed, 32 insertions, 1 deletions
diff --git a/applets/taskmanager/package/contents/ui/Task.qml b/applets/taskmanager/package/contents/ui/Task.qml
index aa4fe4f..331ba8b 100644
--- a/applets/taskmanager/package/contents/ui/Task.qml
+++ b/applets/taskmanager/package/contents/ui/Task.qml
@@ -152,6 +152,8 @@ MouseArea {
hideToolTipTemporarily();
}
}
+
+ backend.cancelHighlightWindows();
}
pressed = false;
diff --git a/applets/taskmanager/package/contents/ui/main.qml b/applets/taskmanager/package/contents/ui/main.qml
index 1fc61bb..4f7c233 100644
--- a/applets/taskmanager/package/contents/ui/main.qml
+++ b/applets/taskmanager/package/contents/ui/main.qml
@@ -187,8 +187,9 @@ Item {
TaskManagerApplet.Backend {
id: backend
- taskManagerItem: groupDialog.visible ? null : tasks
+ taskManagerItem: tasks
toolTipItem: toolTipDelegate
+ groupDialog: groupDialog
highlightWindows: plasmoid.configuration.highlightWindows
onAddLauncher: {
diff --git a/applets/taskmanager/plugin/backend.cpp b/applets/taskmanager/plugin/backend.cpp
index 6b94c12..1f2eb27 100644
--- a/applets/taskmanager/plugin/backend.cpp
+++ b/applets/taskmanager/plugin/backend.cpp
@@ -90,6 +90,20 @@ void Backend::setToolTipItem(QQuickItem *item)
}
}
+QQuickWindow *Backend::groupDialog() const
+{
+ return m_groupDialog;
+}
+
+void Backend::setGroupDialog(QQuickWindow *dialog)
+{
+ if (dialog != m_groupDialog) {
+ m_groupDialog = dialog;
+
+ emit groupDialogChanged();
+ }
+}
+
bool Backend::highlightWindows() const
{
return m_highlightWindows;
@@ -387,6 +401,10 @@ bool Backend::canPresentWindows() const
void Backend::presentWindows(const QVariant &_winIds)
{
+ if (!m_taskManagerItem || !m_taskManagerItem->window()) {
+ return;
+ }
+
QList<WId> winIds;
const QVariantList &_winIdsList = _winIds.toList();
@@ -490,5 +508,9 @@ void Backend::updateWindowHighlight()
windows.append(m_toolTipItem->window()->winId());
}
+ if (windows.count() && m_groupDialog) {
+ windows.append(m_groupDialog->winId());
+ }
+
KWindowEffects::highlightWindows(m_panelWinId, windows);
}
diff --git a/applets/taskmanager/plugin/backend.h b/applets/taskmanager/plugin/backend.h
index 369fb55..f2eaf6b 100644
--- a/applets/taskmanager/plugin/backend.h
+++ b/applets/taskmanager/plugin/backend.h
@@ -41,6 +41,7 @@ class Backend : public QObject
Q_PROPERTY(QQuickItem* taskManagerItem READ taskManagerItem WRITE setTaskManagerItem NOTIFY taskManagerItemChanged)
Q_PROPERTY(QQuickItem* toolTipItem READ toolTipItem WRITE setToolTipItem NOTIFY toolTipItemChanged)
+ Q_PROPERTY(QQuickWindow* groupDialog READ groupDialog WRITE setGroupDialog NOTIFY groupDialogChanged)
Q_PROPERTY(bool highlightWindows READ highlightWindows WRITE setHighlightWindows NOTIFY highlightWindowsChanged)
public:
@@ -62,6 +63,9 @@ class Backend : public QObject
QQuickItem *toolTipItem() const;
void setToolTipItem(QQuickItem *item);
+ QQuickWindow *groupDialog() const;
+ void setGroupDialog(QQuickWindow *dialog);
+
bool highlightWindows() const;
void setHighlightWindows(bool highlight);
@@ -89,6 +93,7 @@ class Backend : public QObject
Q_SIGNALS:
void taskManagerItemChanged() const;
void toolTipItemChanged() const;
+ void groupDialogChanged() const;
void highlightWindowsChanged() const;
void addLauncher(const QUrl &url) const;
@@ -104,6 +109,7 @@ class Backend : public QObject
QQuickItem *m_taskManagerItem;
QQuickItem *m_toolTipItem;
+ QQuickWindow *m_groupDialog;
WId m_panelWinId;
bool m_highlightWindows;
QList<WId> m_windowsToHighlight;