comparison libvo/vo_gl2.c @ 12035:b3512c7b26ce

corrected problems with switching to and from fullscreen mode esp. with fixed-vo
author reimar
date Wed, 17 Mar 2004 11:53:25 +0000
parents ccb15c72f331
children a830eebf6693
comparison
equal deleted inserted replaced
12034:90315c910b26 12035:b3512c7b26ce
675 static uint32_t config_glx(uint32_t width, uint32_t height, uint32_t d_width, uint32_t d_height, uint32_t flags, char *title, uint32_t format) { 675 static uint32_t config_glx(uint32_t width, uint32_t height, uint32_t d_width, uint32_t d_height, uint32_t flags, char *title, uint32_t format) {
676 XSizeHints hint; 676 XSizeHints hint;
677 XVisualInfo *vinfo, vinfo_buf; 677 XVisualInfo *vinfo, vinfo_buf;
678 XEvent xev; 678 XEvent xev;
679 679
680 if( flags&0x01 )
681 {
682 vo_fs = VO_TRUE;
683 aspect(&d_width,&d_height,A_ZOOM);
684 hint.x = 0;
685 hint.y = 0;
686 hint.width = vo_screenwidth;
687 hint.height = vo_screenheight;
688 hint.flags = PPosition | PSize;
689 } else {
690 vo_fs = VO_FALSE;
691 hint.x = 0; 680 hint.x = 0;
692 hint.y = 0; 681 hint.y = 0;
693 hint.width = d_width; 682 hint.width = d_width;
694 hint.height = d_height; 683 hint.height = d_height;
695 hint.flags = PPosition | PSize; 684 hint.flags = PPosition | PSize;
696 }
697 685
698 /* Make the window */ 686 /* Make the window */
699 687
700 // XGetWindowAttributes(mDisplay, DefaultRootWindow(mDisplay), &attribs); 688 // XGetWindowAttributes(mDisplay, DefaultRootWindow(mDisplay), &attribs);
701 689
707 return -1; 695 return -1;
708 } 696 }
709 697
710 if ( vo_window == None ) 698 if ( vo_window == None )
711 { 699 {
700 vo_fs = VO_FALSE;
712 vo_window = vo_x11_create_smooth_window(mDisplay, RootWindow(mDisplay,mScreen), 701 vo_window = vo_x11_create_smooth_window(mDisplay, RootWindow(mDisplay,mScreen),
713 vinfo->visual, hint.x, hint.y, hint.width, hint.height, vinfo->depth, vo_x11_create_colormap(vinfo)); 702 vinfo->visual, hint.x, hint.y, hint.width, hint.height, vinfo->depth, vo_x11_create_colormap(vinfo));
714 if ( flags&0x01 ) vo_x11_decoration( mDisplay,vo_window,0 );
715 703
716 XSelectInput(mDisplay, vo_window, StructureNotifyMask); 704 XSelectInput(mDisplay, vo_window, StructureNotifyMask);
717 705
718 /* Tell other applications about this window */ 706 /* Tell other applications about this window */
719 707
731 do 719 do
732 { 720 {
733 XNextEvent(mDisplay, &xev); 721 XNextEvent(mDisplay, &xev);
734 } 722 }
735 while (xev.type != MapNotify || xev.xmap.event != vo_window); 723 while (xev.type != MapNotify || xev.xmap.event != vo_window);
736
737 XSelectInput(mDisplay, vo_window, NoEventMask);
738
739 } 724 }
740 else { 725 else {
741 vo_x11_sizehint( hint.x, hint.y, hint.width, hint.height,0 ); 726 vo_x11_sizehint( hint.x, hint.y, hint.width, hint.height,0 );
742 if ( !(flags&1) ) XMoveResizeWindow( mDisplay,vo_window,hint.x,hint.y,hint.width,hint.height ); 727 // for changing from fullscreen to fullscreen we do fullscreen to
728 // window and back to fullscreen, so that vo_x11_fullscreen saves
729 // the correct size for _this_ video (and doesn't take the values from
730 // the previous one)
731 if (vo_fs)
732 vo_x11_fullscreen ();
733 XMoveResizeWindow( mDisplay,vo_window,hint.x,hint.y,hint.width,hint.height );
743 } 734 }
735
736 // these would normally be set by the event handler, but here we have to
737 // do it manually
738 vo_dwidth = d_width;
739 vo_dheight = d_height;
740
741 if (flags & VOFLAG_FULLSCREEN)
742 vo_x11_fullscreen();
744 743
745 vo_x11_classhint( mDisplay,vo_window,"gl2" ); 744 vo_x11_classhint( mDisplay,vo_window,"gl2" );
746 vo_hidecursor(mDisplay,vo_window); 745 vo_hidecursor(mDisplay,vo_window);
747 746
748 if ( vo_config_count ) glXDestroyContext( mDisplay,wsGLXContext ); 747 if ( vo_config_count ) glXDestroyContext( mDisplay,wsGLXContext );
835 { 834 {
836 const unsigned char * glVersion; 835 const unsigned char * glVersion;
837 836
838 image_height = height; 837 image_height = height;
839 image_width = width; 838 image_width = width;
840 vo_dwidth = d_width;
841 vo_dheight = d_height;
842 image_format = format; 839 image_format = format;
843 840
844 int_pause = 0; 841 int_pause = 0;
845 842
846 aspect_save_orig(width,height); 843 aspect_save_orig(width,height);