mirror of
https://github.com/scratchfoundation/bgfx.git
synced 2024-11-28 18:45:54 -05:00
Merge pull request #41 from jsimmons/master
Handle exit message from window manager on Linux
This commit is contained in:
commit
f8eabc86c7
1 changed files with 12 additions and 0 deletions
|
@ -160,6 +160,11 @@ namespace entry
|
||||||
, &windowAttrs
|
, &windowAttrs
|
||||||
);
|
);
|
||||||
|
|
||||||
|
const char *wmDeleteWindowName = "WM_DELETE_WINDOW";
|
||||||
|
Atom wmDeleteWindow;
|
||||||
|
XInternAtoms(m_display, (char **)&wmDeleteWindowName, 1, False, &wmDeleteWindow);
|
||||||
|
XSetWMProtocols(m_display, m_window, &wmDeleteWindow, 1);
|
||||||
|
|
||||||
XMapWindow(m_display, m_window);
|
XMapWindow(m_display, m_window);
|
||||||
XStoreName(m_display, m_window, "BGFX");
|
XStoreName(m_display, m_window, "BGFX");
|
||||||
|
|
||||||
|
@ -187,6 +192,13 @@ namespace entry
|
||||||
case ConfigureNotify:
|
case ConfigureNotify:
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
case ClientMessage:
|
||||||
|
if((Atom)event.xclient.data.l[0] == wmDeleteWindow)
|
||||||
|
{
|
||||||
|
m_eventQueue.postExitEvent();
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
|
||||||
case ButtonPress:
|
case ButtonPress:
|
||||||
case ButtonRelease:
|
case ButtonRelease:
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in a new issue