Skip to content

Commit

Permalink
Fixed bug #278
Browse files Browse the repository at this point in the history
Added the GFX_Display to the wminfo structure, contributed by Eric
  • Loading branch information
slouken committed Sep 24, 2006
1 parent 72305ec commit dae8a4c
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 1 deletion.
6 changes: 5 additions & 1 deletion include/SDL_syswm.h
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -86,7 +86,8 @@ typedef struct SDL_SysWMinfo {
Display *display; /* The X11 display */ Display *display; /* The X11 display */
Window window; /* The X11 display window */ Window window; /* The X11 display window */
/* These locking functions should be called around /* These locking functions should be called around
any X11 functions using the display variable. any X11 functions using the display variable,
but not the gfxdisplay variable.
They lock the event thread, so should not be They lock the event thread, so should not be
called around event functions or from event filters. called around event functions or from event filters.
*/ */
Expand All @@ -96,6 +97,9 @@ typedef struct SDL_SysWMinfo {
/* Introduced in SDL 1.0.2 */ /* Introduced in SDL 1.0.2 */
Window fswindow; /* The X11 fullscreen window */ Window fswindow; /* The X11 fullscreen window */
Window wmwindow; /* The X11 managed input window */ Window wmwindow; /* The X11 managed input window */

/* Introduced in SDL 1.2.12 */
Display *gfxdisplay; /* The X11 display to which rendering is done */
} x11; } x11;
} info; } info;
} SDL_SysWMinfo; } SDL_SysWMinfo;
Expand Down
10 changes: 10 additions & 0 deletions src/video/x11/SDL_x11wm.c
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -398,6 +398,8 @@ static void unlock_display(void)
XSync(SDL_Display, False); XSync(SDL_Display, False);
SDL_Unlock_EventThread(); SDL_Unlock_EventThread();
} }

#include <stdio.h>
int X11_GetWMInfo(_THIS, SDL_SysWMinfo *info) int X11_GetWMInfo(_THIS, SDL_SysWMinfo *info)
{ {
if ( info->version.major <= SDL_MAJOR_VERSION ) { if ( info->version.major <= SDL_MAJOR_VERSION ) {
Expand All @@ -410,6 +412,14 @@ int X11_GetWMInfo(_THIS, SDL_SysWMinfo *info)
info->info.x11.fswindow = FSwindow; info->info.x11.fswindow = FSwindow;
info->info.x11.wmwindow = WMwindow; info->info.x11.wmwindow = WMwindow;
} }


if ( SDL_VERSIONNUM(info->version.major,
info->version.minor,
info->version.patch) >= 1212 ) {
info->info.x11.gfxdisplay = GFX_Display;
}

info->info.x11.lock_func = lock_display; info->info.x11.lock_func = lock_display;
info->info.x11.unlock_func = unlock_display; info->info.x11.unlock_func = unlock_display;
return(1); return(1);
Expand Down

0 comments on commit dae8a4c

Please sign in to comment.