From 988077804fae5351dd8826d49d3efac4fcfe6e3e Mon Sep 17 00:00:00 2001 From: kingscallop <54776947+kingscallop@users.noreply.github.com> Date: Sat, 18 Jul 2020 19:41:01 +0100 Subject: [PATCH] Fix X11 flicker when window is being resized (#2203) --- examples/common/entry/entry_x11.cpp | 17 ++++------------- 1 file changed, 4 insertions(+), 13 deletions(-) diff --git a/examples/common/entry/entry_x11.cpp b/examples/common/entry/entry_x11.cpp index d51c17c0a..16d6b124d 100644 --- a/examples/common/entry/entry_x11.cpp +++ b/examples/common/entry/entry_x11.cpp @@ -354,8 +354,9 @@ namespace entry m_root = RootWindow(m_display, screen); bx::memSet(&m_windowAttrs, 0, sizeof(m_windowAttrs) ); - m_windowAttrs.background_pixmap = 0; + m_windowAttrs.background_pixel = 0; m_windowAttrs.border_pixel = 0; + m_windowAttrs.bit_gravity = StaticGravity; m_windowAttrs.event_mask = 0 | ButtonPressMask | ButtonReleaseMask @@ -374,15 +375,10 @@ namespace entry , m_depth , InputOutput , m_visual - , CWBorderPixel|CWEventMask + , CWBorderPixel|CWEventMask|CWBackPixel|CWBitGravity , &m_windowAttrs ); - // Clear window to black. - XSetWindowAttributes attr; - bx::memSet(&attr, 0, sizeof(attr) ); - XChangeWindowAttributes(m_display, m_window[0], CWBackPixel, &attr); - const char* wmDeleteWindowName = "WM_DELETE_WINDOW"; Atom wmDeleteWindow; XInternAtoms(m_display, (char **)&wmDeleteWindowName, 1, False, &wmDeleteWindow); @@ -599,16 +595,11 @@ namespace entry , m_depth , InputOutput , m_visual - , CWBorderPixel|CWEventMask + , CWBorderPixel|CWEventMask|CWBackPixel|CWBitGravity , &m_windowAttrs ); m_window[_handle.idx] = window; - // Clear window to black. - XSetWindowAttributes attr; - bx::memSet(&attr, 0, sizeof(attr) ); - XChangeWindowAttributes(m_display, window, CWBackPixel, &attr); - const char* wmDeleteWindowName = "WM_DELETE_WINDOW"; Atom wmDeleteWindow; XInternAtoms(m_display, (char **)&wmDeleteWindowName, 1, False, &wmDeleteWindow);