SDL_RecreateWindow breaks foreign window painting

It’s been driving me nuts for weeks, trying to figure out why my SDL frames won’t repaint on XP if you drag something over them. I ended up looking at the messaging layer and found out that Delphi was never receiving WM_PAINT after they’d been set up. So I started looking at the SDL side to see why. A bit of investigation led me to SDL_RecreateWindow, which is getting called by GL_CreateRenderer. (Why it’s getting called is most likely due to a bug on my end, but I’ll have to look into that later.)

Turns out SDL_RecreateWindow removes the SDL_WINDOW_FOREIGN flag from a window, which is checked in WIN_WindowProc to decide whether or not to forward the WM_PAINT message on to the foreign owner’s window proc. Is there a reason behind this, or is it an oversight?

I submitted a bug for this at http://bugzilla.libsdl.org/show_bug.cgi?id=891

On further examination, it looks like there’s no bug at my end. It’s getting called because the window doesn’t have the SDL_WINDOW_OPENGL flag, which there’s no way to specify when I call SDL_CreateWindowFrom.________________________________
From: @Mason_Wheeler (Mason Wheeler)
Subject: [SDL] SDL_RecreateWindow breaks foreign window painting

It’s been driving me nuts for weeks, trying to figure out why my SDL frames won’t repaint on XP if you drag something over them. I ended up looking at the messaging layer and found out that Delphi was never receiving WM_PAINT after they’d been set up. So I started looking at the SDL side to see why. A bit of investigation led me to SDL_RecreateWindow, which is getting called by GL_CreateRenderer. (Why it’s getting called is most likely due to a bug on my end, but I’ll have to look into that later.)

Turns out SDL_RecreateWindow removes the SDL_WINDOW_FOREIGN flag from a window, which is checked in WIN_WindowProc to decide whether or not to forward the WM_PAINT message on to the foreign owner’s window proc. Is there a reason behind this, or is it an oversight?

I submitted a bug for this at http://bugzilla.libsdl.org/show_bug.cgi?id=891

Thanks for the great bug report! I’ve committed a fix to subversion.On Mon, Nov 23, 2009 at 7:05 AM, Mason Wheeler wrote:

It’s been driving me nuts for weeks, trying to figure out why my SDL frames
won’t repaint on XP if you drag something over them.? I ended up looking at
the messaging layer and found out that Delphi was never receiving WM_PAINT
after they’d been set up.? So I started looking at the SDL side to see why.
A bit of investigation led me to SDL_RecreateWindow, which is getting called
by GL_CreateRenderer.? (Why it’s getting called is most likely due to a bug
on my end, but I’ll have to look into that later.)

Turns out SDL_RecreateWindow removes the SDL_WINDOW_FOREIGN flag from a
window, which is checked in WIN_WindowProc to decide whether or not to
forward the WM_PAINT message on to the foreign owner’s window proc.? Is
there a reason behind this, or is it an oversight?

I submitted a bug for this at http://bugzilla.libsdl.org/show_bug.cgi?id=891


SDL mailing list
SDL at lists.libsdl.org
http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org


-Sam Lantinga, Founder and President, Galaxy Gameworks LLC