GNOME Bugzilla – Bug 737109
dismissing wait? dialogue with ESC performs destructive action
Last modified: 2017-01-22 13:59:01 UTC
When an app doesn't react and mutter shows the "wait or force quit?" dialogue, dismissing the dialogue with pressing ESC performs the destructive "force quit" action instead of the nondestructive "wait" action, as I'd expected. This is because zenity equates ESC with the cancel action. However, mutter is calling zenity with 'ok' == 'wait' and 'cancel' == 'force quit', ie the 'cancel' action is the destructive one. This looks backwards, and is likely a regression from bug 581046.
Still happening in 3.20.
*** Bug 771690 has been marked as a duplicate of this bug. ***
Created attachment 335911 [details] [review] Invert the logic of the dialog Make Force Quit action on the OK button and test if EXISTSTATUS is 0 (OK button pressed) instead of 1 to kill the freezed window
It is simple to test with a simple python script launched in a terminal #!/usr/bin/env python import gi gi.require_version('Gtk', '3.0') from gi.repository import Gtk class MyWindow(Gtk.Window): def __init__(self): Gtk.Window.__init__(self, title="Hello World") self.button = Gtk.Button(label="Click Here") self.button.connect("clicked", self.on_button_clicked) self.add(self.button) def on_button_clicked(self, widget): while True: pass win = MyWindow() win.connect("delete-event", Gtk.main_quit) win.show_all() Gtk.main() After a clic on "Click Here" button, this application hangs (eating CPU in infinite loop), clic on the "close" window decoration and gnome suggest to kill it after a few seconds.
Review of attachment 335911 [details] [review]: Please use git-format-patch to include a commit message ::: src/core/delete.c @@ +45,3 @@ window->dialog_pid = -1; /* exit status of 1 means the user pressed "Force Quit" */ The comment needs to be updated as well
Created attachment 335915 [details] [review] Invert the logic of the dialog Reworked patch to modify comment also and use git-format-patch to include commit message.
Created attachment 335916 [details] [review] delete: Swap wait/force-quit actions Reattaching with a proper commit message
Review of attachment 335916 [details] [review]: looks good, but I guess this is a UI break?
Attachment 335916 [details] pushed as ed52e17 - delete: Swap wait/force-quit actions
*** Bug 777603 has been marked as a duplicate of this bug. ***