src/video/x11/SDL_x11window.c
changeset 6486 e3264eea9607
parent 6485 3f600ccf393c
child 6487 b18a011ecc45
equal deleted inserted replaced
6485:3f600ccf393c 6486:e3264eea9607
   116 
   116 
   117 int
   117 int
   118 X11_GetWMStateProperty(_THIS, Uint32 flags, Atom atoms[5])
   118 X11_GetWMStateProperty(_THIS, Uint32 flags, Atom atoms[5])
   119 {
   119 {
   120     SDL_VideoData *videodata = (SDL_VideoData *) _this->driverdata;
   120     SDL_VideoData *videodata = (SDL_VideoData *) _this->driverdata;
   121     Atom _NET_WM_STATE_HIDDEN = videodata->_NET_WM_STATE_HIDDEN;
   121     /*Atom _NET_WM_STATE_HIDDEN = videodata->_NET_WM_STATE_HIDDEN;*/
   122     Atom _NET_WM_STATE_FOCUSED = videodata->_NET_WM_STATE_FOCUSED;
   122     Atom _NET_WM_STATE_FOCUSED = videodata->_NET_WM_STATE_FOCUSED;
   123     Atom _NET_WM_STATE_MAXIMIZED_VERT = videodata->_NET_WM_STATE_MAXIMIZED_VERT;
   123     Atom _NET_WM_STATE_MAXIMIZED_VERT = videodata->_NET_WM_STATE_MAXIMIZED_VERT;
   124     Atom _NET_WM_STATE_MAXIMIZED_HORZ = videodata->_NET_WM_STATE_MAXIMIZED_HORZ;
   124     Atom _NET_WM_STATE_MAXIMIZED_HORZ = videodata->_NET_WM_STATE_MAXIMIZED_HORZ;
   125     Atom _NET_WM_STATE_FULLSCREEN = videodata->_NET_WM_STATE_FULLSCREEN;
   125     Atom _NET_WM_STATE_FULLSCREEN = videodata->_NET_WM_STATE_FULLSCREEN;
   126     int count = 0;
   126     int count = 0;
   127 
   127 
       
   128     /* The window manager sets this property, we shouldn't set it.
       
   129        If we did, this would indicate to the window manager that we don't
       
   130        actually want to be mapped during XMapRaised(), which would be bad.
       
   131      *
   128     if (flags & SDL_WINDOW_HIDDEN) {
   132     if (flags & SDL_WINDOW_HIDDEN) {
   129         atoms[count++] = _NET_WM_STATE_HIDDEN;
   133         atoms[count++] = _NET_WM_STATE_HIDDEN;
   130     }
   134     }
       
   135     */
   131     if (flags & SDL_WINDOW_INPUT_FOCUS) {
   136     if (flags & SDL_WINDOW_INPUT_FOCUS) {
   132         atoms[count++] = _NET_WM_STATE_FOCUSED;
   137         atoms[count++] = _NET_WM_STATE_FOCUSED;
   133     }
   138     }
   134     if (flags & SDL_WINDOW_MAXIMIZED) {
   139     if (flags & SDL_WINDOW_MAXIMIZED) {
   135         atoms[count++] = _NET_WM_STATE_MAXIMIZED_VERT;
   140         atoms[count++] = _NET_WM_STATE_MAXIMIZED_VERT;
   167         int maximized = 0;
   172         int maximized = 0;
   168         int fullscreen = 0;
   173         int fullscreen = 0;
   169 
   174 
   170         for (i = 0; i < numItems; ++i) {
   175         for (i = 0; i < numItems; ++i) {
   171             if (atoms[i] == _NET_WM_STATE_HIDDEN) {
   176             if (atoms[i] == _NET_WM_STATE_HIDDEN) {
   172                 flags |= (SDL_WINDOW_HIDDEN|SDL_WINDOW_MINIMIZED);
   177                 flags |= SDL_WINDOW_HIDDEN;
   173             } else if (atoms[i] == _NET_WM_STATE_FOCUSED) {
   178             } else if (atoms[i] == _NET_WM_STATE_FOCUSED) {
   174                 flags |= SDL_WINDOW_INPUT_FOCUS;
   179                 flags |= SDL_WINDOW_INPUT_FOCUS;
   175             } else if (atoms[i] == _NET_WM_STATE_MAXIMIZED_VERT) {
   180             } else if (atoms[i] == _NET_WM_STATE_MAXIMIZED_VERT) {
   176                 maximized |= 1;
   181                 maximized |= 1;
   177             } else if (atoms[i] == _NET_WM_STATE_MAXIMIZED_HORZ) {
   182             } else if (atoms[i] == _NET_WM_STATE_MAXIMIZED_HORZ) {