Skip to content

Commit

Permalink
Fixed bug 2101 - CWBackPixel causes weird window flickering on window…
Browse files Browse the repository at this point in the history
… resize

aBothe

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.
  • Loading branch information
slouken committed Sep 28, 2013
1 parent b956777 commit 8b6ad7f
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/video/x11/SDL_x11window.c
Expand Up @@ -395,7 +395,7 @@ X11_CreateWindow(_THIS, SDL_Window * window)
}

xattr.override_redirect = False;
xattr.background_pixel = 0;
xattr.background_pixmap = None;
xattr.border_pixel = 0;

if (visual->class == DirectColor) {
Expand Down Expand Up @@ -480,7 +480,7 @@ X11_CreateWindow(_THIS, SDL_Window * window)
w = XCreateWindow(display, RootWindow(display, screen),
window->x, window->y, window->w, window->h,
0, depth, InputOutput, visual,
(CWOverrideRedirect | CWBackPixel | CWBorderPixel |
(CWOverrideRedirect | CWBackPixmap | CWBorderPixel |
CWColormap), &xattr);
if (!w) {
return SDL_SetError("Couldn't create window");
Expand Down

0 comments on commit 8b6ad7f

Please sign in to comment.