GNOME Bugzilla – Bug 602532
Overview should switch to confirm dialogs when closing
Last modified: 2009-11-21 23:22:17 UTC
Some apps show a confirm dialog before closing but currently the close button in the overview does not interact well with it. It should zoom to the window and let the user confirm or deny the close action (the user clicked on close so he does care what the application has to say).
Created attachment 148211 [details] [review] Patch which should work in most cases This patch should work in most cases, at least for well behaving apps. It is based on the assumption that confirmation dialogs are transient for the main window, which hopefully is good enough.
Review of attachment 148211 [details] [review]: Looks fine to me, and seems to work just fine. Yeah I agree that we can assume that confirm dialogs are transient (I can't think of an app that does not do that).
Review of attachment 148211 [details] [review]: ::: js/ui/workspaces.js @@ +428,3 @@ + let ws = metaWindow.get_workspace(); + let metaWindow = this._windowClone.metaWindow; + _closeWindow: function(actor, event) { We need to be careful about say the user closing the overview somehow while your signal handlers are active. You should this._windowClone.connect('destroy', Lang.bind(this, this._onDestroy)); _onDestroy: function () { if (this._windowAddedId > 0) { this._workspace.disconnect(this._windowAddedId); } if (this._windowRemovedId > 0) { this._workspace.disconnect(this._windowRemoveId); } } @@ +437,3 @@ + let ws = metaWindow.get_workspace(); + let metaWindow = this._windowClone.metaWindow; + _closeWindow: function(actor, event) { Set windowAddedId to 0 here. @@ +451,3 @@ + if (win == metaWindow) { + workspace.disconnect(this._windowRemovedId); + workspace.disconnect(this._windowAddedId); And both to 0 here.
Created attachment 148249 [details] [review] [overview] Switch to confirm dialog when closing Some applications show a confirm dialog before closing, which the close button happily ignores. Detect newly created windows which are transient for the window we try to close and switch to them.
Created attachment 148250 [details] [review] [overview] Switch to confirm dialog when closing Some applications show a confirm dialog before closing, which the close button happily ignores. Detect newly created windows which are transient for the window we try to close and switch to them.
Review of attachment 148249 [details] [review]: Looks good!
Thanks :)