We are currently migrating Bugzilla to GitHub issues.
Any changes made to the bug tracker now will be lost, so please do not post new bugs or make changes to them.
When we're done, all bug URLs will redirect to their equivalent location on the new bug tracker.

Bug 2101 - CWBackPixel causes weird window flickering on window resize
Summary: CWBackPixel causes weird window flickering on window resize
Status: RESOLVED FIXED
Alias: None
Product: SDL
Classification: Unclassified
Component: video (show other bugs)
Version: HG 2.1
Hardware: x86_64 Linux
: P2 normal
Assignee: Sam Lantinga
QA Contact: Sam Lantinga
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2013-09-16 22:40 UTC by aBothe
Modified: 2013-09-28 17:27 UTC (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description aBothe 2013-09-16 22:40:41 UTC
See (at least) this code line (I'm not zielmicha!)
https://github.com/zielmicha/SDL2/blob/master/src/video/x11/SDL_x11window.c#L461

I tried to experiment a bit with SDL2 and OpenGL today and noticed that something caused some weird flickering when resizing my nicely drawn SDL2/OpenGL window:
Just after resizing, the background went black and I had to let my OpenGL code redraw the contents.. 
However, after some hours spent with googling I found out that in OpenGL examples where this CWBackPixel flag was not used when creating X windows, there was no flickering while resizing the window.

See http://www.sbin.org/doc/Xlib/chapt_04.html @ "The Window Background" for more info.

If you don't want to make any changes concerning this issue (I'm btw not the only one having trouble with this :-)), how could I reset this really annoying flag after the window creation using SDL API?

Thanks in advance!
Comment 1 Sam Lantinga 2013-09-28 06:49:29 UTC
According to the documentation either the background pixel or the background pixmap must be set.  I think the default is to have the background pixmap set to None, but I went ahead and set that explicitly.
http://hg.libsdl.org/SDL/rev/48acb5c00c4b

Can you try this change in the latest snapshot?
http://www.libsdl.org/tmp/SDL-2.0.zip

Thanks!
Comment 2 aBothe 2013-09-28 10:47:55 UTC
Awesome, it's fixed! Thank you! :-)
Comment 3 Sam Lantinga 2013-09-28 17:27:11 UTC
You're welcome! :)