[MPlayer-cvslog] r38587 - trunk/gui/dialog/fileselect.c

ib subversion at mplayerhq.hu
Sun Jun 16 14:58:02 EEST 2024


Author: ib
Date: Sun Jun 16 14:58:02 2024
New Revision: 38587

Log:
Treat closing the file selector window as canceling the dialog.

This way, the most recently selected line is conveniently retained.

Modified:
   trunk/gui/dialog/fileselect.c

Modified: trunk/gui/dialog/fileselect.c
==============================================================================
--- trunk/gui/dialog/fileselect.c	Sun Jun 16 14:56:32 2024	(r38586)
+++ trunk/gui/dialog/fileselect.c	Sun Jun 16 14:58:02 2024	(r38587)
@@ -741,6 +741,17 @@ WARN_ON
     fsPathList = NULL;
 }
 
+static gboolean fs_Delete(GtkWidget *widget, GdkEvent *event, gpointer user_data)
+{
+    (void)widget;
+    (void)event;
+    (void)user_data;
+
+    fs_Cancel_released(NULL, NULL); // press cancel
+
+    return TRUE;
+}
+
 static void fs_Destroy(void)
 {
     fs_PathClear();
@@ -832,6 +843,7 @@ static GtkWidget *CreateFileSelect(void)
 
     gtk_widget_add_accelerator(fsCancel, "clicked", accel_group, GDK_KEY_Escape, 0, GTK_ACCEL_VISIBLE);
 
+    g_signal_connect(G_OBJECT(FileSelector), "delete-event", G_CALLBACK(fs_Delete), NULL);
     g_signal_connect(G_OBJECT(FileSelector), "destroy", G_CALLBACK(fs_Destroy), NULL);
     g_signal_connect(G_OBJECT(fsFNameListWindow), "key-release-event", G_CALLBACK(fs_key_release_event), NULL);
 


More information about the MPlayer-cvslog mailing list