From 5106ca929118ef2e981b030338cde225ad008dd8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Florian=20M=C3=BCllner?= Date: Tue, 30 Nov 2021 18:31:19 +0100 Subject: [PATCH] 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: --- js/ui/windowManager.js | 20 +++----------------- 1 file changed, 3 insertions(+), 17 deletions(-) diff --git a/js/ui/windowManager.js b/js/ui/windowManager.js index 72cadd9ac..d3c4d2655 100644 --- a/js/ui/windowManager.js +++ b/js/ui/windowManager.js @@ -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,