src/video/x11/SDL_x11window.c
changeset 3078 81d15ace9129
parent 3077 9b58f26ede81
child 3161 494559cc723b
     1.1 --- a/src/video/x11/SDL_x11window.c	Thu Feb 19 06:48:25 2009 +0000
     1.2 +++ b/src/video/x11/SDL_x11window.c	Thu Feb 19 06:49:59 2009 +0000
     1.3 @@ -122,9 +122,14 @@
     1.4      }
     1.5  
     1.6      {
     1.7 -        Atom _NET_WM_STATE = XInternAtom(data->videodata->display, "_NET_WM_STATE", False);
     1.8 -        Atom _NET_WM_STATE_MAXIMIZED_VERT = XInternAtom(data->videodata->display, "_NET_WM_STATE_MAXIMIZED_VERT", False);
     1.9 -        Atom _NET_WM_STATE_MAXIMIZED_HORZ = XInternAtom(data->videodata->display, "_NET_WM_STATE_MAXIMIZED_HORZ", False);
    1.10 +        Atom _NET_WM_STATE =
    1.11 +            XInternAtom(data->videodata->display, "_NET_WM_STATE", False);
    1.12 +        Atom _NET_WM_STATE_MAXIMIZED_VERT =
    1.13 +            XInternAtom(data->videodata->display,
    1.14 +                        "_NET_WM_STATE_MAXIMIZED_VERT", False);
    1.15 +        Atom _NET_WM_STATE_MAXIMIZED_HORZ =
    1.16 +            XInternAtom(data->videodata->display,
    1.17 +                        "_NET_WM_STATE_MAXIMIZED_HORZ", False);
    1.18          Atom actualType;
    1.19          int actualFormat;
    1.20          unsigned long i, numItems, bytesAfter;
    1.21 @@ -132,9 +137,10 @@
    1.22          long maxLength = 1024;
    1.23  
    1.24          if (XGetWindowProperty(data->videodata->display, w, _NET_WM_STATE,
    1.25 -            0l, maxLength, False, XA_ATOM, &actualType, &actualFormat,
    1.26 -            &numItems, &bytesAfter, &propertyValue) == Success) {
    1.27 -            Atom *atoms = (Atom *)propertyValue;
    1.28 +                               0l, maxLength, False, XA_ATOM, &actualType,
    1.29 +                               &actualFormat, &numItems, &bytesAfter,
    1.30 +                               &propertyValue) == Success) {
    1.31 +            Atom *atoms = (Atom *) propertyValue;
    1.32              int maximized = 0;
    1.33  
    1.34              for (i = 0; i < numItems; ++i) {
    1.35 @@ -145,7 +151,7 @@
    1.36                  }
    1.37                  /* Might also want to check the following properties:
    1.38                     _NET_WM_STATE_ABOVE, _NET_WM_STATE_FULLSCREEN
    1.39 -                */
    1.40 +                 */
    1.41              }
    1.42              if (maximized == 3) {
    1.43                  window->flags |= SDL_WINDOW_MAXIMIZED;
    1.44 @@ -903,22 +909,25 @@
    1.45          (SDL_DisplayData *) SDL_GetDisplayFromWindow(window)->driverdata;
    1.46      Display *display = data->videodata->display;
    1.47      Atom _NET_WM_STATE = XInternAtom(display, "_NET_WM_STATE", False);
    1.48 -    Atom _NET_WM_STATE_MAXIMIZED_VERT = XInternAtom(display, "_NET_WM_STATE_MAXIMIZED_VERT", False);
    1.49 -    Atom _NET_WM_STATE_MAXIMIZED_HORZ = XInternAtom(display, "_NET_WM_STATE_MAXIMIZED_HORZ", False);
    1.50 +    Atom _NET_WM_STATE_MAXIMIZED_VERT =
    1.51 +        XInternAtom(display, "_NET_WM_STATE_MAXIMIZED_VERT", False);
    1.52 +    Atom _NET_WM_STATE_MAXIMIZED_HORZ =
    1.53 +        XInternAtom(display, "_NET_WM_STATE_MAXIMIZED_HORZ", False);
    1.54      XEvent e;
    1.55  
    1.56      e.xany.type = ClientMessage;
    1.57      e.xany.window = data->window;
    1.58      e.xclient.message_type = _NET_WM_STATE;
    1.59      e.xclient.format = 32;
    1.60 -    e.xclient.data.l[0] = maximized ? _NET_WM_STATE_ADD : _NET_WM_STATE_REMOVE;
    1.61 +    e.xclient.data.l[0] =
    1.62 +        maximized ? _NET_WM_STATE_ADD : _NET_WM_STATE_REMOVE;
    1.63      e.xclient.data.l[1] = _NET_WM_STATE_MAXIMIZED_VERT;
    1.64      e.xclient.data.l[2] = _NET_WM_STATE_MAXIMIZED_HORZ;
    1.65      e.xclient.data.l[3] = 0l;
    1.66      e.xclient.data.l[4] = 0l;
    1.67  
    1.68      XSendEvent(display, RootWindow(display, displaydata->screen), 0,
    1.69 -               SubstructureNotifyMask|SubstructureRedirectMask, &e);
    1.70 +               SubstructureNotifyMask | SubstructureRedirectMask, &e);
    1.71  }
    1.72  
    1.73  void