]> de.git.xonotic.org Git - xonotic/darkplaces.git/blobdiff - vid_sdl.c
rename netwmfullscreen to desktopfullscreen; implement in other drivers (except agl)
[xonotic/darkplaces.git] / vid_sdl.c
index 3211eaa17f55814a48b5dfdbdd9d800a5c6392a3..9fff961384005f85c53818c1a6a25c1f7214a9c7 100644 (file)
--- a/vid_sdl.c
+++ b/vid_sdl.c
@@ -1132,11 +1132,12 @@ void Sys_SendKeyEvents( void )
                        case SDL_VIDEOEXPOSE:
                                break;
                        case SDL_VIDEORESIZE:
-                               if(vid_resizable.integer < 2)
+                               if(vid_resizable.integer < 2 || vid_isfullscreen)
                                {
                                        vid.width = event.resize.w;
                                        vid.height = event.resize.h;
-                                       screen = SDL_SetVideoMode(vid.width, vid.height, video_bpp, video_flags);
+                                       if (!vid_isfullscreen)
+                                               screen = SDL_SetVideoMode(vid.width, vid.height, video_bpp, video_flags);
                                        if (vid_softsurface)
                                        {
                                                SDL_FreeSurface(vid_softsurface);
@@ -2475,9 +2476,16 @@ static qboolean VID_InitModeGL(viddef_mode_t *mode)
        vid_isfullscreen = false;
        if (mode->fullscreen) {
 #if SDL_MAJOR_VERSION == 1
+               SDL_VideoInfo *vi = SDL_GetVideoInfo();
+               mode->width = vi->current_w;
+               mode->height = vi->current_h;
+               mode->bitsperpixel = vi->vfmt->BitsPerPixel;
                flags |= SDL_FULLSCREEN;
 #else
-               windowflags |= SDL_WINDOW_FULLSCREEN;
+               if (vid_desktopfullscreen.integer)
+                       windowflags |= SDL_WINDOW_FULLSCREEN_DESKTOP;
+               else
+                       windowflags |= SDL_WINDOW_FULLSCREEN;
 #endif
                vid_isfullscreen = true;
        }
@@ -2619,9 +2627,16 @@ static qboolean VID_InitModeSoft(viddef_mode_t *mode)
        vid_isfullscreen = false;
        if (mode->fullscreen) {
 #if SDL_MAJOR_VERSION == 1
+               SDL_VideoInfo *vi = SDL_GetVideoInfo();
+               mode->width = vi->current_w;
+               mode->height = vi->current_h;
+               mode->bitsperpixel = vi->vfmt->BitsPerPixel;
                flags |= SDL_FULLSCREEN;
 #else
-               windowflags |= SDL_WINDOW_FULLSCREEN;
+               if (vid_desktopfullscreen.integer)
+                       windowflags |= SDL_WINDOW_FULLSCREEN_DESKTOP;
+               else
+                       windowflags |= SDL_WINDOW_FULLSCREEN;
 #endif
                vid_isfullscreen = true;
        }