X-Git-Url: http://winboard.nl/cgi-bin?a=blobdiff_plain;f=gtk%2Fxboard.c;h=0d04c5b5742593be80da2f8a41e4b2c81d186de6;hb=94d2b2b896207fac048806e05c8a114297b1a513;hp=95229f0cee453c21718dde4b9e5fb0d207e1f827;hpb=85164e1c15746506744f2ff807d7f39228a8b2f4;p=xboard.git diff --git a/gtk/xboard.c b/gtk/xboard.c index 95229f0..0d04c5b 100644 --- a/gtk/xboard.c +++ b/gtk/xboard.c @@ -447,7 +447,7 @@ CreateFonts () void ParseColor (int n, char *name) { // in XBoard, just copy the color-name string - if(colorVariable[n]) *(char**)colorVariable[n] = strdup(name); + if(colorVariable[n] && *name == '#') *(char**)colorVariable[n] = strdup(name); } char * @@ -1028,7 +1028,8 @@ main (int argc, char **argv) } else { SizeDefaults *szd = sizeDefaults; if (*appData.boardSize == NULLCHAR) { - GdkScreen *screen = gtk_window_get_screen(GTK_WINDOW(mainwindow)); // TODO: this does not work, as no mainwindow yet +// GdkScreen *screen = gtk_window_get_screen(GTK_WINDOW(mainwindow)); // TODO: this does not work, as no mainwindow yet + GdkScreen *screen = gdk_screen_get_default(); guint screenwidth = gdk_screen_get_width(screen); guint screenheight = gdk_screen_get_height(screen); while (screenwidth < (szd->minScreenSize*BOARD_WIDTH + 4)/8 || @@ -1182,7 +1183,7 @@ main (int argc, char **argv) marginH = h - a.height - hc; // subtract current clock height, so it can be added back dynamically } - CreateAnyPieces(); + CreateAnyPieces(1); CreateGrid(); if(appData.logoSize) @@ -1588,12 +1589,12 @@ static WindowPlacement wpNew; void CoDrag (GtkWidget *sh, WindowPlacement *wp) { - int touch=0, fudge = 2, f = 2; + int touch=0, fudge = 4, f = 3; GetActualPlacement(sh, wp); if(abs(wpMain.x + wpMain.width + 2*frameX - f - wp->x) < fudge) touch = 1; else // right touch - if(abs(wp->x + wp->width + 2*frameX + f - wpMain.x) < fudge) touch = 2; else // left touch + if(abs(wp->x + wp->width + 2*frameX - f - wpMain.x) < fudge) touch = 2; else // left touch if(abs(wpMain.y + wpMain.height + frameX - f + frameY - wp->y) < fudge) touch = 3; else // bottom touch - if(abs(wp->y + wp->height + frameX + frameY + f - wpMain.y) < fudge) touch = 4; // top touch + if(abs(wp->y + wp->height + frameX + frameY - f - wpMain.y) < fudge) touch = 4; // top touch //printf("CoDrag: touch = %d x=%d w=%d x2=%d w2=%d fx=%d\n", touch, wpMain.x, wpMain.width, wp->x, wp->width, frameX); if(!touch ) return; // only windows that touch co-move if(touch < 3 && wpNew.height != wpMain.height) { // left or right and height changed @@ -2235,7 +2236,7 @@ LoadLogo (ChessProgramState *cps, int n, Boolean ics) if(ics) { // [HGM] logo: in ICS mode second can be used for ICS sprintf(buf, "%s/%s.png", appData.logoDir, appData.icsHost); } else { // engine; look in engine-dir (if any) first - snprintf(buf, MDG_SIZ, "%s/logo.png", appData.directory[n]); + snprintf(buf, MSG_SIZ, "%s/logo.png", appData.directory[n]); if(appData.directory[n] && appData.directory[n][0] && strcmp(appData.directory[n], ".") && (f = fopen(buf, "r")) ) fclose(f);