Call EVENT_Pending() to flush X11 output queue before blocking in MsgWaitForMultipleObjects(). Don't call EVENT_WaitNetEvent in MSG_PeekHardwareMsg. Protect system queue access in hardware_event().