tree 8cad5878bfbb parent bc377d47ddd2 author Edward Rudd 1348625301 14400 committer Edward Rudd 1348625301 14400 revision 6456 branch default add in workaround for compiz fullscreen support diff --git a/src/video/x11/SDL_x11video.c b/src/video/x11/SDL_x11video.c --- a/src/video/x11/SDL_x11video.c +++ b/src/video/x11/SDL_x11video.c @@ -339,6 +339,8 @@ GET_ATOM(_NET_WM_STATE_MAXIMIZED_VERT); GET_ATOM(_NET_WM_STATE_MAXIMIZED_HORZ); GET_ATOM(_NET_WM_STATE_FULLSCREEN); + GET_ATOM(_NET_WM_ALLOWED_ACTIONS); + GET_ATOM(_NET_WM_ACTION_FULLSCREEN); GET_ATOM(_NET_WM_NAME); GET_ATOM(_NET_WM_ICON_NAME); GET_ATOM(_NET_WM_ICON); diff --git a/src/video/x11/SDL_x11video.h b/src/video/x11/SDL_x11video.h --- a/src/video/x11/SDL_x11video.h +++ b/src/video/x11/SDL_x11video.h @@ -86,6 +86,8 @@ Atom _NET_WM_STATE_MAXIMIZED_VERT; Atom _NET_WM_STATE_MAXIMIZED_HORZ; Atom _NET_WM_STATE_FULLSCREEN; + Atom _NET_WM_ALLOWED_ACTIONS; + Atom _NET_WM_ACTION_FULLSCREEN; Atom _NET_WM_NAME; Atom _NET_WM_ICON_NAME; Atom _NET_WM_ICON; diff --git a/src/video/x11/SDL_x11window.c b/src/video/x11/SDL_x11window.c --- a/src/video/x11/SDL_x11window.c +++ b/src/video/x11/SDL_x11window.c @@ -736,6 +736,29 @@ { return ev->type == ConfigureNotify && ev->xunmap.window == *((Window*)win); } +static Bool isActionAllowed(SDL_WindowData *data, Atom action) +{ + Atom _NET_WM_ALLOWED_ACTIONS = data->videodata->_NET_WM_ALLOWED_ACTIONS; + Atom type; + Display *display = data->videodata->display; + int form; + unsigned long remain; + unsigned long len, i; + Atom *list; + Bool ret = False; + if (XGetWindowProperty(display, data->xwindow, _NET_WM_ALLOWED_ACTIONS, 0, 1024, False, XA_ATOM, &type, &form, &len, &remain, (unsigned char **)&list) == Success) + { + for (i=0; ivideodata->_NET_WM_ACTION_FULLSCREEN)) + { + // We aren't allowed to go into fullscreen mode + if ((window->flags & SDL_WINDOW_RESIZABLE)==0) { + // hmm we aren't resizable. Window manage must be compiz... + XSizeHints *sizehints = XAllocSizeHints(); + long flags; + XGetWMNormalHints(display, data->xwindow, sizehints, &flags); + // set the resize flags on + sizehints->flags |= PMinSize | PMaxSize; + if (fullscreen) { + // we are going fullscreen so turn the flags off + sizehints->flags ^= (PMinSize | PMaxSize); + } else { + // Reset the min/max width height to make the window non-resizable again + sizehints->min_width = sizehints->max_width = window->w; + sizehints->min_height = sizehints->max_height = window->h; + } + XSetWMNormalHints(display, data->xwindow, sizehints); + XFree(sizehints); + } + } + SDL_zero(e); e.xany.type = ClientMessage; e.xclient.message_type = _NET_WM_STATE;