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
wilder-5.14
Eike Hein 11 years ago
parent 5dc6cf4de3
commit c34550cf4a
  1. 10
      libtaskmanager/groupmanager.cpp
  2. 2
      libtaskmanager/taskmanager.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...

@ -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

Loading…
Cancel
Save