# HG changeset patch # User ib # Date 1359043057 0 # Node ID 589cf8a5f165362f8a291eb5da021bd8af17852d # Parent 5b5a3108e59fa1168b8f06065339e4c1ba77e041 Realize a smooth and flicker-free video when resizing during playback. During playback, prevent the window manager from automatically refresh the background of the video window by setting the video window's background to no defined background pixmap. After playback, set the window's background again. Additionally, add a doygen comment for wsWindowBackground() and remove an old comment. Patch with grateful support by Hans-Dieter Kosch, hdkosch kabelbw de. diff -r 5b5a3108e59f -r 589cf8a5f165 gui/interface.c --- a/gui/interface.c Thu Jan 24 15:34:10 2013 +0000 +++ b/gui/interface.c Thu Jan 24 15:57:37 2013 +0000 @@ -787,6 +787,8 @@ if (guiWinID >= 0) wsWindowMove(&guiApp.mainWindow, True, 0, guiInfo.VideoHeight); + wsWindowBackground(&guiApp.videoWindow, -1, -1, -1); + break; case GUI_HANDLE_X_EVENT: diff -r 5b5a3108e59f -r 589cf8a5f165 gui/wm/ws.c --- a/gui/wm/ws.c Thu Jan 24 15:34:10 2013 +0000 +++ b/gui/wm/ws.c Thu Jan 24 15:57:37 2013 +0000 @@ -1019,9 +1019,6 @@ } } -// ---------------------------------------------------------------------------------------------- -// Set window background to 'color'. -// ---------------------------------------------------------------------------------------------- /** * @brief Pack color components @a r, @a g and @a b into 15 bits. * @@ -1066,6 +1063,16 @@ return pixel; } +/** + * @brief Set and fill, or unset a window background. + * + * @param win pointer to a ws window structure + * @param r red (0 - 255, or -1) + * @param g green (0 - 255, or -1) + * @param b blue (0 - 255, or -1) + * + * @note Passing -1 for @a r, @a g and @a b unsets the background. + */ void wsWindowBackground(wsWindow *win, int r, int g, int b) { int color = 0; @@ -1101,8 +1108,12 @@ ; } + if (r == -1 && g == -1 && b == -1) + XSetWindowBackgroundPixmap(wsDisplay, win->WindowID, None); + else { XSetWindowBackground(wsDisplay, win->WindowID, color); XClearWindow(wsDisplay, win->WindowID); + } } // ----------------------------------------------------------------------------------------------