windowManager: Fix windows not getting undimmed in some cases

meta_window_foreach_transient() iterates through all transients of a
window, not only direct transients. This means that simply checking if
a transient is an attached dialog isn't enough because it might be a
non-direct transient for the window we're checking, in which case we
don't want to dim the window.

In particular this fixes windows not getting undimmed when they have
more that one level of transient children and the direct transient gets
destroyed. In that case we would still find at least one non-direct
transient child and decide to keep the window dimmed.

https://bugzilla.gnome.org/show_bug.cgi?id=770163
This commit is contained in:
Rui Matos 2016-08-22 16:56:41 +02:00
parent e6adcd99c7
commit dbd04df311

View File

@ -1349,9 +1349,13 @@ const WindowManager = new Lang.Class({
_hasAttachedDialogs: function(window, ignoreWindow) {
var count = 0;
window.foreach_transient(function(win) {
if (win != ignoreWindow && win.is_attached_dialog())
if (win != ignoreWindow &&
win.is_attached_dialog() &&
win.get_transient_for() == window) {
count++;
return false;
return false;
}
return true;
});
return count != 0;
},