From 542191fdbde9d89bbc31a5156aae26414689b1f8 Mon Sep 17 00:00:00 2001 From: H.G. Muller Date: Wed, 13 Apr 2011 16:33:16 +0200 Subject: [PATCH] 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. --- xboard.c | 3 ++- 1 files changed, 2 insertions(+), 1 deletions(-) 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 -- 1.7.0.4