comparison src/video/windx5/SDL_dx5video.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 778b970cec12
children a6fa62b1be09
comparison
equal deleted inserted replaced
447:16d0449891b8 448:323c766f5a46
1078 } 1078 }
1079 } 1079 }
1080 1080
1081 style = GetWindowLong(SDL_Window, GWL_STYLE); 1081 style = GetWindowLong(SDL_Window, GWL_STYLE);
1082 style &= ~(resizestyle|WS_MAXIMIZE); 1082 style &= ~(resizestyle|WS_MAXIMIZE);
1083 if ( (video->flags & SDL_FULLSCREEN) == SDL_FULLSCREEN ) { 1083 if ( video->flags & SDL_FULLSCREEN ) {
1084 style &= ~windowstyle; 1084 style &= ~windowstyle;
1085 style |= directstyle; 1085 style |= directstyle;
1086 } else { 1086 } else {
1087 if ( flags & SDL_NOFRAME ) { 1087 if ( flags & SDL_NOFRAME ) {
1088 style &= ~windowstyle; 1088 style &= ~windowstyle;
1100 } 1100 }
1101 SetWindowLong(SDL_Window, GWL_STYLE, style); 1101 SetWindowLong(SDL_Window, GWL_STYLE, style);
1102 1102
1103 /* Resize the window (copied from SDL WinDIB driver) */ 1103 /* Resize the window (copied from SDL WinDIB driver) */
1104 if ( SDL_windowid == NULL ) { 1104 if ( SDL_windowid == NULL ) {
1105 HWND top;
1105 UINT swp_flags; 1106 UINT swp_flags;
1106 1107
1107 SDL_resizing = 1; 1108 SDL_resizing = 1;
1108 bounds.left = 0; 1109 bounds.left = 0;
1109 bounds.top = 0; 1110 bounds.top = 0;
1115 x = (GetSystemMetrics(SM_CXSCREEN)-width)/2; 1116 x = (GetSystemMetrics(SM_CXSCREEN)-width)/2;
1116 y = (GetSystemMetrics(SM_CYSCREEN)-height)/2; 1117 y = (GetSystemMetrics(SM_CYSCREEN)-height)/2;
1117 if ( y < 0 ) { /* Cover up title bar for more client area */ 1118 if ( y < 0 ) { /* Cover up title bar for more client area */
1118 y -= GetSystemMetrics(SM_CYCAPTION)/2; 1119 y -= GetSystemMetrics(SM_CYCAPTION)/2;
1119 } 1120 }
1120 swp_flags = (SWP_NOCOPYBITS | SWP_NOZORDER | SWP_SHOWWINDOW); 1121 swp_flags = (SWP_NOCOPYBITS | SWP_FRAMECHANGED | SWP_SHOWWINDOW);
1121 if ( was_visible && !(flags & SDL_FULLSCREEN) ) { 1122 if ( was_visible && (video->flags & SDL_FULLSCREEN) ) {
1122 swp_flags |= SWP_NOMOVE; 1123 swp_flags |= SWP_NOMOVE;
1123 } 1124 }
1124 SetWindowPos(SDL_Window, NULL, x, y, width, height, swp_flags); 1125 if ( video->flags & SDL_FULLSCREEN ) {
1126 top = HWND_TOPMOST;
1127 } else {
1128 top = HWND_NOTOPMOST;
1129 }
1130 SetWindowPos(SDL_Window, top, x, y, width, height, swp_flags);
1125 SDL_resizing = 0; 1131 SDL_resizing = 0;
1126 SetForegroundWindow(SDL_Window); 1132 SetForegroundWindow(SDL_Window);
1127 } 1133 }
1128 1134
1129 /* Set up for OpenGL */ 1135 /* Set up for OpenGL */