Patch for broken Mode_swich handling during XGrabKeyboard