From e0ab81d38751d7e28608b49b4f2f973db6336e38 Mon Sep 17 00:00:00 2001 From: Branimir Karadzic Date: Mon, 22 Sep 2014 20:37:49 -0700 Subject: [PATCH] x11: Clear window after initialization. --- examples/common/entry/entry_x11.cpp | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/examples/common/entry/entry_x11.cpp b/examples/common/entry/entry_x11.cpp index 3046554e..7d5a195c 100644 --- a/examples/common/entry/entry_x11.cpp +++ b/examples/common/entry/entry_x11.cpp @@ -160,7 +160,12 @@ namespace entry , &windowAttrs ); - const char *wmDeleteWindowName = "WM_DELETE_WINDOW"; + // Clear window to black. + XSetWindowAttributes attr; + memset(&attr, 0, sizeof(attr) ); + XChangeWindowAttributes(m_display, m_window, CWBackPixel, &attr); + + const char* wmDeleteWindowName = "WM_DELETE_WINDOW"; Atom wmDeleteWindow; XInternAtoms(m_display, (char **)&wmDeleteWindowName, 1, False, &wmDeleteWindow); XSetWMProtocols(m_display, m_window, &wmDeleteWindow, 1); @@ -168,6 +173,7 @@ namespace entry XMapWindow(m_display, m_window); XStoreName(m_display, m_window, "BGFX"); + // bgfx::x11SetDisplayWindow(m_display, m_window); MainThreadEntry mte; @@ -195,7 +201,7 @@ namespace entry break; case ClientMessage: - if((Atom)event.xclient.data.l[0] == wmDeleteWindow) + if ( (Atom)event.xclient.data.l[0] == wmDeleteWindow) { m_eventQueue.postExitEvent(); } @@ -357,7 +363,8 @@ namespace entry void setWindowTitle(WindowHandle _handle, const char* _title) { - BX_UNUSED(_handle, _title); + BX_UNUSED(_handle); + XStoreName(s_ctx.m_display, s_ctx.m_window, _title); } void toggleWindowFrame(WindowHandle _handle)