X-Git-Url: http://winboard.nl/cgi-bin?a=blobdiff_plain;f=gtk%2Fxboard.c;h=e10774613aca336f59e19bdd03050ec5a22c05bb;hb=a56bd5ee92e43cbf5537d877fd4010e5e34a3e11;hp=fed6aa3d12f5697db34864f13f78430792937429;hpb=a009a27e8c1e0bfa818f12fdcae675d0babc510a;p=xboard.git diff --git a/gtk/xboard.c b/gtk/xboard.c index fed6aa3..e107746 100644 --- a/gtk/xboard.c +++ b/gtk/xboard.c @@ -371,7 +371,7 @@ String xboardResources[] = { void BoardToTop () { - gtk_window_present(GTK_WINDOW(mainwindow)); + gtk_window_present(GTK_WINDOW(shells[BoardWindow])); } //--------------------------------------------------------------------------------------------------------- @@ -1492,10 +1492,12 @@ DragProc () busy = 0; return; // false alarm } ReSize(&wpNew); - if(shellUp[EngOutDlg]) CoDrag(shells[EngOutDlg], &wpEngineOutput); - if(shellUp[HistoryDlg]) CoDrag(shells[HistoryDlg], &wpMoveHistory); - if(shellUp[EvalGraphDlg]) CoDrag(shells[EvalGraphDlg], &wpEvalGraph); - if(shellUp[GameListDlg]) CoDrag(shells[GameListDlg], &wpGameList); + if(appData.useStickyWindows) { + if(shellUp[EngOutDlg]) CoDrag(shells[EngOutDlg], &wpEngineOutput); + if(shellUp[HistoryDlg]) CoDrag(shells[HistoryDlg], &wpMoveHistory); + if(shellUp[EvalGraphDlg]) CoDrag(shells[EvalGraphDlg], &wpEvalGraph); + if(shellUp[GameListDlg]) CoDrag(shells[GameListDlg], &wpGameList); + } wpMain = wpNew; DrawPosition(True, NULL); if(delayedDragTag) g_source_remove(delayedDragTag); @@ -1521,8 +1523,7 @@ EventProc (GtkWidget *widget, GdkEvent *event, gpointer g) wpNew.y = event->configure.y; wpNew.width = event->configure.width; wpNew.height = event->configure.height; - if(appData.useStickyWindows) - DelayedDrag(); // as long as events keep coming in faster than 50 msec, they destroy each other + DelayedDrag(); // as long as events keep coming in faster than 50 msec, they destroy each other return FALSE; } @@ -1565,7 +1566,7 @@ ModeHighlight () /* Always toggle, don't set. Previous code messes up when invoked while the button is pressed, as releasing it toggles the state again. */ - GdkColor color; + GdkColor color; gdk_color_parse( pausing ? "#808080" : "#F0F0F0", &color ); gtk_widget_modify_bg ( GTK_WIDGET(optList[W_PAUSE].handle), GTK_STATE_NORMAL, &color ); } @@ -1618,7 +1619,7 @@ void CopyFileToClipboard(gchar *filename) return; } selection_tmp[len] = NULLCHAR; // file is now in selection_tmp - + // copy selection_tmp to clipboard GdkDisplay *gdisp = gdk_display_get_default(); if (!gdisp) { @@ -1627,7 +1628,7 @@ void CopyFileToClipboard(gchar *filename) } cb = gtk_clipboard_get_for_display(gdisp, GDK_SELECTION_CLIPBOARD); gtk_clipboard_set_text(cb, selection_tmp, -1); - g_free(selection_tmp); + g_free(selection_tmp); } void @@ -1649,9 +1650,9 @@ PastePositionProc () gchar *fenstr; if (gdisp == NULL) return; - cb = gtk_clipboard_get_for_display(gdisp, GDK_SELECTION_CLIPBOARD); + cb = gtk_clipboard_get_for_display(gdisp, GDK_SELECTION_CLIPBOARD); fenstr = gtk_clipboard_wait_for_text(cb); - if (fenstr==NULL) return; // nothing had been selected to copy + if (fenstr==NULL) return; // nothing had been selected to copy EditPositionPasteFEN(fenstr); return; } @@ -1667,14 +1668,14 @@ PasteGameProc () // get game from clipboard GdkDisplay *gdisp = gdk_display_get_default(); if (gdisp == NULL) return; - cb = gtk_clipboard_get_for_display(gdisp, GDK_SELECTION_CLIPBOARD); + cb = gtk_clipboard_get_for_display(gdisp, GDK_SELECTION_CLIPBOARD); text = gtk_clipboard_wait_for_text(cb); - if (text == NULL) return; // nothing to paste + if (text == NULL) return; // nothing to paste len = strlen(text); // write to temp file if (text == NULL || len == 0) { - return; //nothing to paste + return; //nothing to paste } f = fopen(gamePasteFilename, "w"); if (f == NULL) { @@ -1684,7 +1685,7 @@ PasteGameProc () fwrite(text, 1, len, f); fclose(f); - // load from file + // load from file LoadGameFromFile(gamePasteFilename, 0, gamePasteFilename, TRUE); return; } @@ -1710,7 +1711,7 @@ void MoveTypeInProc(eventkey) buf[0]=eventkey->keyval; buf[1]='\0'; - if (*buf >= 32) + if (*buf >= 32) BoxAutoPopUp (buf); } @@ -2060,7 +2061,7 @@ UpdateLogos (int displ) return; } -void FileNamePopUpGTK(label, def, filter, proc, pathFlag, openMode, name, fp) +void FileNamePopUpWrapper(label, def, filter, proc, pathFlag, openMode, name, fp) char *label; char *def; char *filter; @@ -2160,4 +2161,3 @@ void FileNamePopUpGTK(label, def, filter, proc, pathFlag, openMode, name, fp) return; } -