x11: Clear window after initialization.

This commit is contained in:
Branimir Karadzic 2014-09-22 20:37:49 -07:00
parent de3d152b9c
commit e0ab81d387

View file

@ -160,7 +160,12 @@ namespace entry
, &windowAttrs , &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; Atom wmDeleteWindow;
XInternAtoms(m_display, (char **)&wmDeleteWindowName, 1, False, &wmDeleteWindow); XInternAtoms(m_display, (char **)&wmDeleteWindowName, 1, False, &wmDeleteWindow);
XSetWMProtocols(m_display, m_window, &wmDeleteWindow, 1); XSetWMProtocols(m_display, m_window, &wmDeleteWindow, 1);
@ -168,6 +173,7 @@ namespace entry
XMapWindow(m_display, m_window); XMapWindow(m_display, m_window);
XStoreName(m_display, m_window, "BGFX"); XStoreName(m_display, m_window, "BGFX");
//
bgfx::x11SetDisplayWindow(m_display, m_window); bgfx::x11SetDisplayWindow(m_display, m_window);
MainThreadEntry mte; MainThreadEntry mte;
@ -195,7 +201,7 @@ namespace entry
break; break;
case ClientMessage: case ClientMessage:
if((Atom)event.xclient.data.l[0] == wmDeleteWindow) if ( (Atom)event.xclient.data.l[0] == wmDeleteWindow)
{ {
m_eventQueue.postExitEvent(); m_eventQueue.postExitEvent();
} }
@ -357,7 +363,8 @@ namespace entry
void setWindowTitle(WindowHandle _handle, const char* _title) 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) void toggleWindowFrame(WindowHandle _handle)