windowManager: Use MetaWindow.has_attached_dialogs()

Now that MetaWindow itself exposes a method for checking for
attached dialogs, we can use that instead of our own helper
method.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/2054>
This commit is contained in:
Florian Müllner 2021-11-30 18:31:19 +01:00 committed by Marge Bot
parent e9405ea15e
commit 5106ca9291

View File

@ -1397,22 +1397,8 @@ var WindowManager = class {
}
}
_hasAttachedDialogs(window, ignoreWindow) {
var count = 0;
window.foreach_transient(win => {
if (win != ignoreWindow &&
win.is_attached_dialog() &&
win.get_transient_for() == window) {
count++;
return false;
}
return true;
});
return count != 0;
}
_checkDimming(window, ignoreWindow) {
let shouldDim = this._hasAttachedDialogs(window, ignoreWindow);
_checkDimming(window) {
const shouldDim = window.has_attached_dialogs();
if (shouldDim && !window._dimmed) {
window._dimmed = true;
@ -1558,7 +1544,7 @@ var WindowManager = class {
}
if (window.is_attached_dialog())
this._checkDimming(window.get_transient_for(), window);
this._checkDimming(window.get_transient_for());
let types = [Meta.WindowType.NORMAL,
Meta.WindowType.DIALOG,