x11: set some modality things on message boxes with parent windows.
authorRyan C. Gordon <icculus@icculus.org>
Tue, 09 Jul 2019 17:28:02 -0400
changeset 129357e37d3b5e7a3
parent 12934 d03900e991a2
child 12936 fe7caa031d3e
x11: set some modality things on message boxes with parent windows.
src/video/x11/SDL_x11messagebox.c
     1.1 --- a/src/video/x11/SDL_x11messagebox.c	Tue Jul 09 11:46:42 2019 +0200
     1.2 +++ b/src/video/x11/SDL_x11messagebox.c	Tue Jul 09 17:28:02 2019 -0400
     1.3 @@ -428,6 +428,19 @@
     1.4      }
     1.5  
     1.6      if ( windowdata ) {
     1.7 +        Atom _NET_WM_STATE = X11_XInternAtom(display, "_NET_WM_STATE", False);
     1.8 +        Atom stateatoms[16];
     1.9 +        size_t statecount = 0;
    1.10 +        /* Set some message-boxy window states when attached to a parent window... */
    1.11 +        /* we skip the taskbar since this will pop to the front when the parent window is clicked in the taskbar, etc */
    1.12 +        stateatoms[statecount++] = X11_XInternAtom(display, "_NET_WM_STATE_SKIP_TASKBAR", False);
    1.13 +        stateatoms[statecount++] = X11_XInternAtom(display, "_NET_WM_STATE_SKIP_PAGER", False);
    1.14 +        stateatoms[statecount++] = X11_XInternAtom(display, "_NET_WM_STATE_FOCUSED", False);
    1.15 +        stateatoms[statecount++] = X11_XInternAtom(display, "_NET_WM_STATE_MODAL", False);
    1.16 +        SDL_assert(statecount <= SDL_arraysize(stateatoms));
    1.17 +        X11_XChangeProperty(display, data->window, _NET_WM_STATE, XA_ATOM, 32,
    1.18 +                            PropModeReplace, (unsigned char *)stateatoms, statecount);
    1.19 +
    1.20          /* http://tronche.com/gui/x/icccm/sec-4.html#WM_TRANSIENT_FOR */
    1.21          X11_XSetTransientForHint( display, data->window, windowdata->xwindow );
    1.22      }