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

List:       kde-commits
Subject:    [plasma-workspace] libtaskmanager: Fix utility windows not being removed from task tree after demand
From:       Eike Hein <hein () kde ! org>
Date:       2015-09-30 23:03:23
Message-ID: E1ZhQPD-0005vi-6Q () scm ! kde ! org
[Download RAW message or body]

Git commit c34550cf4a7e93a5e14e882b01f7ab0cb24936ec by Eike Hein.
Committed on 30/09/2015 at 23:03.
Pushed by hein into branch 'master'.

Fix utility windows not being removed from task tree after demands-attention state is cleared.

Utilility windows are typically omitted from the task tree, unless they
are in demands-attention state. SVN r901886 (cf. bug 178509 from 2008)
introduced a bug by preventing tasks included in this fashion from
reaching active state, causing the demands-attention state not to ever
be cleared. Additionally, a separate bug prevented utility windows
losing demands-attention state from being removed from the task tree
thereafter. This patch fixes both.

This cropped up with recent versions of The Gimp, which curiously
sets its utility windows to demand attention when opened from within
the app. Since windows demanding attention are also implicitly exemped
from grouping, this appeared to users as a failure of the grouping
logic.

BUG:352477
CCBUG:178509

M  +6    -4    libtaskmanager/groupmanager.cpp
M  +1    -1    libtaskmanager/taskmanager.cpp

http://commits.kde.org/plasma-workspace/c34550cf4a7e93a5e14e882b01f7ab0cb24936ec

diff --git a/libtaskmanager/groupmanager.cpp b/libtaskmanager/groupmanager.cpp
index 1a2b22c..fb2c28d 100644
--- a/libtaskmanager/groupmanager.cpp
+++ b/libtaskmanager/groupmanager.cpp
@@ -640,10 +640,12 @@ void GroupManagerPrivate::taskChanged(::TaskManager::Task *task, ::TaskManager::
     }
 
     if (changes & ::TaskManager::AttentionChanged) {
-        // we show tasks anyway if they demand attention
-        // so whenever our state changes ... try to re-adjust it
-        takeAction = true;
-        show = true;
+        if (task->demandsAttention()) {
+            takeAction = true;
+            show = true;
+        } else if (task->info().windowType(NET::UtilityMask) == NET::Utility) {
+            removeTask(task);
+        }
     }
 
     // Some apps, eg. LibreOffice, change classClass/className after start-up...
diff --git a/libtaskmanager/taskmanager.cpp b/libtaskmanager/taskmanager.cpp
index 3418e49..4396401 100644
--- a/libtaskmanager/taskmanager.cpp
+++ b/libtaskmanager/taskmanager.cpp
@@ -396,7 +396,7 @@ void TaskManager::activeWindowChanged(WId w)
         }
         //qDebug() << "no active window";
     } else {
-        if (t->info().windowType(NET::UtilityMask) == NET::Utility) {
+        if (t->info().windowType(NET::UtilityMask) == NET::Utility && !t->demandsAttention()) {
             // we don't want to mark utility windows as active since task managers
             // actually care about the main window and skip utility windows; utility
             // windows are hidden when their associated window loses focus anyways
[prev in list] [next in list] [prev in thread] [next in thread] 

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