Start button-activated browse near old field contents GTK
[xboard.git] / gtk / xoptions.c
index 7ae3f3f..7a3a831 100644 (file)
@@ -1113,9 +1113,11 @@ void BrowseGTK(GtkWidget *widget, gpointer gdata)
     gtkfilter     = gtk_file_filter_new();
     gtkfilter_all = gtk_file_filter_new();
 
-    char fileext[MSG_SIZ], *filter = currentOption[opt_i].textValue;
+    char fileext[MSG_SIZ], *filter = currentOption[opt_i].textValue, *old;
 
-    StartDir(filter, NULL); // change to start directory for this file type
+    GetWidgetText(&currentOption[opt_i], &old); // start in same directory as current widget contents
+    StartDir(filter, old); // change to start directory for this file type
+    g_free(old);
 
     /* select file or folder depending on option_type */
     if (currentOption[opt_i].type == PathName)
@@ -1549,7 +1551,8 @@ if(appData.debugMode) printf("n=%d, h=%d, w=%d\n",n,height,width);
                 Pack(hbox, table, fbutton, left, left+r, top, 0);
                 break;
             }
-            if(!strcmp(option[i].name, "R") || !strcmp(option[i].name, "G") || !strcmp(option[i].name, "B")) {
+            if(!strcmp(option[i].name, "R") || !strcmp(option[i].name, "G") ||
+               !strcmp(option[i].name, "B") && !strcmp(option[i+1].name, "D")) {
                 break;
             } else
             if(!strcmp(option[i].name, "D")) {