Fixed bug #278 SDL-1.2
authorSam Lantinga <slouken@libsdl.org>
Sun, 24 Sep 2006 00:08:28 +0000
branchSDL-1.2
changeset 3872be84332e761e
parent 3871 4d11f2ae7582
child 3873 cef30206da53
Fixed bug #278
Added the GFX_Display to the wminfo structure, contributed by Eric
include/SDL_syswm.h
src/video/x11/SDL_x11wm.c
     1.1 --- a/include/SDL_syswm.h	Sun Sep 24 00:04:06 2006 +0000
     1.2 +++ b/include/SDL_syswm.h	Sun Sep 24 00:08:28 2006 +0000
     1.3 @@ -86,7 +86,8 @@
     1.4  	    	Display *display;	/* The X11 display */
     1.5  	    	Window window;		/* The X11 display window */
     1.6  		/* These locking functions should be called around
     1.7 -                   any X11 functions using the display variable.
     1.8 +                   any X11 functions using the display variable, 
     1.9 +                   but not the gfxdisplay variable.
    1.10                     They lock the event thread, so should not be
    1.11  		   called around event functions or from event filters.
    1.12  		 */
    1.13 @@ -96,6 +97,9 @@
    1.14  		/* Introduced in SDL 1.0.2 */
    1.15  	    	Window fswindow;	/* The X11 fullscreen window */
    1.16  	    	Window wmwindow;	/* The X11 managed input window */
    1.17 +
    1.18 +		/* Introduced in SDL 1.2.12 */
    1.19 +		Display *gfxdisplay;	/* The X11 display to which rendering is done */
    1.20  	    } x11;
    1.21  	} info;
    1.22  } SDL_SysWMinfo;
     2.1 --- a/src/video/x11/SDL_x11wm.c	Sun Sep 24 00:04:06 2006 +0000
     2.2 +++ b/src/video/x11/SDL_x11wm.c	Sun Sep 24 00:08:28 2006 +0000
     2.3 @@ -398,6 +398,8 @@
     2.4  	XSync(SDL_Display, False);
     2.5  	SDL_Unlock_EventThread();
     2.6  }
     2.7 +
     2.8 +#include <stdio.h>
     2.9  int X11_GetWMInfo(_THIS, SDL_SysWMinfo *info)
    2.10  {
    2.11  	if ( info->version.major <= SDL_MAJOR_VERSION ) {
    2.12 @@ -410,6 +412,14 @@
    2.13  			info->info.x11.fswindow = FSwindow;
    2.14  			info->info.x11.wmwindow = WMwindow;
    2.15  		}
    2.16 +
    2.17 +
    2.18 +		if ( SDL_VERSIONNUM(info->version.major,
    2.19 +		                    info->version.minor,
    2.20 +		                    info->version.patch) >= 1212 ) {
    2.21 +			info->info.x11.gfxdisplay = GFX_Display;
    2.22 +		}
    2.23 +
    2.24  		info->info.x11.lock_func = lock_display;
    2.25  		info->info.x11.unlock_func = unlock_display;
    2.26  		return(1);