x11: Post size event when initializing window.

This commit is contained in:
Branimir Karadzic 2014-09-24 21:05:48 -07:00
parent 4a1eb54563
commit 22614cf946
3 changed files with 4 additions and 1 deletions
examples
22-windows
common/entry
scripts

View file

@ -163,7 +163,7 @@ int _main_(int /*_argc*/, char** /*_argv*/)
uint8_t viewId = (uint8_t)state.m_handle.idx;
entry::WindowState& win = windows[viewId];
if (win.m_nwh != state.m_nwh
if (win.m_nwh != state.m_nwh
|| (win.m_width != state.m_width
|| win.m_height != state.m_height) )
{

View file

@ -184,6 +184,7 @@ namespace entry
thread.init(mte.threadFunc, &mte);
WindowHandle defaultWindow = { 0 };
m_eventQueue.postSizeEvent(defaultWindow, ENTRY_DEFAULT_WIDTH, ENTRY_DEFAULT_HEIGHT);
while (!m_exit)
{
@ -277,6 +278,7 @@ namespace entry
{
const XResizeRequestEvent& xresize = event.xresizerequest;
XResizeWindow(m_display, m_window, xresize.width, xresize.height);
m_eventQueue.postSizeEvent(defaultWindow, xresize.width, xresize.height);
}
break;
}

View file

@ -210,6 +210,7 @@ exampleProject("18-ibl")
exampleProject("19-oit")
exampleProject("20-nanovg")
exampleProject("21-deferred")
exampleProject("22-windows")
if _OPTIONS["with-shared-lib"] then
bgfxProject("-shared-lib", "SharedLib", {})