source/Platform/Unix/X11Display.cpp: call XSetWMProtocols with "WM_DELETE_WINDOW" flag.
This commit is contained in:
parent
d94c7fcf9a
commit
46bf27f4a4
1 changed files with 6 additions and 0 deletions
|
|
@ -19,6 +19,7 @@ bool X11Display::create(DisplayDescription description)
|
|||
{
|
||||
XSetWindowAttributes attr;
|
||||
XVisualInfo* vi;
|
||||
Atom protocols;
|
||||
|
||||
m_disp = XGetDisplay();
|
||||
if (m_disp == NULL) {
|
||||
|
|
@ -44,6 +45,11 @@ bool X11Display::create(DisplayDescription description)
|
|||
InputOutput, DefaultVisual(m_disp, m_screen),
|
||||
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);
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue