Skip to content
This repository has been archived by the owner on Sep 4, 2019. It is now read-only.

Commit

Permalink
mainWindow is available through GetWMInfo
Browse files Browse the repository at this point in the history
  • Loading branch information
mordak committed Jan 13, 2013
1 parent 4cdcc25 commit dc65b20
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
5 changes: 3 additions & 2 deletions include/SDL_syswm.h
Expand Up @@ -89,7 +89,7 @@ typedef struct SDL_SysWMinfo {
Display *display; /**< The X11 display */
Window window; /**< The X11 display window */
/** 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
* called around event functions or from event filters.
Expand Down Expand Up @@ -195,6 +195,7 @@ typedef struct SDL_SysWMinfo {
SDL_version version;
screen_context_t context;
screen_window_t window;
screen_window_t mainWindow;
} SDL_SysWMinfo;

#else
Expand All @@ -220,7 +221,7 @@ typedef struct SDL_SysWMinfo {
* This function gives you custom hooks into the window manager information.
* It fills the structure pointed to by 'info' with custom information and
* returns 1 if the function is implemented. If it's not implemented, or
* the version member of the 'info' structure is invalid, it returns 0.
* the version member of the 'info' structure is invalid, it returns 0.
*
* You typically use this function like this:
* @code
Expand Down
3 changes: 2 additions & 1 deletion src/video/playbook/SDL_playbookvideo.c
Expand Up @@ -166,6 +166,7 @@ int PLAYBOOK_GetWMInfo(_THIS, SDL_SysWMinfo *info)
if ( info->version.major <= SDL_MAJOR_VERSION ) {
info->window = _priv->screenWindow;
info->context = _priv->screenContext;
info->mainWindow = _priv->mainWindow;
return(1);
} else {
SDL_SetError("Application not compiled with SDL %d.%d\n",
Expand Down Expand Up @@ -697,7 +698,7 @@ SDL_Surface *PLAYBOOK_SetVideoMode(_THIS, SDL_Surface *current,

locateTCOControlFile(this);
if (_priv->tcoControlsDir) {
initializeOverlay(this, screenWindow);
initializeOverlay(this, screenWindow);
}

_priv->frontBuffer = windowBuffer[0];
Expand Down

2 comments on commit dc65b20

@giorgosgs
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This doesnt work. When I compile SDL with QNX Momentics I get a: mainWindow does not exist error.

@jnicholl
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Which line does the compiler refer to for the failure? _priv->mainWindow should be defined in https://github.com/blackberry/SDL/blob/20c331e324ad5d58ef80c8352a760e2ac866747e/src/video/playbook/SDL_playbookvideo.h as a result of 20c331e. info->mainWindow looks like it's defined here as a result of this commit.

Please sign in to comment.