GNOME Bugzilla – Bug 629560
Destroy effect of modal windows is odd when the parent has gone away
Last modified: 2010-09-15 11:56:05 UTC
The shrink animation of (attached) modal dialogs looks odd if the parent window has been closed - the window now "rolls up" into empty space. To reproduce: 1. open gedit 2. type something 3. close gedit 4. select "Close without saving" in the modal popup I guess we just want to cancel the effect when the parent is destroyed.
Created attachment 170225 [details] [review] cancel Destroy effect of modal windows when the parent has gone away
Review of attachment 170225 [details] [review]: Works like advertised, but some style comments below: ::: js/ui/windowManager.js @@ +365,3 @@ + let signalId = parent.connect('unmanaged', Lang.bind(this, function () { + Tweener.removeTweens(actor); + this._destroyWindowDone(shellwm, actor, signalId); I think it is weird to pass the signal id around like this - can't you monkey patch the actor? Something along the lines of actor._parentDestroyId = parent.connect(...) @@ +385,3 @@ + _destroyWindowDone : function(shellwm, actor, signalId) { + if (actor && actor.get_window_type() == Meta.CompWindowType.MODAL_DIALOG) You removed the test for parent here? I would have expected something like let parent = actor.get_meta_window().get_transient_for(); if (parent) parent.disconnect(signalId); if (actor && actor.get_window_type() == Meta.CompWindowType.MODAL_DIALOG && parent) { // what you had before }
Created attachment 170317 [details] [review] cancel Destroy effect of modal windows when the parent has gone away > I think it is weird to pass the signal id around like this - can't you monkey > patch the actor? done > You removed the test for parent here? I remove this test at all (if effect was started need complete it) Also I remove _destroyWindowOverwrite (it doing same thing _destroyWindowDone).
Review of attachment 170317 [details] [review]: Code looks good, some nitpicking about the commit message: - cancel => Cancel (not sure about Destroy => destroy) - missing body, e.g. "Modal dialogs slide back into the titlebar of the parent window when destroyed. This looks weird if the parent window itself has been destroyed, so cancel the effect in this case." Good to commit with this change.