WM_DELETE_WINDOW should check that the event message_type is WM_PROTOCOLS.
This commit is contained in:
parent
9baa49f61c
commit
d7d06ad754
3 changed files with 4 additions and 1 deletions
|
@ -386,7 +386,8 @@ X11_DispatchEvent(_THIS)
|
|||
|
||||
/* Have we been requested to quit (or another client message?) */
|
||||
case ClientMessage:{
|
||||
if ((xevent.xclient.format == 32) &&
|
||||
if ((xevent.xclient.message_type == videodata->WM_PROTOCOLS) &&
|
||||
(xevent.xclient.format == 32) &&
|
||||
(xevent.xclient.data.l[0] == videodata->WM_DELETE_WINDOW)) {
|
||||
|
||||
SDL_SendWindowEvent(data->window, SDL_WINDOWEVENT_CLOSE, 0, 0);
|
||||
|
|
|
@ -370,6 +370,7 @@ X11_VideoInit(_THIS)
|
|||
|
||||
/* Look up some useful Atoms */
|
||||
#define GET_ATOM(X) data->X = XInternAtom(data->display, #X, False)
|
||||
GET_ATOM(WM_PROTOCOLS);
|
||||
GET_ATOM(WM_DELETE_WINDOW);
|
||||
GET_ATOM(_NET_WM_STATE);
|
||||
GET_ATOM(_NET_WM_STATE_HIDDEN);
|
||||
|
|
|
@ -80,6 +80,7 @@ typedef struct SDL_VideoData
|
|||
SDL_bool net_wm;
|
||||
|
||||
/* Useful atoms */
|
||||
Atom WM_PROTOCOLS;
|
||||
Atom WM_DELETE_WINDOW;
|
||||
Atom _NET_WM_STATE;
|
||||
Atom _NET_WM_STATE_HIDDEN;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue