src/video/x11/SDL_x11window.c
changeset 2876 3fcb0d447bcd
parent 2875 91a7e08cd238
child 2931 e705adf6f3dc
     1.1 --- a/src/video/x11/SDL_x11window.c	Wed Dec 17 07:17:54 2008 +0000
     1.2 +++ b/src/video/x11/SDL_x11window.c	Wed Dec 17 07:19:55 2008 +0000
     1.3 @@ -287,7 +287,8 @@
     1.4                              visual, AllocNone);
     1.5      }
     1.6  
     1.7 -    if ((window->flags & SDL_WINDOW_FULLSCREEN) || window->x == SDL_WINDOWPOS_CENTERED) {
     1.8 +    if ((window->flags & SDL_WINDOW_FULLSCREEN)
     1.9 +        || window->x == SDL_WINDOWPOS_CENTERED) {
    1.10          x = (DisplayWidth(data->display, displaydata->screen) -
    1.11               window->w) / 2;
    1.12      } else if (window->x == SDL_WINDOWPOS_UNDEFINED) {
    1.13 @@ -295,7 +296,8 @@
    1.14      } else {
    1.15          x = window->x;
    1.16      }
    1.17 -    if ((window->flags & SDL_WINDOW_FULLSCREEN) || window->y == SDL_WINDOWPOS_CENTERED) {
    1.18 +    if ((window->flags & SDL_WINDOW_FULLSCREEN)
    1.19 +        || window->y == SDL_WINDOWPOS_CENTERED) {
    1.20          y = (DisplayHeight(data->display, displaydata->screen) -
    1.21               window->h) / 2;
    1.22      } else if (window->y == SDL_WINDOWPOS_UNDEFINED) {
    1.23 @@ -321,7 +323,8 @@
    1.24  
    1.25      sizehints = XAllocSizeHints();
    1.26      if (sizehints) {
    1.27 -        if ((window->flags & SDL_WINDOW_RESIZABLE) && !(window->flags & SDL_WINDOW_FULLSCREEN)) {
    1.28 +        if ((window->flags & SDL_WINDOW_RESIZABLE)
    1.29 +            && !(window->flags & SDL_WINDOW_FULLSCREEN)) {
    1.30              sizehints->min_width = 32;
    1.31              sizehints->min_height = 32;
    1.32              sizehints->max_height = 4096;
    1.33 @@ -342,7 +345,7 @@
    1.34          XFree(sizehints);
    1.35      }
    1.36  
    1.37 -    if (window->flags & (SDL_WINDOW_BORDERLESS|SDL_WINDOW_FULLSCREEN)) {
    1.38 +    if (window->flags & (SDL_WINDOW_BORDERLESS | SDL_WINDOW_FULLSCREEN)) {
    1.39          SDL_bool set;
    1.40          Atom WM_HINTS;
    1.41  
    1.42 @@ -603,12 +606,14 @@
    1.43      Display *display = data->videodata->display;
    1.44      int x, y;
    1.45  
    1.46 -    if ((window->flags & SDL_WINDOW_FULLSCREEN) || window->x == SDL_WINDOWPOS_CENTERED) {
    1.47 +    if ((window->flags & SDL_WINDOW_FULLSCREEN)
    1.48 +        || window->x == SDL_WINDOWPOS_CENTERED) {
    1.49          x = (DisplayWidth(display, displaydata->screen) - window->w) / 2;
    1.50      } else {
    1.51          x = window->x;
    1.52      }
    1.53 -    if ((window->flags & SDL_WINDOW_FULLSCREEN) || window->y == SDL_WINDOWPOS_CENTERED) {
    1.54 +    if ((window->flags & SDL_WINDOW_FULLSCREEN)
    1.55 +        || window->y == SDL_WINDOWPOS_CENTERED) {
    1.56          y = (DisplayHeight(display, displaydata->screen) - window->h) / 2;
    1.57      } else {
    1.58          y = window->y;
    1.59 @@ -676,12 +681,14 @@
    1.60      SDL_WindowData *data = (SDL_WindowData *) window->driverdata;
    1.61      Display *display = data->videodata->display;
    1.62  
    1.63 -    if ((window->flags & (SDL_WINDOW_INPUT_GRABBED|SDL_WINDOW_FULLSCREEN)) &&
    1.64 -        (window->flags & SDL_WINDOW_INPUT_FOCUS)) {
    1.65 +    if ((window->flags & (SDL_WINDOW_INPUT_GRABBED | SDL_WINDOW_FULLSCREEN))
    1.66 +        && (window->flags & SDL_WINDOW_INPUT_FOCUS)) {
    1.67          /* Try to grab the mouse */
    1.68 -        for ( ; ; ) {
    1.69 -            int result = XGrabPointer(display, data->window, True, 0, GrabModeAsync, GrabModeAsync, data->window, None, CurrentTime);
    1.70 -            if ( result == GrabSuccess ) {
    1.71 +        for (;;) {
    1.72 +            int result =
    1.73 +                XGrabPointer(display, data->window, True, 0, GrabModeAsync,
    1.74 +                             GrabModeAsync, data->window, None, CurrentTime);
    1.75 +            if (result == GrabSuccess) {
    1.76                  break;
    1.77              }
    1.78              SDL_Delay(100);
    1.79 @@ -691,7 +698,8 @@
    1.80          XRaiseWindow(display, data->window);
    1.81  
    1.82          /* Now grab the keyboard */
    1.83 -        XGrabKeyboard(display, data->window, True, GrabModeAsync, GrabModeAsync, CurrentTime);
    1.84 +        XGrabKeyboard(display, data->window, True, GrabModeAsync,
    1.85 +                      GrabModeAsync, CurrentTime);
    1.86      } else {
    1.87          XUngrabPointer(display, CurrentTime);
    1.88          XUngrabKeyboard(display, CurrentTime);