From 44f405b5460f6163e8772095de9a64082b76f075 Mon Sep 17 00:00:00 2001 From: Bent Bisballe Nyeng Date: Fri, 3 Feb 2017 19:58:12 +0100 Subject: Remove background flickering on window resize. --- plugingui/nativewindow_x11.cc | 20 ++++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) (limited to 'plugingui/nativewindow_x11.cc') diff --git a/plugingui/nativewindow_x11.cc b/plugingui/nativewindow_x11.cc index 353a371..5bb6474 100644 --- a/plugingui/nativewindow_x11.cc +++ b/plugingui/nativewindow_x11.cc @@ -49,8 +49,6 @@ NativeWindowX11::NativeWindowX11(void* native_window, Window& window) screen = DefaultScreen(display); - int clearColor = 0xbbbbbb; - ::Window parentWindow; if(native_window) { @@ -63,12 +61,18 @@ NativeWindowX11::NativeWindowX11(void* native_window, Window& window) // Create the window unsigned long border = 0; - xwindow = XCreateSimpleWindow(display, - parentWindow, - window.x(), window.y(), - window.width(), window.height(), - border, - clearColor, clearColor); + XSetWindowAttributes swa; + swa.backing_store = Always; + xwindow = XCreateWindow(display, + parentWindow, + window.x(), window.y(), + window.width(), window.height(), + border, + CopyFromParent, // depth + CopyFromParent, // class + CopyFromParent, // visual + CWBackingStore, + &swa); long mask = (StructureNotifyMask | PointerMotionMask | -- cgit v1.2.3