src/video/x11/SDL_x11window.c
changeset 13534 24e8a27fa627
parent 13533 867352e06641
child 13535 dbcccb065928
equal deleted inserted replaced
13533:867352e06641 13534:24e8a27fa627
   822     X11_XMoveWindow(display, data->xwindow, window->x - data->border_left, window->y - data->border_top);
   822     X11_XMoveWindow(display, data->xwindow, window->x - data->border_left, window->y - data->border_top);
   823 
   823 
   824     /* Wait a brief time to see if the window manager decided to let this move happen.
   824     /* Wait a brief time to see if the window manager decided to let this move happen.
   825        If the window changes at all, even to an unexpected value, we break out. */
   825        If the window changes at all, even to an unexpected value, we break out. */
   826     timeout = SDL_GetTicks() + 100;
   826     timeout = SDL_GetTicks() + 100;
   827     do {
   827     while (SDL_TRUE) {
   828         int x, y;
   828         int x, y;
   829         X11_XSync(display, False);
   829         X11_XSync(display, False);
   830         X11_XGetWindowAttributes(display, data->xwindow, &attrs);
   830         X11_XGetWindowAttributes(display, data->xwindow, &attrs);
   831         X11_XTranslateCoordinates(display, parent, DefaultRootWindow(display),
   831         X11_XTranslateCoordinates(display, parent, DefaultRootWindow(display),
   832                                   attrs.x, attrs.y, &x, &y, &childReturn);
   832                                   attrs.x, attrs.y, &x, &y, &childReturn);
   837             break;  /* window moved, time to go. */
   837             break;  /* window moved, time to go. */
   838         } else if ((x == window->x) && (y == window->y)) {
   838         } else if ((x == window->x) && (y == window->y)) {
   839             break;  /* we're at the place we wanted to be anyhow, drop out. */
   839             break;  /* we're at the place we wanted to be anyhow, drop out. */
   840         }
   840         }
   841 
   841 
       
   842         if (SDL_TICKS_PASSED(SDL_GetTicks(), timeout)) {
       
   843             break;
       
   844         }
       
   845 
   842         SDL_Delay(10);
   846         SDL_Delay(10);
   843     } while (!SDL_TICKS_PASSED(SDL_GetTicks(), timeout));
   847     }
   844 }
   848 }
   845 
   849 
   846 void
   850 void
   847 X11_SetWindowMinimumSize(_THIS, SDL_Window * window)
   851 X11_SetWindowMinimumSize(_THIS, SDL_Window * window)
   848 {
   852 {