mirror of https://github.com/encounter/SDL.git
X11: Set dialog hint on message boxes (thanks, Melker!).
This helps the window manager do the right thing with these windows.
This commit is contained in:
parent
39c41bb952
commit
7fd15e7e2c
|
@ -366,6 +366,7 @@ X11_MessageBoxCreateWindow( SDL_MessageBoxDataX11 *data )
|
||||||
int x, y;
|
int x, y;
|
||||||
XSizeHints *sizehints;
|
XSizeHints *sizehints;
|
||||||
XSetWindowAttributes wnd_attr;
|
XSetWindowAttributes wnd_attr;
|
||||||
|
Atom _NET_WM_WINDOW_TYPE, _NET_WM_WINDOW_TYPE_DIALOG;
|
||||||
Display *display = data->display;
|
Display *display = data->display;
|
||||||
SDL_WindowData *windowdata = NULL;
|
SDL_WindowData *windowdata = NULL;
|
||||||
const SDL_MessageBoxData *messageboxdata = data->messageboxdata;
|
const SDL_MessageBoxData *messageboxdata = data->messageboxdata;
|
||||||
|
@ -401,6 +402,13 @@ X11_MessageBoxCreateWindow( SDL_MessageBoxDataX11 *data )
|
||||||
|
|
||||||
X11_XStoreName( display, data->window, messageboxdata->title );
|
X11_XStoreName( display, data->window, messageboxdata->title );
|
||||||
|
|
||||||
|
/* Let the window manager know this is a dialog box */
|
||||||
|
_NET_WM_WINDOW_TYPE = X11_XInternAtom(display, "_NET_WM_WINDOW_TYPE", False);
|
||||||
|
_NET_WM_WINDOW_TYPE_DIALOG = X11_XInternAtom(display, "_NET_WM_WINDOW_TYPE_DIALOG", False);
|
||||||
|
X11_XChangeProperty(display, data->window, _NET_WM_WINDOW_TYPE, XA_ATOM, 32,
|
||||||
|
PropModeReplace,
|
||||||
|
(unsigned char *)&_NET_WM_WINDOW_TYPE_DIALOG, 1);
|
||||||
|
|
||||||
/* Allow the window to be deleted by the window manager */
|
/* Allow the window to be deleted by the window manager */
|
||||||
data->wm_protocols = X11_XInternAtom( display, "WM_PROTOCOLS", False );
|
data->wm_protocols = X11_XInternAtom( display, "WM_PROTOCOLS", False );
|
||||||
data->wm_delete_message = X11_XInternAtom( display, "WM_DELETE_WINDOW", False );
|
data->wm_delete_message = X11_XInternAtom( display, "WM_DELETE_WINDOW", False );
|
||||||
|
|
Loading…
Reference in New Issue