comparison Gui/win32/interface.c @ 19408:df307a050359

further improvements to fullscreen switching.
author vayne
date Wed, 16 Aug 2006 16:21:17 +0000
parents 64d82a45a05d
children 69b134c4caea
comparison
equal deleted inserted replaced
19407:c3dc9a93f56e 19408:df307a050359
401 #endif 401 #endif
402 402
403 if (mygui->playlist->current == (mygui->playlist->trackcount - 1)) 403 if (mygui->playlist->current == (mygui->playlist->trackcount - 1))
404 mygui->playlist->current = 0; 404 mygui->playlist->current = 0;
405 405
406 fullscreen = vo_fs = 0; 406 fullscreen = 0;
407 guiGetEvent(guiCEvent, (void *) guiSetStop); 407 guiGetEvent(guiCEvent, (void *) guiSetStop);
408 } 408 }
409 409
410 void mplSetFileName(char *dir, char *name, int type) 410 void mplSetFileName(char *dir, char *name, int type)
411 { 411 {
695 /* MPlayer asks us to quit */ 695 /* MPlayer asks us to quit */
696 switch((int) arg) 696 switch((int) arg)
697 { 697 {
698 case MP_CMD_GUI_FULLSCREEN: 698 case MP_CMD_GUI_FULLSCREEN:
699 { 699 {
700 DWORD style;
701 /* vo_directx's fullscreen window */
702 HWND hWndFS = FindWindow(NULL, "MPlayer Fullscreen");
703
700 if(!guiIntfStruct.sh_video) break; 704 if(!guiIntfStruct.sh_video) break;
701 705
702 /* FIXME: vo_directx is behaving unexpectedly, this maintains current functionality */ 706 if(!sub_window)
703 if(!sub_window || (&video_driver_list && strstr(video_driver_list[0], "directx")))
704 { 707 {
705 video_out->control(VOCTRL_FULLSCREEN, 0); 708 video_out->control(VOCTRL_FULLSCREEN, 0);
706 break; 709 break;
707 } 710 }
708 711
709 if(!fullscreen) 712 if(!fullscreen && IsWindowVisible(mygui->subwindow) && !IsIconic(mygui->subwindow))
710 GetWindowRect(mygui->subwindow, &old_rect); 713 GetWindowRect(mygui->subwindow, &old_rect);
711 714
712 if(fullscreen) 715 if(fullscreen)
713 { 716 {
714 fullscreen = vo_fs = 0; 717 fullscreen = 0;
715 vo_dwidth = guiIntfStruct.MovieWidth = old_rect.right-old_rect.left; 718 style = WS_OVERLAPPEDWINDOW | WS_SIZEBOX;
716 vo_dheight = guiIntfStruct.MovieHeight = old_rect.bottom-old_rect.top;
717 vo_dx = old_rect.left;
718 vo_dy = old_rect.top;
719 } else { 719 } else {
720 fullscreen = vo_fs = 1; 720 fullscreen = 1;
721 vo_dwidth = guiIntfStruct.MovieWidth = vo_screenwidth; 721 style = WS_VISIBLE | WS_POPUP;
722 vo_dheight = guiIntfStruct.MovieHeight = vo_screenheight; 722 if(hWndFS) DestroyWindow(hWndFS);
723 vo_dx = 0;
724 vo_dy = 0;
725 } 723 }
724 SetWindowLong(mygui->subwindow, GWL_STYLE, style);
726 mpcodecs_config_vo(guiIntfStruct.sh_video, guiIntfStruct.MovieWidth, 725 mpcodecs_config_vo(guiIntfStruct.sh_video, guiIntfStruct.MovieWidth,
727 guiIntfStruct.MovieHeight, 0); 726 guiIntfStruct.MovieHeight, 0);
728 break; 727 break;
729 } 728 }
730 case MP_CMD_QUIT: 729 case MP_CMD_QUIT: