After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 602532 - Overview should switch to confirm dialogs when closing
Overview should switch to confirm dialogs when closing
Status: RESOLVED FIXED
Product: gnome-shell
Classification: Core
Component: general
unspecified
Other Linux
: Normal normal
: ---
Assigned To: gnome-shell-maint
gnome-shell-maint
Depends on:
Blocks:
 
 
Reported: 2009-11-20 20:45 UTC by drago01
Modified: 2009-11-21 23:22 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Patch which should work in most cases (2.78 KB, patch)
2009-11-21 06:02 UTC, Florian Müllner
reviewed Details | Review
[overview] Switch to confirm dialog when closing (4.34 KB, patch)
2009-11-21 22:59 UTC, Florian Müllner
accepted-commit_now Details | Review
[overview] Switch to confirm dialog when closing (4.34 KB, patch)
2009-11-21 23:03 UTC, Florian Müllner
committed Details | Review

Description drago01 2009-11-20 20:45:38 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).
Comment 1 Florian Müllner 2009-11-21 06:02:08 UTC
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.
Comment 2 drago01 2009-11-21 10:40:19 UTC
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).
Comment 3 Colin Walters 2009-11-21 21:07:36 UTC
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.
Comment 4 Florian Müllner 2009-11-21 22:59:10 UTC
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.
Comment 5 Florian Müllner 2009-11-21 23:03:24 UTC
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.
Comment 6 Colin Walters 2009-11-21 23:15:22 UTC
Review of attachment 148249 [details] [review]:

Looks good!
Comment 7 drago01 2009-11-21 23:22:17 UTC
Thanks :)