[Xfce4-commits] [xfce/thunar] 01/01: Prevent crash when renaming file (Bug #10805)

noreply at xfce.org noreply at xfce.org
Sat Feb 15 21:27:50 CET 2020


This is an automated email from the git hooks/post-receive script.

a   l   e   x       p   u   s   h   e   d       a       c   o   m   m   i   t       t   o       b   r   a   n   c   h       x   f   c   e   -   4   .   1   4   
   in repository xfce/thunar.

commit b0dac2a485fe1a5356560725b1dcea5004da7012
Author: Theo Linkspfeifer <lastonestanding at tutanota.com>
Date:   Sat Feb 15 17:34:46 2020 +0100

    Prevent crash when renaming file (Bug #10805)
---
 thunar/thunar-dialogs.c | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/thunar/thunar-dialogs.c b/thunar/thunar-dialogs.c
index c6ac70a..94eb281 100644
--- a/thunar/thunar-dialogs.c
+++ b/thunar/thunar-dialogs.c
@@ -173,6 +173,10 @@ thunar_dialogs_show_rename_file (gpointer    parent,
   /* resize the dialog to make long names fit as much as possible */
   gtk_window_set_default_size (GTK_WINDOW (dialog), CLAMP (layout_width, 300, parent_width), -1);
 
+  /* automatically close the dialog when the file is destroyed */
+  g_signal_connect_swapped (G_OBJECT (file), "destroy",
+                            G_CALLBACK (gtk_widget_destroy), dialog);
+
   /* run the dialog */
   response = gtk_dialog_run (GTK_DIALOG (dialog));
   if (G_LIKELY (response == GTK_RESPONSE_OK))
@@ -192,7 +196,8 @@ thunar_dialogs_show_rename_file (gpointer    parent,
     }
 
   /* cleanup */
-  gtk_widget_destroy (dialog);
+  if (G_LIKELY (response != GTK_RESPONSE_NONE))
+    gtk_widget_destroy (dialog);
 
   return job;
 }

-- 
To stop receiving notification emails like this one, please contact
the administrator of this repository.


More information about the Xfce4-commits mailing list