[MPlayer-cvslog] r35882 - in trunk/gui: interface.c ui/video.c

ib subversion at mplayerhq.hu
Fri Jan 25 16:12:25 CET 2013


Author: ib
Date: Fri Jan 25 16:12:25 2013
New Revision: 35882

Log:
Move video window initialization code to uiVideoInit().

Modified:
   trunk/gui/interface.c
   trunk/gui/ui/video.c

Modified: trunk/gui/interface.c
==============================================================================
--- trunk/gui/interface.c	Fri Jan 25 15:53:12 2013	(r35881)
+++ trunk/gui/interface.c	Fri Jan 25 16:12:25 2013	(r35882)
@@ -173,13 +173,6 @@ void guiInit(void)
     if (guiWinID >= 0)
         guiApp.mainWindow.Parent = guiWinID;
 
-    wsWindowCreate(&guiApp.videoWindow, guiApp.video.x, guiApp.video.y, guiApp.video.width, guiApp.video.height, wsShowFrame | wsHideWindow | wsWaitMap | wsAspect, wsShowMouseCursor | wsHandleMouseButton | wsHandleMouseMove, "MPlayer - Video");
-    wsImageDestroy(&guiApp.videoWindow);
-    wsImageCreate(&guiApp.videoWindow, guiApp.video.Bitmap.Width, guiApp.video.Bitmap.Height);
-    wsXDNDMakeAwareness(&guiApp.videoWindow);
-
-    WinID = guiApp.videoWindow.WindowID;
-
 // i=wsHideFrame|wsMaxSize|wsHideWindow;
 // if ( guiApp.mainDecoration ) i=wsShowFrame|wsMaxSize|wsHideWindow;
     i = (guiApp.mainDecoration ? wsShowFrame : 0) | wsMinSize | wsMaxSize | wsHideWindow;
@@ -188,22 +181,19 @@ void guiInit(void)
     wsXDNDMakeAwareness(&guiApp.mainWindow);
 
     mp_msg(MSGT_GPLAYER, MSGL_DBG2, "[interface] mainWindow ID: 0x%x\n", (int)guiApp.mainWindow.WindowID);
-    mp_msg(MSGT_GPLAYER, MSGL_DBG2, "[interface] videoWindow ID: 0x%x\n", (int)guiApp.videoWindow.WindowID);
 
     uiMainInit();      // main window must be first!
     uiVideoInit();     // video window must be second!
     uiPlaybarInit();
     uiMenuInit();
 
-    if (guiApp.video.Bitmap.Image)
-        wsImageRender(&guiApp.videoWindow, guiApp.video.Bitmap.Image);
+    WinID = guiApp.videoWindow.WindowID;
 
     btnModify(evSetVolume, guiInfo.Volume);
     btnModify(evSetBalance, guiInfo.Balance);
     btnModify(evSetMoviePosition, guiInfo.Position);
 
     wsWindowIcon(wsDisplay, guiApp.mainWindow.WindowID, &guiIcon);
-    wsWindowIcon(wsDisplay, guiApp.videoWindow.WindowID, &guiIcon);
 
     wsWindowVisibility(&guiApp.mainWindow, wsShowWindow);
 

Modified: trunk/gui/ui/video.c
==============================================================================
--- trunk/gui/ui/video.c	Fri Jan 25 15:53:12 2013	(r35881)
+++ trunk/gui/ui/video.c	Fri Jan 25 16:12:25 2013	(r35882)
@@ -22,6 +22,7 @@
 
 #include "libvo/x11_common.h"
 #include "help_mp.h"
+#include "mp_msg.h"
 #include "mp_core.h"
 
 #include "ui.h"
@@ -29,6 +30,8 @@
 #include "gui/app/gui.h"
 #include "gui/interface.h"
 #include "gui/dialog/dialog.h"
+#include "gui/wm/ws.h"
+#include "gui/wm/wsxdnd.h"
 
 int             videoVisible = 0;
 
@@ -109,6 +112,15 @@ static void uiVideoMouse( int Button,int
 
 void uiVideoInit (void)
 {
+  wsWindowCreate(&guiApp.videoWindow, guiApp.video.x, guiApp.video.y, guiApp.video.width, guiApp.video.height, wsShowFrame | wsHideWindow | wsWaitMap | wsAspect, wsShowMouseCursor | wsHandleMouseButton | wsHandleMouseMove, "MPlayer - Video");
+  mp_msg(MSGT_GPLAYER, MSGL_DBG2, "[video] videoWindow ID: 0x%x\n", (int) guiApp.videoWindow.WindowID);
+  wsWindowIcon(wsDisplay, guiApp.videoWindow.WindowID, &guiIcon);
+  if (guiApp.video.Bitmap.Image)
+  {
+    wsImageResize(&guiApp.videoWindow, guiApp.video.Bitmap.Width, guiApp.video.Bitmap.Height);
+    wsImageRender(&guiApp.videoWindow, guiApp.video.Bitmap.Image);
+  }
+  wsXDNDMakeAwareness(&guiApp.videoWindow);
   guiApp.videoWindow.DrawHandler = uiVideoDraw;
   guiApp.videoWindow.MouseHandler = uiVideoMouse;
   guiApp.videoWindow.KeyHandler = guiApp.mainWindow.KeyHandler;


More information about the MPlayer-cvslog mailing list