Commit 60e3e533 authored by Andreas Tille's avatar Andreas Tille

Apply patch from bitfreak25 <bitfreak25@gmx.de>

parent 550ee80f
Author: bitfreak25 <bitfreak25@gmx.de>
Last-Update: Sun, 13 Jan 2019 01:35:08 +0100
Bug-Debian: https://bugs.debian.org/916606
Description: Prevent random pauses ingame without external actions
--- a/client/game.c
+++ b/client/game.c
@@ -1150,6 +1150,17 @@ void client_game_run( void )
/* check whether an event occured */
button_clicked = key_pressed = 0;
if ( SDL_PollEvent( &event ) ) {
+ // Special code for broken SDL with Xorg 1.20.1, where pairs of inputfocus gain and loss events are generated
+ // when locking the mouse in windowed mode.
+ if (event.type == SDL_ACTIVEEVENT && event.active.state == SDL_APPINPUTFOCUS && event.active.gain == 0) {
+ SDL_Event test; //Check if the next event would undo this one.
+ if (SDL_PeepEvents(&test,1,SDL_PEEKEVENT,SDL_ACTIVEEVENTMASK) == 1 && test.active.state == SDL_APPINPUTFOCUS && test.active.gain == 1) {
+ // Skip both events.
+ SDL_PeepEvents(&test,1,SDL_GETEVENT,SDL_ACTIVEEVENTMASK);
+ continue;
+ }
+ }
+
if ( client_state == CS_PAUSE && game->game_type == GT_NETWORK )
gui_dispatch_event( &event, ms );
else
10-ball-turbo-key-pref.patch
spelling-fixes.patch
sdl_fix_pauses.patch
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment