src/video/windows/SDL_windowswindow.c
changeset 8817 13003597b6c4
parent 8778 d67a044fbec6
child 8905 1519c462cee6
equal deleted inserted replaced
8816:7e2f5d693149 8817:13003597b6c4
   106     w = (rect.right - rect.left);
   106     w = (rect.right - rect.left);
   107     h = (rect.bottom - rect.top);
   107     h = (rect.bottom - rect.top);
   108     x = window->x + rect.left;
   108     x = window->x + rect.left;
   109     y = window->y + rect.top;
   109     y = window->y + rect.top;
   110 
   110 
   111     data->expected_resize = TRUE;
   111     data->expected_resize = SDL_TRUE;
   112     SetWindowPos(hwnd, top, x, y, w, h, flags);
   112     SetWindowPos( hwnd, top, x, y, w, h, flags );
   113     data->expected_resize = FALSE;
   113     data->expected_resize = SDL_FALSE;
   114 }
   114 }
   115 
   115 
   116 static int
   116 static int
   117 SetupWindowData(_THIS, SDL_Window * window, HWND hwnd, SDL_bool created)
   117 SetupWindowData(_THIS, SDL_Window * window, HWND hwnd, SDL_bool created)
   118 {
   118 {
   468 void
   468 void
   469 WIN_MaximizeWindow(_THIS, SDL_Window * window)
   469 WIN_MaximizeWindow(_THIS, SDL_Window * window)
   470 {
   470 {
   471     SDL_WindowData *data = (SDL_WindowData *)window->driverdata;
   471     SDL_WindowData *data = (SDL_WindowData *)window->driverdata;
   472     HWND hwnd = data->hwnd;
   472     HWND hwnd = data->hwnd;
   473     data->expected_resize = TRUE;
   473     data->expected_resize = SDL_TRUE;
   474     ShowWindow(hwnd, SW_MAXIMIZE);
   474     ShowWindow(hwnd, SW_MAXIMIZE);
   475     data->expected_resize = FALSE;
   475     data->expected_resize = SDL_FALSE;
   476 }
   476 }
   477 
   477 
   478 void
   478 void
   479 WIN_MinimizeWindow(_THIS, SDL_Window * window)
   479 WIN_MinimizeWindow(_THIS, SDL_Window * window)
   480 {
   480 {
   483 }
   483 }
   484 
   484 
   485 void
   485 void
   486 WIN_SetWindowBordered(_THIS, SDL_Window * window, SDL_bool bordered)
   486 WIN_SetWindowBordered(_THIS, SDL_Window * window, SDL_bool bordered)
   487 {
   487 {
   488     HWND hwnd = ((SDL_WindowData *) window->driverdata)->hwnd;
   488     SDL_WindowData *data = (SDL_WindowData *)window->driverdata;
       
   489     HWND hwnd = data->hwnd;
   489     DWORD style = GetWindowLong(hwnd, GWL_STYLE);
   490     DWORD style = GetWindowLong(hwnd, GWL_STYLE);
   490 
   491 
   491     if (bordered) {
   492     if (bordered) {
   492         style &= ~STYLE_BORDERLESS;
   493         style &= ~STYLE_BORDERLESS;
   493         style |= STYLE_NORMAL;
   494         style |= STYLE_NORMAL;
   494     } else {
   495     } else {
   495         style &= ~STYLE_NORMAL;
   496         style &= ~STYLE_NORMAL;
   496         style |= STYLE_BORDERLESS;
   497         style |= STYLE_BORDERLESS;
   497     }
   498     }
   498 
   499 
   499     SetWindowLong(hwnd, GWL_STYLE, style);
   500     data->in_border_change = SDL_TRUE;
   500     WIN_SetWindowPositionInternal(_this, window, SWP_NOCOPYBITS | SWP_FRAMECHANGED | SWP_NOREPOSITION | SWP_NOZORDER |SWP_NOACTIVATE | SWP_NOSENDCHANGING);
   501     SetWindowLong( hwnd, GWL_STYLE, style );
       
   502     WIN_SetWindowPositionInternal(_this, window, SWP_NOCOPYBITS | SWP_FRAMECHANGED | SWP_NOZORDER | SWP_NOACTIVATE);
       
   503     data->in_border_change = SDL_FALSE;
   501 }
   504 }
   502 
   505 
   503 void
   506 void
   504 WIN_RestoreWindow(_THIS, SDL_Window * window)
   507 WIN_RestoreWindow(_THIS, SDL_Window * window)
   505 {
   508 {
   506     SDL_WindowData *data = (SDL_WindowData *)window->driverdata;
   509     SDL_WindowData *data = (SDL_WindowData *)window->driverdata;
   507     HWND hwnd = data->hwnd;
   510     HWND hwnd = data->hwnd;
   508     data->expected_resize = TRUE;
   511     data->expected_resize = SDL_TRUE;
   509     ShowWindow(hwnd, SW_RESTORE);
   512     ShowWindow(hwnd, SW_RESTORE);
   510     data->expected_resize = FALSE;
   513     data->expected_resize = SDL_FALSE;
   511 }
   514 }
   512 
   515 
   513 void
   516 void
   514 WIN_SetWindowFullscreen(_THIS, SDL_Window * window, SDL_VideoDisplay * display, SDL_bool fullscreen)
   517 WIN_SetWindowFullscreen(_THIS, SDL_Window * window, SDL_VideoDisplay * display, SDL_bool fullscreen)
   515 {
   518 {
   551         h = (rect.bottom - rect.top);
   554         h = (rect.bottom - rect.top);
   552         x = window->windowed.x + rect.left;
   555         x = window->windowed.x + rect.left;
   553         y = window->windowed.y + rect.top;
   556         y = window->windowed.y + rect.top;
   554     }
   557     }
   555     SetWindowLong(hwnd, GWL_STYLE, style);
   558     SetWindowLong(hwnd, GWL_STYLE, style);
   556     data->expected_resize = TRUE;
   559     data->expected_resize = SDL_TRUE;
   557     SetWindowPos(hwnd, top, x, y, w, h, SWP_NOCOPYBITS | SWP_NOACTIVATE);
   560     SetWindowPos(hwnd, top, x, y, w, h, SWP_NOCOPYBITS | SWP_NOACTIVATE);
   558     data->expected_resize = FALSE;
   561     data->expected_resize = SDL_FALSE;
   559 }
   562 }
   560 
   563 
   561 int
   564 int
   562 WIN_SetWindowGammaRamp(_THIS, SDL_Window * window, const Uint16 * ramp)
   565 WIN_SetWindowGammaRamp(_THIS, SDL_Window * window, const Uint16 * ramp)
   563 {
   566 {