From 6ef01e5236a47f22c3c2008ac7caf44191acdd15 Mon Sep 17 00:00:00 2001 From: "Ryan C. Gordon" Date: Tue, 9 Jul 2019 17:28:02 -0400 Subject: [PATCH] x11: set some modality things on message boxes with parent windows. --- src/video/x11/SDL_x11messagebox.c | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/src/video/x11/SDL_x11messagebox.c b/src/video/x11/SDL_x11messagebox.c index f845b023c4f01..adf6821642455 100644 --- a/src/video/x11/SDL_x11messagebox.c +++ b/src/video/x11/SDL_x11messagebox.c @@ -428,6 +428,19 @@ X11_MessageBoxCreateWindow( SDL_MessageBoxDataX11 *data ) } if ( windowdata ) { + Atom _NET_WM_STATE = X11_XInternAtom(display, "_NET_WM_STATE", False); + Atom stateatoms[16]; + size_t statecount = 0; + /* Set some message-boxy window states when attached to a parent window... */ + /* we skip the taskbar since this will pop to the front when the parent window is clicked in the taskbar, etc */ + stateatoms[statecount++] = X11_XInternAtom(display, "_NET_WM_STATE_SKIP_TASKBAR", False); + stateatoms[statecount++] = X11_XInternAtom(display, "_NET_WM_STATE_SKIP_PAGER", False); + stateatoms[statecount++] = X11_XInternAtom(display, "_NET_WM_STATE_FOCUSED", False); + stateatoms[statecount++] = X11_XInternAtom(display, "_NET_WM_STATE_MODAL", False); + SDL_assert(statecount <= SDL_arraysize(stateatoms)); + X11_XChangeProperty(display, data->window, _NET_WM_STATE, XA_ATOM, 32, + PropModeReplace, (unsigned char *)stateatoms, statecount); + /* http://tronche.com/gui/x/icccm/sec-4.html#WM_TRANSIENT_FOR */ X11_XSetTransientForHint( display, data->window, windowdata->xwindow ); }