if(sscanf(name, "size%d:", &size)) {
// [HGM] font: font is meant for specific boardSize (likely from settings file);
// defer processing it until we know if it matches our board size
- if(size >= 0 && size<MAX_SIZE) { // for now, fixed limit
+ if(strstr(name, "-*-") && // only pay attention to things that look like X-fonts
+ size >= 0 && size<MAX_SIZE) { // for now, fixed limit
fontTable[number][size] = strdup(strchr(name, ':')+1);
fontValid[number][size] = True;
}
GenerateGlobalTranslationTable (void)
{
/* go through all menu items and extract the keyboard shortcuts, so that X11 can load them */
- char *output;
+ char *output[2];
int i,j;
MenuItem *mi;
- output = strdup("");
+ output[0] = strdup(""); // build keystrokes with and wo mod keys separately
+ output[1] = strdup(""); // so the more specific can preceed the other
/* loop over all menu entries */
for( i=0; menuBar[i].mi ; i++)
snprintf(buffer, buffersize+1, ":%s<Key>%s: MenuItem(%s) \n ", mods, key, name);
/* add string to the output */
- output = realloc(output, strlen(output) + strlen(buffer)+1);
- strncat(output, buffer, strlen(buffer));
+ output[shift|alt|ctrl] = realloc(output[shift|alt|ctrl], strlen(output[shift|alt|ctrl]) + strlen(buffer)+1);
+ strncat(output[shift|alt|ctrl], buffer, strlen(buffer));
/* clean up */
free(key);
}
}
}
- return output;
+ output[1] = realloc(output[1], strlen(output[1]) + strlen(output[0])+1);
+ strncat(output[1], output[0], strlen(output[0]));
+ free(output[0]);
+ return output[1];
}
programName, appData.boardSize);
exit(2);
}
+ if(BOARD_WIDTH > 8)
+ squareSize = (squareSize*8 + BOARD_WIDTH/2)/BOARD_WIDTH; // scale height
if (i < 7) {
/* Find some defaults; use the nearest known size */
SizeDefaults *szd, *nearest;
} else {
SizeDefaults *szd = sizeDefaults;
if (*appData.boardSize == NULLCHAR) {
- while (DisplayWidth(xDisplay, xScreen) < szd->minScreenSize ||
- DisplayHeight(xDisplay, xScreen) < szd->minScreenSize) {
+ while (DisplayWidth(xDisplay, xScreen) < (szd->minScreenSize*BOARD_WIDTH + 4)/8 ||
+ DisplayHeight(xDisplay, xScreen) < (szd->minScreenSize*BOARD_HEIGHT + 4)/8) {
szd++;
}
if (szd->name == NULL) szd--;
EngineOutputPopUp();
}
+ gameInfo.boardWidth = 0; // [HGM] pieces: kludge to ensure InitPosition() calls InitDrawingSizes()
+ InitPosition(TRUE);
+
InitBackEnd2();
if (errorExitStatus == -1) {
}
}
- gameInfo.boardWidth = 0; // [HGM] pieces: kludge to ensure InitPosition() calls InitDrawingSizes()
- InitPosition(TRUE);
UpdateLogos(TRUE);
// XtSetKeyboardFocus(shellWidget, formWidget);
XSetInputFocus(xDisplay, XtWindow(formWidget), RevertToPointerRoot, CurrentTime);
return 0;
}
+void
+DoEvents ()
+{
+ XtInputMask m;
+ while((m = XtAppPending(appContext))) XtAppProcessEvent(appContext, m);
+}
+
RETSIGTYPE
TermSizeSigHandler (int sig)
{