From 92009fc2f5949a72452bb60b837ac436f924b6c1 Mon Sep 17 00:00:00 2001 From: pontscho Date: Mon, 6 May 2002 15:05:07 +0000 Subject: add WM detection, and wm specific fullscreen code. (???) git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@5998 b3059339-0415-0410-9bf9-f77b7e298cf2 --- Gui/mplayer/play.c | 21 +++++++++++++++++++-- Gui/mplayer/sw.h | 36 ++++-------------------------------- Gui/mplayer/widgets.c | 16 ++++++++++++++++ 3 files changed, 39 insertions(+), 34 deletions(-) (limited to 'Gui/mplayer') diff --git a/Gui/mplayer/play.c b/Gui/mplayer/play.c index 402ca81021..ec7791cc38 100644 --- a/Gui/mplayer/play.c +++ b/Gui/mplayer/play.c @@ -54,9 +54,26 @@ void mplFullScreen( void ) wsVisibleWindow( &appMPlayer.subWindow,wsShowWindow ); }// else { vo_x11_fullscreen(); appMPlayer.subWindow.isFullScreen=vo_fs; } #else + if ( ( guiIntfStruct.Playing )&&( appMPlayer.subWindow.isFullScreen ) ) + { + appMPlayer.subWindow.OldWidth=guiIntfStruct.MovieWidth; appMPlayer.subWindow.OldHeight=guiIntfStruct.MovieHeight; + switch ( appMPlayer.sub.x ) + { + case -1: appMPlayer.subWindow.OldX=( wsMaxX / 2 ) - ( appMPlayer.subWindow.OldWidth / 2 ); break; + case -2: appMPlayer.subWindow.OldX=wsMaxX - appMPlayer.subWindow.OldWidth; break; + default: appMPlayer.subWindow.OldX=appMPlayer.sub.x; break; + } + switch ( appMPlayer.sub.y ) + { + case -1: appMPlayer.subWindow.OldY=( wsMaxY / 2 ) - ( appMPlayer.subWindow.OldHeight / 2 ); break; + case -2: appMPlayer.subWindow.OldY=wsMaxY - appMPlayer.subWindow.OldHeight; break; + default: appMPlayer.subWindow.OldY=appMPlayer.sub.y; break; + } + } wsFullScreen( &appMPlayer.subWindow ); - vo_fs=0; - if ( appMPlayer.subWindow.isFullScreen ) vo_fs=1; + vo_fs=appMPlayer.subWindow.isFullScreen; + wsSetLayer( wsDisplay,appMPlayer.mainWindow.WindowID,appMPlayer.subWindow.isFullScreen ); + wsSetLayer( wsDisplay,appMPlayer.menuWindow.WindowID,appMPlayer.subWindow.isFullScreen ); #endif fullscreen=appMPlayer.subWindow.isFullScreen; diff --git a/Gui/mplayer/sw.h b/Gui/mplayer/sw.h index fd780cec9e..256ac50fc7 100644 --- a/Gui/mplayer/sw.h +++ b/Gui/mplayer/sw.h @@ -44,13 +44,6 @@ void mplSubMouseHandle( int Button,int X,int Y,int RX,int RY ) break; // --- case wsPLMouseButton: - if ( appMPlayer.subWindow.isFullScreen ) - { - if( ++SubVisible%2 ) wsMoveTopWindow( &appMPlayer.mainWindow ); - else wsMoveTopWindow( &appMPlayer.subWindow ); - mplSubMoved=1; - break; - } gtkShow( evHidePopUpMenu,NULL ); sx=X; sy=Y; msButton=wsPLMouseButton; @@ -69,32 +62,11 @@ void mplSubMouseHandle( int Button,int X,int Y,int RX,int RY ) } break; case wsRLMouseButton: - if ( !mplSubMoved ) + if ( ( !mplSubMoved )&&( appMPlayer.subWindow.isFullScreen ) ) { -#if 0 - if( SubVisible++%2 ) - { - wsMoveTopWindow( &appMPlayer.mainWindow ); - fprintf( stderr,"[sw] MAIN TOP\n" ); - } - else - { - wsMoveTopWindow( &appMPlayer.subWindow ); - fprintf( stderr,"[sw] SUB TOP\n" ); - } -#else - if ( appMPlayer.subWindow.Focused == 2 ) - { - wsMoveTopWindow( &appMPlayer.mainWindow ); - fprintf( stderr,"[sw] MAIN TOP\n" ); - } - else - { - wsMoveTopWindow( &appMPlayer.subWindow ); - fprintf( stderr,"[sw] SUB TOP\n" ); - } -#endif - } + if( SubVisible++%2 ) wsMoveTopWindow( &appMPlayer.mainWindow ); + else wsMoveTopWindow( &appMPlayer.subWindow ); + } msButton=0; mplSubMoved=0; break; diff --git a/Gui/mplayer/widgets.c b/Gui/mplayer/widgets.c index ce7bd7fbf4..c5bf2c5a5c 100644 --- a/Gui/mplayer/widgets.c +++ b/Gui/mplayer/widgets.c @@ -18,6 +18,7 @@ #include "./mplayer.h" #include "../events.h" +#include "../app.h" #include "gtk/menu.h" #include "play.h" @@ -128,6 +129,12 @@ void gtkMessageBox( int type,gchar * str ) gtk_widget_show( MessageBox ); } +void gtkSetLayer( GtkWidget * wdg ) +{ + GdkWindowPrivate * win = wdg->window; + wsSetLayer( gdk_display,win->xwindow,appMPlayer.subWindow.isFullScreen ); +} + void gtkShow( int type,char * param ) { switch( type ) @@ -140,27 +147,34 @@ void gtkShow( int type,char * param ) gtkSetDefaultToCList( SkinList,param ); gtk_widget_show( SkinBrowser ); } + gtkSetLayer( SkinBrowser ); break; case evPreferences: gtk_widget_hide( Options ); gtk_widget_show( Options ); + gtkSetLayer( Options ); break; case evPlayList: gtk_widget_hide( PlayList ); gtk_widget_show( PlayList ); + gtkSetLayer( PlayList ); break; case evLoad: ShowFileSelect( fsVideoSelector ); + gtkSetLayer( FileSelect ); break; case evFirstLoad: ShowFileSelect( fsVideoSelector ); + gtkSetLayer( FileSelect ); break; case evLoadSubtitle: ShowFileSelect( fsSubtitleSelector ); + gtkSetLayer( FileSelect ); break; case evAbout: gtk_widget_hide( AboutBox ); gtk_widget_show( AboutBox ); + gtkSetLayer( AboutBox ); break; case evShowPopUpMenu: gtkPopupMenu=evNone; @@ -174,3 +188,5 @@ void gtkShow( int type,char * param ) break; } } + + -- cgit v1.2.3