[MPlayer-dev-eng] [PATCH]fullscreen issues with GUI, WM layers, gmplayer plays first file always twice
Michael Joosten
joost at c-lab.de
Sat Apr 19 06:11:26 CEST 2003
This is the first of a bunch of some small fixes for some annoying
problems we hit when using mplayer for some 'real users' in an unreal
project...
First: Hitting 'f' in gmplayer (not mplayer!) kills it, it crashes in a
BadWindow error somewhere in the XLib error handler. In mplFullScreen,
wsSetLayer is always called for subwindows, even if they are not
existing at all, like menu.
Second: The WM layer manipulation of file GTK selection box and message
boxes is wrong, they always end up at layer 0 instead of 4. Somehow the
original logic was confused (too late in the night?), and I tried to
reconstruct the desired behaviour.
Third: import_initial_playtree_into_gui() uses mplCurr(), which has the
nasty side effect of disabling mplGotoTheNext. Thus, mplEnd() des not
advance in the playlist and the first file is always played twice - in
gmplayer only. I just hacked this by introducing a function that
re-enabled mplGotoTheNext again, but you will probably write an own
mplXX() function for this purpose.
While the attachment fixes all that, I cannot claim that this is the
right way - but it works, and does not seem to harm anything else.
--
Michael Joosten, SBS C-LAB, joost at c-lab.de
Fuerstenallee 11, 33094 Paderborn, Germany
Phone: +49 5251 606127, Fax: +49 5251 606065
C-LAB is a cooperation of University Paderborn & SIEMENS
-------------- next part --------------
diff -ru ../mplayer-pur/main/Gui/interface.c main/Gui/interface.c
--- ../mplayer-pur/main/Gui/interface.c 2003-04-07 18:04:02.000000000 +0200
+++ main/Gui/interface.c 2003-04-11 22:24:12.000000000 +0200
@@ -1145,6 +1145,7 @@
}
mplCurr(); // Update filename
+ mplEnableGotoNext(); /* HACK: must have mplGotoNext = 1, else plays first file twice !! */
if (!enqueue)
filename=guiIntfStruct.Filename; // Backward compatibility; if file is specified on commandline,
diff -ru ../mplayer-pur/main/Gui/mplayer/play.c main/Gui/mplayer/play.c
--- ../mplayer-pur/main/Gui/mplayer/play.c 2003-02-06 00:01:02.000000000 +0100
+++ main/Gui/mplayer/play.c 2003-04-11 22:24:12.000000000 +0200
@@ -57,7 +57,7 @@
if ( guiIntfStruct.Playing || gtkShowVideoWindow ) wsFullScreen( &appMPlayer.subWindow );
fullscreen=vo_fs=appMPlayer.subWindow.isFullScreen;
wsSetLayer( wsDisplay,appMPlayer.mainWindow.WindowID,appMPlayer.subWindow.isFullScreen );
- wsSetLayer( wsDisplay,appMPlayer.menuWindow.WindowID,appMPlayer.subWindow.isFullScreen );
+ if (appMPlayer.menuIsPresent) wsSetLayer( wsDisplay,appMPlayer.menuWindow.WindowID,appMPlayer.subWindow.isFullScreen );
if ( guiIntfStruct.Playing ) wsSetBackgroundRGB( &appMPlayer.subWindow,0,0,0 );
else wsSetBackgroundRGB( &appMPlayer.subWindow,appMPlayer.sub.R,appMPlayer.sub.G,appMPlayer.sub.B );
@@ -369,3 +369,9 @@
if ( stop ) mplEventHandling( evStop,0 );
if ( guiIntfStruct.Playing == 1 ) mplEventHandling( evPlay,0 );
}
+
+/* needed for commandline files for gui in import_initial_playtree_into_gui() */
+void mplEnableGotoNext(void)
+{
+ mplGotoTheNext = 1;
+}
diff -ru ../mplayer-pur/main/Gui/mplayer/play.h main/Gui/mplayer/play.h
--- ../mplayer-pur/main/Gui/mplayer/play.h 2003-02-06 00:01:02.000000000 +0100
+++ main/Gui/mplayer/play.h 2003-04-11 22:24:12.000000000 +0200
@@ -31,4 +31,6 @@
extern void mplSetFileName( char * dir,char * name,int type );
+extern void mplEnableGotoNext( void );
+
#endif
diff -ru ../mplayer-pur/main/libvo/x11_common.c main/libvo/x11_common.c
--- ../mplayer-pur/main/libvo/x11_common.c 2003-04-09 19:05:35.000000000 +0200
+++ main/libvo/x11_common.c 2003-04-11 22:24:12.000000000 +0200
@@ -783,7 +783,7 @@
{
XClientMessageEvent xev;
- if (layer) orig_layer=vo_x11_get_gnome_layer( mDisplay, vo_window );
+ if (!orig_layer) orig_layer=vo_x11_get_gnome_layer( mDisplay, vo_window );
memset(&xev, 0, sizeof(xev));
xev.type = ClientMessage;
More information about the MPlayer-dev-eng
mailing list