]> git.sesse.net Git - vlc/commitdiff
Use the screen resolution in fullscreen
authorRémi Duraffort <ivoire@videolan.org>
Tue, 1 Jan 2008 15:50:01 +0000 (15:50 +0000)
committerRémi Duraffort <ivoire@videolan.org>
Tue, 1 Jan 2008 15:50:01 +0000 (15:50 +0000)
modules/video_output/sdl.c

index a04b949247bfbc86623cf672698ec95eb391ca4b..376af5780bf12cb8090886f1b360d4910b93f158 100644 (file)
@@ -59,6 +59,9 @@ struct vout_sys_t
     int i_width;
     int i_height;
 
+    unsigned int i_desktop_width;
+    unsigned int i_desktop_height;
+
     /* For YUV output */
     SDL_Overlay * p_overlay;   /* An overlay we keep to grab the XVideo port */
 
@@ -205,10 +208,14 @@ static int Open ( vlc_object_t *p_this )
         return VLC_EGENERIC;
     }
 
+    vlc_mutex_unlock( lock );
+
     /* Translate keys into unicode */
     SDL_EnableUNICODE(1);
 
-    vlc_mutex_unlock( lock );
+    /* Get the desktop resolution */
+    p_vout->p_sys->i_desktop_width = SDL_GetVideoInfo()->current_w;
+    p_vout->p_sys->i_desktop_height = SDL_GetVideoInfo()->current_h;
 
     p_vout->p_sys->b_cursor = 1;
     p_vout->p_sys->b_cursor_autohidden = 0;
@@ -721,9 +728,9 @@ static int OpenDisplay( vout_thread_t *p_vout )
     uint32_t i_chroma = 0;
 
     /* Set main window's size */
-    p_vout->p_sys->i_width = p_vout->b_fullscreen ? p_vout->output.i_width :
+    p_vout->p_sys->i_width = p_vout->b_fullscreen ? p_vout->p_sys->i_desktop_width :
                                                     p_vout->i_window_width;
-    p_vout->p_sys->i_height = p_vout->b_fullscreen ? p_vout->output.i_height :
+    p_vout->p_sys->i_height = p_vout->b_fullscreen ? p_vout->p_sys->i_desktop_height :
                                                      p_vout->i_window_height;
 
     /* Initialize flags and cursor */
@@ -739,8 +746,8 @@ static int OpenDisplay( vout_thread_t *p_vout )
     }
 
     p_vout->p_sys->p_display = SDL_SetVideoMode( p_vout->p_sys->i_width,
-                                                 p_vout->p_sys->i_height,
-                                                 i_bpp, i_flags );
+                                                   p_vout->p_sys->i_height,
+                                                   i_bpp, i_flags );
 
     if( p_vout->p_sys->p_display == NULL )
     {