From: H.G. Muller Date: Wed, 13 Apr 2011 14:33:16 +0000 (+0200) Subject: Fix startup focus of board window X-Git-Url: http://winboard.nl/cgi-bin?a=commitdiff_plain;h=542191fdbde9d89bbc31a5156aae26414689b1f8;p=xboard.git Fix startup focus of board window When there were open auxiliary windows, these would have focus on starting up XBoard. The XtSetKeyboardFocus call added in XBoard main() was ineffective in curing that. It has now been replaced by a call to XSetInputFocus, which does do the job. By giving input focus to the form widget, rather than the board widget, XBoard will be immediately sensitive to all key bindings. --- diff --git a/xboard.c b/xboard.c index d216fe8..2178163 100644 --- a/xboard.c +++ b/xboard.c @@ -2622,7 +2622,8 @@ XBoard square size (hint): %d\n\ } gameInfo.boardWidth = 0; // [HGM] pieces: kludge to ensure InitPosition() calls InitDrawingSizes() InitPosition(TRUE); - XtSetKeyboardFocus(shellWidget, formWidget); +// XtSetKeyboardFocus(shellWidget, formWidget); + XSetInputFocus(xDisplay, XtWindow(formWidget), RevertToPointerRoot, CurrentTime); XtAppMainLoop(appContext); if (appData.debugMode) fclose(debugFP); // [DM] debug