comparison Gui/win32/gui.c @ 19408:df307a050359

further improvements to fullscreen switching.
author vayne
date Wed, 16 Aug 2006 16:21:17 +0000
parents 64d82a45a05d
children 69b134c4caea
comparison
equal deleted inserted replaced
19407:c3dc9a93f56e 19408:df307a050359
554 case WM_WINDOWPOSCHANGED: 554 case WM_WINDOWPOSCHANGED:
555 { 555 {
556 int tmpheight=0; 556 int tmpheight=0;
557 static uint32_t rect_width; 557 static uint32_t rect_width;
558 static uint32_t rect_height; 558 static uint32_t rect_height;
559 DWORD style, flags;
560 RECT rd; 559 RECT rd;
561 POINT pt; 560 POINT pt;
562 while(ShowCursor(TRUE) <= 0){} 561 while(ShowCursor(TRUE) <= 0){}
563 pt.x = 0; 562 pt.x = 0;
564 pt.y = 0; 563 pt.y = 0;
579 else rect_height = tmpheight; 578 else rect_height = tmpheight;
580 579
581 rd.right = rd.left + rect_width; 580 rd.right = rd.left + rect_width;
582 rd.bottom = rd.top + rect_height; 581 rd.bottom = rd.top + rect_height;
583 582
584 if(fullscreen) 583 AdjustWindowRect(&rd, WS_OVERLAPPEDWINDOW | WS_SIZEBOX, 0);
585 {
586 style = WS_VISIBLE | WS_POPUP;
587 flags = SWP_NOZORDER | SWP_FRAMECHANGED;
588 } else {
589 style = WS_OVERLAPPEDWINDOW | WS_SIZEBOX;
590 flags = SWP_NOOWNERZORDER;
591 }
592
593 AdjustWindowRect(&rd, style, 0);
594 SetWindowPos(hWnd, 0, fullscreen?0:pt.x+rd.left, fullscreen?0:pt.y+rd.top, 584 SetWindowPos(hWnd, 0, fullscreen?0:pt.x+rd.left, fullscreen?0:pt.y+rd.top,
595 fullscreen?vo_screenwidth:rd.right-rd.left, fullscreen?vo_screenheight:rd.bottom-rd.top, flags); 585 fullscreen?vo_screenwidth:rd.right-rd.left, fullscreen?vo_screenheight:rd.bottom-rd.top, SWP_NOOWNERZORDER);
586 SetForegroundWindow(hWnd);
596 return 0; 587 return 0;
597 } 588 }
598 case WM_PAINT: 589 case WM_PAINT:
599 { 590 {
600 PAINTSTRUCT ps; 591 PAINTSTRUCT ps;