X-Git-Url: http://winboard.nl/cgi-bin?a=blobdiff_plain;f=xboard.c;h=6aea957ab543077bdb21839c7aed80e6ba349600;hb=c0d0ea91773838e5d11c3cd3b407fea251058c34;hp=10bf03465f37a208dba8ff6cbd172d706ef51412;hpb=f9acc2486649a2a8c6c173fe913bab246153cdde;p=xboard.git diff --git a/xboard.c b/xboard.c index 10bf034..6aea957 100644 --- a/xboard.c +++ b/xboard.c @@ -293,7 +293,6 @@ GC lightSquareGC, darkSquareGC, lineGC, wdPieceGC, wlPieceGC, Pixmap iconPixmap, wIconPixmap, bIconPixmap, xMarkPixmap; Widget shellWidget, formWidget, boardWidget, titleWidget, dropMenu, menuBarWidget; Option *optList; // contains all widgets of main window -XSegment secondSegments[BOARD_RANKS + BOARD_FILES + 2]; XSegment gridSegments[BOARD_RANKS + BOARD_FILES + 2]; #if ENABLE_NLS XFontSet fontSet, clockFontSet; @@ -889,6 +888,16 @@ MainWindowUp () return xBoardWindow != 0; } +void SwitchWindow() +{ + extern Option dualOptions[]; + static Window dual; + Window tmp = xBoardWindow; + if(!dual) dual = XtWindow(dualOptions[3].handle); // must be first call + xBoardWindow = dual; // swap them + dual = tmp; +} + void PopUpStartupDialog () { // start menu not implemented in XBoard @@ -927,7 +936,7 @@ InitDrawingSizes (BoardSize boardSize, int flags) int i; static Dimension oldWidth, oldHeight; static VariantClass oldVariant; - static int oldDual = -1, oldMono = -1; + static int oldMono = -1; if(!formWidget) return; @@ -935,21 +944,15 @@ InitDrawingSizes (BoardSize boardSize, int flags) boardWidth = lineGap + BOARD_WIDTH * (squareSize + lineGap); boardHeight = lineGap + BOARD_HEIGHT * (squareSize + lineGap); - if(boardWidth != oldWidth || boardHeight != oldHeight || oldDual != twoBoards) { // do resizing stuff only if size actually changed + if(boardWidth != oldWidth || boardHeight != oldHeight) { // do resizing stuff only if size actually changed - oldWidth = boardWidth; oldHeight = boardHeight; oldDual = twoBoards; + oldWidth = boardWidth; oldHeight = boardHeight; CreateGrid(); - hOffset = boardWidth + 10; - for(i=0; ihandle; /* check for low time warning */ Pixel foregroundOrWarningColor = timerForegroundPixel;