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:
parent
e9405ea15e
commit
5106ca9291
@ -1397,22 +1397,8 @@ var WindowManager = class {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
_hasAttachedDialogs(window, ignoreWindow) {
|
_checkDimming(window) {
|
||||||
var count = 0;
|
const shouldDim = window.has_attached_dialogs();
|
||||||
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);
|
|
||||||
|
|
||||||
if (shouldDim && !window._dimmed) {
|
if (shouldDim && !window._dimmed) {
|
||||||
window._dimmed = true;
|
window._dimmed = true;
|
||||||
@ -1558,7 +1544,7 @@ var WindowManager = class {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (window.is_attached_dialog())
|
if (window.is_attached_dialog())
|
||||||
this._checkDimming(window.get_transient_for(), window);
|
this._checkDimming(window.get_transient_for());
|
||||||
|
|
||||||
let types = [Meta.WindowType.NORMAL,
|
let types = [Meta.WindowType.NORMAL,
|
||||||
Meta.WindowType.DIALOG,
|
Meta.WindowType.DIALOG,
|
||||||
|
Loading…
Reference in New Issue
Block a user