From 23ab03ec915c49d143d0efecf68f904e5667cb41 Mon Sep 17 00:00:00 2001 From: David Rose Date: Sat, 12 Sep 2009 01:48:40 +0000 Subject: [PATCH] issue with XClearArea and 0-width areas --- direct/src/plugin/p3dX11SplashWindow.cxx | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/direct/src/plugin/p3dX11SplashWindow.cxx b/direct/src/plugin/p3dX11SplashWindow.cxx index ddd6c6baac..ec3428db46 100755 --- a/direct/src/plugin/p3dX11SplashWindow.cxx +++ b/direct/src/plugin/p3dX11SplashWindow.cxx @@ -722,10 +722,18 @@ redraw() { // Then clear the rectangles around it carefully (rather than just // clearing the whole window first, to avoid flicking). - XClearArea(_display, _window, 0, 0, _win_width, yo, False); - XClearArea(_display, _window, 0, yo, xo, _composite_height, False); - XClearArea(_display, _window, _win_width - xo, yo, xo, _composite_height, False); - XClearArea(_display, _window, 0, _win_height - yo, _win_width, yo, False); + if (yo != 0 && _win_width != 0) { + // Top + XClearArea(_display, _window, 0, 0, _win_width, yo, False); + // Bottom + XClearArea(_display, _window, 0, _win_height - yo, _win_width, yo, False); + } + if (xo != 0 && _composite_height != 0) { + // Left + XClearArea(_display, _window, 0, yo, xo, _composite_height, False); + // Right + XClearArea(_display, _window, _win_width - xo, yo, xo, _composite_height, False); + } } }