workspace: Don't allow closing windows with attached modals

Modal dialogs prevent the parent from being closed in "normal mode",
so it makes sense to not allow it in the overview either.

https://bugzilla.gnome.org/show_bug.cgi?id=729886
This commit is contained in:
Florian Müllner 2014-05-08 11:21:34 +02:00
parent 2a63267be0
commit 3ff4277f86

View File

@ -200,6 +200,10 @@ const WindowClone = new Lang.Class({
this.emit('size-changed'); this.emit('size-changed');
}, },
hasAttachedDialogs: function() {
return this.actor.get_n_children() > 1;
},
_doAddAttachedDialog: function(metaWin, realWin) { _doAddAttachedDialog: function(metaWin, realWin) {
let clone = new Clutter.Clone({ source: realWin }); let clone = new Clutter.Clone({ source: realWin });
clone._updateId = metaWin.connect('size-changed', Lang.bind(this, function() { clone._updateId = metaWin.connect('size-changed', Lang.bind(this, function() {
@ -582,7 +586,8 @@ const WindowOverlay = new Lang.Class({
}, },
_windowCanClose: function() { _windowCanClose: function() {
return this._windowClone.metaWindow.can_close(); return this._windowClone.metaWindow.can_close() &&
!this._windowClone.hasAttachedDialogs();
}, },
_onWindowAdded: function(workspace, win) { _onWindowAdded: function(workspace, win) {