comparison src/video/windib/SDL_dibvideo.c @ 448:323c766f5a46

Fullscreen windows are always topmost under Windows
author Sam Lantinga <slouken@libsdl.org>
date Mon, 19 Aug 2002 03:09:25 +0000
parents b37ce4813ad4
children a6fa62b1be09
comparison
equal deleted inserted replaced
447:16d0449891b8 448:323c766f5a46
571 #ifndef _WIN32_WCE 571 #ifndef _WIN32_WCE
572 if (IsZoomed(SDL_Window)) style |= WS_MAXIMIZE; 572 if (IsZoomed(SDL_Window)) style |= WS_MAXIMIZE;
573 #endif 573 #endif
574 } 574 }
575 575
576 /* DJM: Don't piss of anyone who has setup his own window */ 576 /* DJM: Don't piss of anyone who has setup his own window */
577 if (!SDL_windowid) 577 if (!SDL_windowid)
578 SetWindowLong(SDL_Window, GWL_STYLE, style); 578 SetWindowLong(SDL_Window, GWL_STYLE, style);
579 579
580 /* Delete the old bitmap if necessary */ 580 /* Delete the old bitmap if necessary */
581 if ( screen_bmp != NULL ) { 581 if ( screen_bmp != NULL ) {
582 DeleteObject(screen_bmp); 582 DeleteObject(screen_bmp);
583 } 583 }
649 } 649 }
650 } 650 }
651 651
652 /* Resize the window */ 652 /* Resize the window */
653 if ( SDL_windowid == NULL ) { 653 if ( SDL_windowid == NULL ) {
654 HWND top;
654 UINT swp_flags; 655 UINT swp_flags;
655 656
656 SDL_resizing = 1; 657 SDL_resizing = 1;
657 bounds.left = 0; 658 bounds.left = 0;
658 bounds.top = 0; 659 bounds.top = 0;
669 y = (GetSystemMetrics(SM_CYSCREEN)-height)/2; 670 y = (GetSystemMetrics(SM_CYSCREEN)-height)/2;
670 if ( y < 0 ) { /* Cover up title bar for more client area */ 671 if ( y < 0 ) { /* Cover up title bar for more client area */
671 y -= GetSystemMetrics(SM_CYCAPTION)/2; 672 y -= GetSystemMetrics(SM_CYCAPTION)/2;
672 } 673 }
673 #ifndef _WIN32_WCE 674 #ifndef _WIN32_WCE
674 swp_flags = (SWP_NOCOPYBITS | SWP_NOZORDER | SWP_SHOWWINDOW); 675 swp_flags = (SWP_NOCOPYBITS | SWP_FRAMECHANGED | SWP_SHOWWINDOW);
675 #else 676 #else
676 swp_flags = (SWP_NOZORDER | SWP_SHOWWINDOW); 677 swp_flags = (SWP_FRAMECHANGED | SWP_SHOWWINDOW);
677 #endif 678 #endif
678 if ( was_visible && !(flags & SDL_FULLSCREEN) ) { 679 if ( was_visible && !(flags & SDL_FULLSCREEN) ) {
679 swp_flags |= SWP_NOMOVE; 680 swp_flags |= SWP_NOMOVE;
680 } 681 }
681 SetWindowPos(SDL_Window, NULL, x, y, width, height, swp_flags); 682 if ( flags & SDL_FULLSCREEN ) {
683 top = HWND_TOPMOST;
684 } else {
685 top = HWND_NOTOPMOST;
686 }
687 SetWindowPos(SDL_Window, top, x, y, width, height, swp_flags);
682 SDL_resizing = 0; 688 SDL_resizing = 0;
683 SetForegroundWindow(SDL_Window); 689 SetForegroundWindow(SDL_Window);
684 } 690 }
685 691
686 #ifdef HAVE_OPENGL 692 #ifdef HAVE_OPENGL