From a13af7fbccc91c71a390e7dbe8db267e755557a5 Mon Sep 17 00:00:00 2001 From: Dan Winship Date: Tue, 5 Apr 2011 10:16:50 -0400 Subject: [PATCH] windowManager: use meta_window_is_attached_dialog() Use meta_window_is_attached_dialog() so that we only dim/unfold dialog windows that mutter is actually showing as attached https://bugzilla.gnome.org/show_bug.cgi?id=646761 --- js/ui/windowManager.js | 21 ++++++++++----------- 1 file changed, 10 insertions(+), 11 deletions(-) diff --git a/js/ui/windowManager.js b/js/ui/windowManager.js index e9c11920e..16756ad1f 100644 --- a/js/ui/windowManager.js +++ b/js/ui/windowManager.js @@ -239,7 +239,7 @@ WindowManager.prototype = { _hasAttachedDialogs: function(window, ignoreWindow) { var count = 0; window.foreach_transient(function(win) { - if (win != ignoreWindow && win.get_window_type() == Meta.WindowType.MODAL_DIALOG) + if (win != ignoreWindow && win.is_attached_dialog()) count++; return false; }); @@ -247,7 +247,7 @@ WindowManager.prototype = { }, _checkDimming: function(window, ignoreWindow) { - let shouldDim = Meta.prefs_get_attach_modal_dialogs() && this._hasAttachedDialogs(window, ignoreWindow); + let shouldDim = this._hasAttachedDialogs(window, ignoreWindow); if (shouldDim && !window._dimmed) { window._dimmed = true; @@ -309,9 +309,7 @@ WindowManager.prototype = { actor._windowType = type; })); - if (actor.meta_window.get_window_type() == Meta.WindowType.MODAL_DIALOG - && Meta.prefs_get_attach_modal_dialogs() - && actor.get_meta_window().get_transient_for()) { + if (actor.meta_window.is_attached_dialog()) { this._checkDimming(actor.get_meta_window().get_transient_for()); if (this._shouldAnimate()) { actor.set_scale(1.0, 0.0); @@ -373,7 +371,6 @@ WindowManager.prototype = { _destroyWindow : function(shellwm, actor) { let window = actor.meta_window; - let parent = window.get_transient_for(); if (actor._notifyWindowTypeSignalId) { window.disconnect(actor._notifyWindowTypeSignalId); actor._notifyWindowTypeSignalId = 0; @@ -383,12 +380,14 @@ WindowManager.prototype = { return win != window; }); } - while (window.get_window_type() == Meta.WindowType.MODAL_DIALOG - && parent) { + if (window.is_attached_dialog()) { + let parent = window.get_transient_for(); this._checkDimming(parent, window); - if (!Meta.prefs_get_attach_modal_dialogs() - || !this._shouldAnimate()) - break; + if (!this._shouldAnimate()) { + shellwm.completed_destroy(actor); + return; + } + actor.set_scale(1.0, 1.0); actor.show(); this._destroying.push(actor);