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
This commit is contained in:
parent
4fa8e2b59d
commit
a13af7fbcc
@ -239,7 +239,7 @@ WindowManager.prototype = {
|
|||||||
_hasAttachedDialogs: function(window, ignoreWindow) {
|
_hasAttachedDialogs: function(window, ignoreWindow) {
|
||||||
var count = 0;
|
var count = 0;
|
||||||
window.foreach_transient(function(win) {
|
window.foreach_transient(function(win) {
|
||||||
if (win != ignoreWindow && win.get_window_type() == Meta.WindowType.MODAL_DIALOG)
|
if (win != ignoreWindow && win.is_attached_dialog())
|
||||||
count++;
|
count++;
|
||||||
return false;
|
return false;
|
||||||
});
|
});
|
||||||
@ -247,7 +247,7 @@ WindowManager.prototype = {
|
|||||||
},
|
},
|
||||||
|
|
||||||
_checkDimming: function(window, ignoreWindow) {
|
_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) {
|
if (shouldDim && !window._dimmed) {
|
||||||
window._dimmed = true;
|
window._dimmed = true;
|
||||||
@ -309,9 +309,7 @@ WindowManager.prototype = {
|
|||||||
|
|
||||||
actor._windowType = type;
|
actor._windowType = type;
|
||||||
}));
|
}));
|
||||||
if (actor.meta_window.get_window_type() == Meta.WindowType.MODAL_DIALOG
|
if (actor.meta_window.is_attached_dialog()) {
|
||||||
&& Meta.prefs_get_attach_modal_dialogs()
|
|
||||||
&& actor.get_meta_window().get_transient_for()) {
|
|
||||||
this._checkDimming(actor.get_meta_window().get_transient_for());
|
this._checkDimming(actor.get_meta_window().get_transient_for());
|
||||||
if (this._shouldAnimate()) {
|
if (this._shouldAnimate()) {
|
||||||
actor.set_scale(1.0, 0.0);
|
actor.set_scale(1.0, 0.0);
|
||||||
@ -373,7 +371,6 @@ WindowManager.prototype = {
|
|||||||
|
|
||||||
_destroyWindow : function(shellwm, actor) {
|
_destroyWindow : function(shellwm, actor) {
|
||||||
let window = actor.meta_window;
|
let window = actor.meta_window;
|
||||||
let parent = window.get_transient_for();
|
|
||||||
if (actor._notifyWindowTypeSignalId) {
|
if (actor._notifyWindowTypeSignalId) {
|
||||||
window.disconnect(actor._notifyWindowTypeSignalId);
|
window.disconnect(actor._notifyWindowTypeSignalId);
|
||||||
actor._notifyWindowTypeSignalId = 0;
|
actor._notifyWindowTypeSignalId = 0;
|
||||||
@ -383,12 +380,14 @@ WindowManager.prototype = {
|
|||||||
return win != window;
|
return win != window;
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
while (window.get_window_type() == Meta.WindowType.MODAL_DIALOG
|
if (window.is_attached_dialog()) {
|
||||||
&& parent) {
|
let parent = window.get_transient_for();
|
||||||
this._checkDimming(parent, window);
|
this._checkDimming(parent, window);
|
||||||
if (!Meta.prefs_get_attach_modal_dialogs()
|
if (!this._shouldAnimate()) {
|
||||||
|| !this._shouldAnimate())
|
shellwm.completed_destroy(actor);
|
||||||
break;
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
actor.set_scale(1.0, 1.0);
|
actor.set_scale(1.0, 1.0);
|
||||||
actor.show();
|
actor.show();
|
||||||
this._destroying.push(actor);
|
this._destroying.push(actor);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user