Skip to content

Commit 501ac48

Browse files
committed
filediff: Handle save responses better in delete events (bgo#744081)
The "you have modified files" dialog offers a "Close without saving" option, which returns a CLOSE response code instead of our usual OK. This was being handled correctly in most places, but not when the tab was being closed via a delete event. This patch fixes it so that the check_save_modified() always returns either OK or CANCEL, since that's really the only thing we need out of it. This commit also removes a stray delete-event handler on a widget that should never ever be loaded.
1 parent a629753 commit 501ac48

2 files changed

Lines changed: 3 additions & 1 deletion

File tree

data/ui/filediff.ui

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -280,7 +280,6 @@
280280
<property name="visible">True</property>
281281
<property name="can_focus">False</property>
282282
<property name="title" translatable="yes">window1</property>
283-
<signal name="destroy" handler="on_delete_event" swapped="no"/>
284283
<child>
285284
<object class="GtkVBox" id="filediff">
286285
<property name="visible">True</property>

meld/filediff.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -883,6 +883,9 @@ def check_save_modified(self):
883883
elif response == Gtk.ResponseType.DELETE_EVENT:
884884
response = Gtk.ResponseType.CANCEL
885885

886+
if response == Gtk.ResponseType.CLOSE:
887+
response = Gtk.ResponseType.OK
888+
886889
if response == Gtk.ResponseType.OK and self.meta:
887890
parent = self.meta.get('parent', None)
888891
saved = self.meta.get('middle_saved', False)

0 commit comments

Comments
 (0)