Selecting the window in which to draw the board when the slave board for
-dualBoard was up was done by a toggle. For unknown reason this could cause
a situation where the drawing took place in the other window than the
intended one. The code is made more robust by explicitly specifying which
window to draw in, based on the partnerUp flag.
MarkMenuItem("View.Flip View", flipView);
}
- if(nr) { SlavePopUp(); SwitchWindow(); } // [HGM] popup board if not yet popped up, and switch drawing to it.
+ if(nr) { SlavePopUp(); SwitchWindow(0); } // [HGM] popup board if not yet popped up, and switch drawing to it.
/*
* It would be simpler to clear the window with XClearWindow()
}
FlashDelay(0); // this flushes drawing queue;
- if(nr) SwitchWindow();
+ if(nr) SwitchWindow(1);
}
/* [AS] Arrow highlighting support */
void DragPieceMove P((int x, int y));
void DrawBorder P((int x, int y, int type, int odd));
void FlashDelay P((int flash_delay));
-void SwitchWindow P((void));
+void SwitchWindow P((int main));
extern int damage[2][BOARD_RANKS][BOARD_FILES];
extern Option *currBoard;
int x1, x2, y1, y2;
} gridSegments[BOARD_RANKS + BOARD_FILES + 2];
-static int dual = 0;
-
void
-SwitchWindow ()
+SwitchWindow (int main)
{
- dual = !dual;
- currBoard = (dual ? &mainOptions[W_BOARD] : &dualOptions[3]);
+ currBoard = (main ? &mainOptions[W_BOARD] : &dualOptions[3]);
csBoardWindow = DRAWABLE(currBoard);
}