]> git.sesse.net Git - vlc/blobdiff - modules/video_output/msw/events.c
Remove unneeded VOUT_CLOSE.
[vlc] / modules / video_output / msw / events.c
index ae1a26a7f56ddbf58d3465c7a7ae1fc1dc774ea6..7ac260dc9a46423122eb79ccc2b0503188099b03 100644 (file)
@@ -418,11 +418,12 @@ static int DirectXCreateWindow( vout_thread_t *p_vout )
 
     /* If an external window was specified, we'll draw in it. */
     p_vout->p_sys->parent_window =
-        vout_RequestWindow( p_vout, &p_vout->p_sys->i_window_x,
+        vout_RequestHWND( p_vout, &p_vout->p_sys->i_window_x,
                             &p_vout->p_sys->i_window_y,
                             &p_vout->p_sys->i_window_width,
                             &p_vout->p_sys->i_window_height );
-    p_vout->p_sys->hparent = p_vout->p_sys->parent_window->handle;
+    if( p_vout->p_sys->parent_window )
+        p_vout->p_sys->hparent = p_vout->p_sys->parent_window->handle.hwnd;
 
     /* We create the window ourself, there is no previous window proc. */
     p_vout->p_sys->pf_wndproc = NULL;
@@ -1074,8 +1075,6 @@ static int Control( vout_thread_t *p_vout, int i_query, va_list args )
 
         return VLC_SUCCESS;
 
-    case VOUT_CLOSE:
-        ShowWindow( p_vout->p_sys->hwnd, SW_HIDE );
     case VOUT_REPARENT:
         /* Retrieve the window position */
         point.x = point.y = 0;
@@ -1093,8 +1092,7 @@ static int Control( vout_thread_t *p_vout, int i_query, va_list args )
             p_vout->p_sys->i_window_style =
                 WS_CLIPCHILDREN | WS_OVERLAPPEDWINDOW | WS_SIZEBOX;
             SetWindowLong( p_vout->p_sys->hwnd, GWL_STYLE,
-                           p_vout->p_sys->i_window_style |
-                           (i_query == VOUT_CLOSE ? 0 : WS_VISIBLE) );
+                           p_vout->p_sys->i_window_style | WS_VISIBLE);
             SetWindowLong( p_vout->p_sys->hwnd, GWL_EXSTYLE, WS_EX_APPWINDOW );
             SetWindowPos( p_vout->p_sys->hwnd, 0, point.x, point.y, 0, 0,
                           SWP_NOSIZE|SWP_NOZORDER|SWP_FRAMECHANGED );
@@ -1108,8 +1106,7 @@ static int Control( vout_thread_t *p_vout, int i_query, va_list args )
             SetParent( p_vout->p_sys->hwnd, d );
             p_vout->p_sys->i_window_style = WS_CLIPCHILDREN;
             SetWindowLong( p_vout->p_sys->hwnd, GWL_STYLE,
-                           p_vout->p_sys->i_window_style |
-                           (i_query == VOUT_CLOSE ? 0 : WS_VISIBLE) );
+                           p_vout->p_sys->i_window_style | WS_VISIBLE);
             SetWindowLong( p_vout->p_sys->hwnd, GWL_EXSTYLE, WS_EX_APPWINDOW );
 
             /* Retrieve the parent size */
@@ -1202,6 +1199,15 @@ void Win32ToggleFullscreen( vout_thread_t *p_vout )
 
         if( p_vout->p_sys->hparent )
         {
+#ifdef UNDER_CE
+            POINT point = {0,0};
+            RECT rect;
+            ClientToScreen( p_vout->p_sys->hwnd, &point );
+            GetClientRect( p_vout->p_sys->hwnd, &rect );
+            SetWindowPos( hwnd, 0, point.x, point.y,
+                          rect.right, rect.bottom,
+                          SWP_NOZORDER|SWP_FRAMECHANGED );
+#else
             /* Retrieve current window position so fullscreen will happen
             *on the right screen */
             HMONITOR hmon = MonitorFromWindow(p_vout->p_sys->hparent,
@@ -1214,6 +1220,7 @@ void Win32ToggleFullscreen( vout_thread_t *p_vout )
                             mi.rcMonitor.right - mi.rcMonitor.left,
                             mi.rcMonitor.bottom - mi.rcMonitor.top,
                             SWP_NOZORDER|SWP_FRAMECHANGED );
+#endif
         }
 
         /* Maximize window */