Skip to content
This repository has been archived by the owner. It is now read-only.
Permalink
Browse files

WM_DELETE_WINDOW should check that the event message_type is WM_PROTO…

…COLS.
  • Loading branch information
icculus committed Nov 2, 2012
1 parent 94c52ef commit 0659ddd887cd32ae522cb9d7d4fd6dfee3d663a6
Showing with 4 additions and 1 deletion.
  1. +2 −1 src/video/x11/SDL_x11events.c
  2. +1 −0 src/video/x11/SDL_x11video.c
  3. +1 −0 src/video/x11/SDL_x11video.h
@@ -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;

0 comments on commit 0659ddd

Please sign in to comment.