[MPlayer-dev-eng] [PATCH] improved toggle: left click on video window

Andre Kuehne andre.kuehne at gmx.net
Wed Aug 11 18:46:55 CEST 2004


Hi

Here is a revised version of the patch. The functionality
has not changed, but

- i did some unrelated cleanup (removing unused variables)
  in the original patch. Should have known better.
  
- Also the variable "mainWindowOnTop" is now "mainOnTop"
  which is more like existing variable names. (e.g. mainVisible)

Regards

-- 
     _   _
_/\_| |_( )_
Andre Kuehne
-------------- next part --------------
Index: Gui/mplayer/mw.c
===================================================================
RCS file: /cvsroot/mplayer/main/Gui/mplayer/mw.c,v
retrieving revision 1.111
diff -u -B -r1.111 mw.c
--- Gui/mplayer/mw.c	26 Jun 2004 13:26:11 -0000	1.111
+++ Gui/mplayer/mw.c	11 Aug 2004 15:43:51 -0000
@@ -41,6 +41,7 @@
 int             mplMiddleMenu = 0;
 
 int             mainVisible = 1;
+int             mainOnTop = 0;
 
 int             boxMoved = 0;
 int             sx = 0,sy = 0;
@@ -55,6 +56,7 @@
  int        i, type;
 
  if ( appMPlayer.mainWindow.State == wsWindowClosed ) exit_player( MSGTR_Exit_quit );
+ else if ( appMPlayer.mainWindow.State == wsWindowFocusIn ) mainOnTop = 1;
  
  if ( appMPlayer.mainWindow.Visible == wsWindowNotVisible ||
       !mainVisible ) return;
Index: Gui/mplayer/play.c
===================================================================
RCS file: /cvsroot/mplayer/main/Gui/mplayer/play.c,v
retrieving revision 1.89
diff -u -B -r1.89 play.c
--- Gui/mplayer/play.c	25 Mar 2004 21:49:48 -0000	1.89
+++ Gui/mplayer/play.c	11 Aug 2004 15:43:53 -0000
@@ -31,6 +31,7 @@
 
 extern float rel_seek_secs;
 extern int abs_seek_pos;
+extern int mainOnTop;
 
 int mplGotoTheNext = 1;
 
@@ -61,6 +62,9 @@
 
  if ( guiIntfStruct.Playing ) wsSetBackgroundRGB( &appMPlayer.subWindow,0,0,0 );
   else wsSetBackgroundRGB( &appMPlayer.subWindow,appMPlayer.sub.R,appMPlayer.sub.G,appMPlayer.sub.B );
+
+  if( mainOnTop ) wsMoveTopWindow( wsDisplay,appMPlayer.mainWindow.WindowID );
+  else wsMoveTopWindow( wsDisplay,appMPlayer.subWindow.WindowID );
 }
 
 extern int mplSubRender;
Index: Gui/mplayer/sw.c
===================================================================
RCS file: /cvsroot/mplayer/main/Gui/mplayer/sw.c,v
retrieving revision 1.41
diff -u -B -r1.41 sw.c
--- Gui/mplayer/sw.c	20 Mar 2003 12:42:09 -0000	1.41
+++ Gui/mplayer/sw.c	11 Aug 2004 15:43:53 -0000
@@ -13,8 +13,8 @@
 #include "widgets.h"
 
 int             mplSubRender = 0;
-int             SubVisible = 0;
 
+extern int             mainOnTop;
 extern int             boxMoved;
 extern int             sx,sy;
 extern int             i,pot;
@@ -22,9 +22,6 @@
 void mplSubDraw( void )
 {
  if ( appMPlayer.subWindow.State == wsWindowClosed ) exit_player( MSGTR_Exit_quit );
- 
- if ( appMPlayer.subWindow.State == wsWindowFocusIn ) SubVisible++;
- if ( appMPlayer.subWindow.State == wsWindowFocusOut && metacity_hack != 3 ) SubVisible--;
 
  if ( !appMPlayer.subWindow.Mapped ||
       appMPlayer.subWindow.Visible == wsWindowNotVisible ) return;
@@ -80,11 +77,19 @@
            }
           break;
    case wsRLMouseButton:
-          if ( ( !mplSubMoved )&&( appMPlayer.subWindow.isFullScreen ) )
+          if ( !mplSubMoved )
            {
-            if( SubVisible++%2 ) wsMoveTopWindow( wsDisplay,appMPlayer.mainWindow.WindowID );
-             else wsMoveTopWindow( wsDisplay,appMPlayer.subWindow.WindowID );
-	   }
+            if( mainOnTop )
+             {
+              mainOnTop = 0;
+              wsMoveTopWindow( wsDisplay,appMPlayer.subWindow.WindowID );
+             }
+            else
+             {
+              mainOnTop = 1;
+              wsMoveTopWindow( wsDisplay,appMPlayer.mainWindow.WindowID );
+             }
+           }
           msButton=0;
           mplSubMoved=0;
           break;


More information about the MPlayer-dev-eng mailing list