Line
Link Here
|
0 |
-- a/client/game.c |
0 |
++ b/client/game.c |
Lines 1150-1155
void client_game_run( void )
Link Here
|
1150 |
/* check whether an event occured */ |
1150 |
/* check whether an event occured */ |
1151 |
button_clicked = key_pressed = 0; |
1151 |
button_clicked = key_pressed = 0; |
1152 |
if ( SDL_PollEvent( &event ) ) { |
1152 |
if ( SDL_PollEvent( &event ) ) { |
|
|
1153 |
// Special code for broken SDL with Xorg 1.20.1, where pairs of inputfocus gain and loss events are generated |
1154 |
// when locking the mouse in windowed mode. |
1155 |
if (event.type == SDL_ACTIVEEVENT && event.active.state == SDL_APPINPUTFOCUS && event.active.gain == 0) { |
1156 |
SDL_Event test; //Check if the next event would undo this one. |
1157 |
if (SDL_PeepEvents(&test,1,SDL_PEEKEVENT,SDL_ACTIVEEVENTMASK) == 1 && test.active.state == SDL_APPINPUTFOCUS && test.active.gain == 1) { |
1158 |
// Skip both events. |
1159 |
SDL_PeepEvents(&test,1,SDL_GETEVENT,SDL_ACTIVEEVENTMASK); |
1160 |
continue; |
1161 |
} |
1162 |
} |
1163 |
|
1153 |
if ( client_state == CS_PAUSE && game->game_type == GT_NETWORK ) |
1164 |
if ( client_state == CS_PAUSE && game->game_type == GT_NETWORK ) |
1154 |
gui_dispatch_event( &event, ms ); |
1165 |
gui_dispatch_event( &event, ms ); |
1155 |
else |
1166 |
else |