How to catch 'maximize window' event?

Hi,
I tried to catch window events, when the SDL window gets maximized or switched
back to normal size. Unfourtunately I got stuck interpreting SDL_SysWMinfo
structure on Linux (file SDL_syswm.h, line 76).
Background: You may ask why I want to do this? To catch user clicking on the
maximize button and recreate the window as a “real” fullscreen window.

What I tried so far:
------------- snip ----------------------
SDL_SetVideoMode(…); //creating window
SDL_EventState(SDL_SYSWMEVENT, SDL_ENABLE); //more window events

SDL_Event event;
while(SDL_PollEvent(&event)) { //handle every waiting
message
switch(event.type) {
//…
case SDL_SYSWMEVENT: //windowmanager events
SDL_SysWMinfo *info;
SDL_GetWMInfo(info); //oops and now? <–
printf(“Window management message\n”); //debug message
break;
}
}
------------- snap ----------------------

I can successfully compile & see the debug messsage whenever I maximize/switch
back to normal. Now I’m stuck. How to determine ‘maximize window’ and ‘restore
window’? Thx for help! :)–
Greets, Mark “Moak” Seuffert

Hi,
I tried to catch window events, when the SDL window gets maximized or switched
back to normal size. Unfourtunately I got stuck interpreting SDL_SysWMinfo
structure on Linux (file SDL_syswm.h, line 76).
Background: You may ask why I want to do this? To catch user clicking on the
maximize button and recreate the window as a “real” fullscreen window.

Take a look at the scrap demo on the SDL demos page. It’s an example of
using the SDL_SYSWM interface. There are other examples sprinkled through
the FAQ.

See ya,
-Sam Lantinga, Software Engineer, Blizzard Entertainment

Hai Sam!

Sam Lantinga schrieb am 17 Nov 2001, (you wrote):

Hi,
I tried to catch window events, when the SDL window gets maximized or
switched back to normal size. Unfourtunately I got stuck interpreting
SDL_SysWMinfo structure on Linux (file SDL_syswm.h, line 76). Background:
You may ask why I want to do this? To catch user clicking on the maximize
button and recreate the window as a “real” fullscreen window.

Take a look at the scrap demo on the SDL demos page. It’s an example of
using the SDL_SYSWM interface. There are other examples sprinkled through
the FAQ.

Thx, meanwhile I found deeper into SDL and also deeper into Xlib. Finally
I found out that SDL + OpenGL + KDE has a problem:

When you resize your window everything is fine. Once pressing on
’maximize’ the window gets maximized, but you never restore it to the
previous state.

This hapens with KDE only, I tested with gnome and everything is fine. Can
someone confirm this problem + has a workaround? Sorry my knowledge about
XLib is too bad (friendly speaking), so I coudn’t provide a patch.–
Mark “Moak” Seuffert, Pirates Technologies, http://www.pirate.de