source/Platform/Unix/X11Display.cpp: call XSetWMProtocols with "WM_DELETE_WINDOW" flag.
This commit is contained in:
parent
776904ee9a
commit
62156a8685
1 changed files with 6 additions and 0 deletions
|
|
@ -19,6 +19,7 @@ bool X11Display::create(DisplayDescription description)
|
||||||
{
|
{
|
||||||
XSetWindowAttributes attr;
|
XSetWindowAttributes attr;
|
||||||
XVisualInfo* vi;
|
XVisualInfo* vi;
|
||||||
|
Atom protocols;
|
||||||
|
|
||||||
m_disp = XGetDisplay();
|
m_disp = XGetDisplay();
|
||||||
if (m_disp == NULL) {
|
if (m_disp == NULL) {
|
||||||
|
|
@ -44,6 +45,11 @@ bool X11Display::create(DisplayDescription description)
|
||||||
InputOutput, DefaultVisual(m_disp, m_screen),
|
InputOutput, DefaultVisual(m_disp, m_screen),
|
||||||
CWBackPixel | CWColormap | CWBorderPixel | CWEventMask, &attr);
|
CWBackPixel | CWColormap | CWBorderPixel | CWEventMask, &attr);
|
||||||
|
|
||||||
|
// X11 does not handle pressing the X button on a window.
|
||||||
|
// that is the job of the window manager.
|
||||||
|
// Here we can request the WM to send us a delete event so we can handle it ourself.
|
||||||
|
protocols = getAtom("WM_DELETE_WINDOW");
|
||||||
|
XSetWMProtocols(m_disp, m_win, &protocols, 1);
|
||||||
|
|
||||||
XMapWindow(m_disp, m_win);
|
XMapWindow(m_disp, m_win);
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue