[SDL] SDL (XP and Vista) window management bugs?

Michael Kurinnoy viewizard at viewizard.com
Mon Sep 10 03:15:27 PDT 2007


Hi,

I got the bug report, there are several bugs, but 2 of them looks like 
bugs in the SDL (1.2.12) window management code (Windows XP and Vista).

Here is the explanation with my comments:

(XP and Vista) Windowed mode: Titlebar buttons don't trigger binded actions.

Steps to reproduce:
1. Run game fullscreen mode (SDL_Init -> SDL_SetVideoMode 1024x768 
fullscreen)
2. Switch to windowed mode (SDL_Quit -> SDL_Init -> SDL_SetVideoMode 
1024x768 windowed)
3. Try clicking titlebar buttons.
Looks like titlebar is a part of active windows part, on 
SDL_ShowCursor(SDL_DISABLE) you don't see the mouse pointer under 
titlebar + you can't move the windows by dragging titlebar or click on 
minimized or quit buttons.
If I create a windowed from the beginning (without fullscreen->windowed 
switching) all is ok.

I can't understood the problem, looks like after SDL_Quit some specific 
data still alive and used in the window initialization.
Btw, I see the same bug, even on switch the windowed modes from 1024x768 
to 800x600 or any other, when first window large then second by size.
Any help are welcome. :-\


About a bug I figured out (ohhh... ok, I think so): Incorrect behaviour 
when game is minimized on Windows XP and Vista.

Steps to reproduce:
1. Run game (i'm using 800x600 at 32bpp fullscreen for game and 
1280x960 at 32bpp for desktop)
2. Alt-tab to other window
3. Try clicking (right mouse button) on game taskbar item
Result: selected task menu isn't called, in this case generic taskbar 
menu is called instead of task-specific one, mouse cursor position is 
reset to (0,0) (top-left corner of screen)

Possible solution.

Source:
wincommon\SDL_sysevents.c
Procedure:
LRESULT CALLBACK WinMessage(HWND hwnd, UINT msg, WPARAM wParam, LPARAM 
lParam)

line 388:
if ( this->input_grab != SDL_GRAB_OFF ) {
work fine with such changes:
if ( this->input_grab != SDL_GRAB_OFF && !minimized ) {


-- 
Best regards,
Michael Kurinnoy
Founder/CEO, Viewizard
http://www.viewizard.com



More information about the SDL mailing list