pkgsrc-Users archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Patch for games/lbreakout2



Hi,

lbreakout2 has an error with recent SDL/xorg where after loss of a ball the game would stay in pause mode and you cannot unpause it anymore rendering it unplayable.

Debian people have developed a patch which can be found here:
https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=916606



--- lbreakout2-2.6.5.orig/client/game.c 2013-05-03 19:06:20.000000000 +0200
+++ lbreakout2-2.6.5/client/game.c 2019-01-13 00:21:06.339765000 +0100
@@ -1150,6 +1150,17 @@
  /* check wether 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


Regards,
Connor



Home | Main Index | Thread Index | Old Index