X-Git-Url: http://winboard.nl/cgi-bin?a=blobdiff_plain;f=gtk%2Fxboard.c;h=ef35f2a0794a769c18c2d213d885de27544c052e;hb=dd94bfa89dd6dd1238c3f7063e532ab3ed2d0858;hp=8958e3cc11aba22f232a2f54c0f02396d942434a;hpb=34ee88fbe6aaf114f5a0212c4c94c532d3ae1925;p=xboard.git diff --git a/gtk/xboard.c b/gtk/xboard.c index 8958e3c..ef35f2a 100644 --- a/gtk/xboard.c +++ b/gtk/xboard.c @@ -890,6 +890,7 @@ main (int argc, char **argv) snprintf(svgDir, MSG_SIZ, "%s/themes/default", dataDir); suppress = (argc == 1 || argc > 1 && argv[1][00] != '-'); // OSX sends signal even if name was already argv[1]! g_signal_connect(theApp, "NSApplicationOpenFile", G_CALLBACK(StartNewXBoard), NULL); + g_signal_connect(theApp, "NSApplicationWillTerminate", G_CALLBACK(ExitEvent), NULL); // we must call application ready before we can get the signal, // and supply a (dummy) menu bar before that, to avoid problems with dual apples in it gtkosx_application_set_menu_bar(theApp, GTK_MENU_SHELL(gtk_menu_bar_new())); @@ -1691,7 +1692,7 @@ ReSize (WindowPlacement *wp) h = BOARD_HEIGHT * (squareSize + lineGap) + lineGap; if(optList[W_BOARD].max > w) optList[W_BOARD].max = w; if(optList[W_BOARD].value > h) optList[W_BOARD].value = h; - first = 0; + first = appData.fixedSize; } static guint delayedDragTag = 0; @@ -2316,6 +2317,12 @@ void FileNamePopUpWrapper(label, def, filter, proc, pathFlag, openMode, name, fp char fileext[10] = ""; char *result = NULL; char *cp; + char curDir[MSG_SIZ]; + + if(def && *def && def[strlen(def)-1] == '/') { + getcwd(curDir, MSG_SIZ); + chdir(def); + } /* make a copy of the filter string, so that strtok can work with it*/ cp = strdup(filter); @@ -2395,6 +2402,8 @@ void FileNamePopUpWrapper(label, def, filter, proc, pathFlag, openMode, name, fp gtk_widget_destroy (dialog); ModeHighlight(); + if(def && *def && def[strlen(def)-1] == '/') chdir(curDir); + free(cp); return;