+ MONITORINFO monitor_info;
+ monitor_info.cbSize = sizeof( MONITORINFO );
+
+ if( p_vout->p_sys->GetMonitorInfo( hmon, &monitor_info ) )
+ {
+ RECT rect;
+
+ /* Move window to the right screen */
+ GetWindowRect( p_vout->p_sys->hwnd, &rect );
+ if( !IntersectRect( &rect, &rect, &monitor_info.rcWork ) )
+ {
+ rect.left = monitor_info.rcWork.left;
+ rect.top = monitor_info.rcWork.top;
+ msg_Dbg( p_vout, "DirectXEnumCallback: Setting window "
+ "position to %d,%d", rect.left, rect.top );
+ SetWindowPos( p_vout->p_sys->hwnd, NULL,
+ rect.left, rect.top, 0, 0,
+ SWP_NOSIZE | SWP_NOZORDER | SWP_NOACTIVATE );
+ }
+ }
+