changeset 11087:b427c796638b

* clear window on fullscreen switch * add call of vo_x11_sizehint
author attila
date Sun, 12 Oct 2003 14:42:27 +0000
parents 7f659e7b7ce1
children bcba2df350de
files libvo/vo_gl2.c
diffstat 1 files changed, 16 insertions(+), 10 deletions(-) [+]
line wrap: on
line diff
--- a/libvo/vo_gl2.c	Sun Oct 12 12:55:38 2003 +0000
+++ b/libvo/vo_gl2.c	Sun Oct 12 14:42:27 2003 +0000
@@ -11,6 +11,7 @@
 #include <errno.h>
 
 #include "config.h"
+#include "mp_msg.h"
 #include "video_out.h"
 #include "video_out_internal.h"
 #include "sub.h"
@@ -562,15 +563,16 @@
 }
 
 
-static void resize(int x,int y){
-  printf("[gl2] Resize: %dx%d\n",x,y);
+static void resize(int *x,int *y){
+  mp_msg(MSGT_VO,MSGL_V,"[gl2] Resize: %dx%d\n",*x,*y);
   if( vo_fs )
   {
-	  aspect(&x, &y, A_ZOOM);
-	  glViewport( (vo_screenwidth-x)/2, (vo_screenheight-y)/2, x, y);
+	  glClear(GL_COLOR_BUFFER_BIT);
+	  aspect(x, y, A_ZOOM);
+	  glViewport( (vo_screenwidth-*x)/2, (vo_screenheight-*y)/2, *x, *y);
   } else { 
-	  aspect(&x, &y, A_NOZOOM);
-	  glViewport( 0, 0, x, y );
+	  //aspect(x, y, A_NOZOOM);
+	  glViewport( 0, 0, *x, *y );
   }
 
   glMatrixMode(GL_PROJECTION);
@@ -732,6 +734,7 @@
 #ifdef HAVE_XINERAMA
 	vo_x11_xinerama_move(mDisplay,vo_window);
 #endif
+	vo_x11_sizehint( hint.x, hint.y, hint.width, hint.height,0 );
         XClearWindow(mDisplay,vo_window);
 
 	/* Wait for map. */
@@ -744,7 +747,10 @@
 	XSelectInput(mDisplay, vo_window, NoEventMask);
 
    }
-   else if ( !(flags&1) ) XMoveResizeWindow( mDisplay,vo_window,hint.x,hint.y,hint.width,hint.height );
+   else {
+   	vo_x11_sizehint( hint.x, hint.y, hint.width, hint.height,0 );
+   	if ( !(flags&1) ) XMoveResizeWindow( mDisplay,vo_window,hint.x,hint.y,hint.width,hint.height );
+   }
 
   vo_x11_classhint( mDisplay,vo_window,"gl2" );
   vo_hidecursor(mDisplay,vo_window);
@@ -823,7 +829,7 @@
         gl_bitmap_format_s, gl_bitmap_type_s, gl_alignment,
 	rgb_sz, r_sz, g_sz, b_sz, a_sz, gl_internal_format_s);
 
-  resize(d_width, d_height);
+  resize(&d_width, &d_height);
 
   glClearColor( 0.0f,0.0f,0.0f,0.0f );
   glClear( GL_COLOR_BUFFER_BIT );
@@ -1024,7 +1030,7 @@
 
 static void check_events(void) {
     int e=vo_w32_check_events();
-    if(e&VO_EVENT_RESIZE) resize(vo_dwidth,vo_dheight);
+    if(e&VO_EVENT_RESIZE) resize(&vo_dwidth, &vo_dheight);
     if(e&VO_EVENT_EXPOSE && int_pause) flip_page();
 }
 
@@ -1057,7 +1063,7 @@
 	      }
          }
 	 e=vo_x11_check_events(mDisplay);
-         if(e&VO_EVENT_RESIZE) resize(vo_dwidth,vo_dheight);
+         if(e&VO_EVENT_RESIZE) resize(&vo_dwidth, &vo_dheight);
          if(e&VO_EVENT_EXPOSE && int_pause) flip_page();
 }