Commit beaf0baf authored by KO Myung-Hun's avatar KO Myung-Hun Committed by Rafaël Carré

skins2: fix mouse cursor shape change and mouse cursor position on OS/2

Signed-off-by: Rafaël Carré's avatarRafaël Carré <funman@videolan.org>
parent c8e41f79
......@@ -154,7 +154,7 @@ MRESULT EXPENTRY OS2Factory::OS2Proc( HWND hwnd, ULONG msg,
OS2Factory::OS2Factory( intf_thread_t *pIntf ):
OSFactory( pIntf ), m_hParentWindow( 0 ),
m_dirSep( "\\" ), m_pfnwpOldFrameProc( 0 )
m_pfnwpOldFrameProc( 0 ), m_dirSep( "\\" )
{
// see init()
}
......@@ -204,6 +204,9 @@ bool OS2Factory::init()
SWP_ACTIVATE | SWP_ZORDER | SWP_MOVE | SWP_SIZE |
SWP_SHOW );
// Set the mouse pointer to a default arrow
changeCursor( kDefaultArrow );
// Initialize the resource path
char *datadir = config_GetUserDir( VLC_DATA_DIR );
m_resourcePath.push_back( (string)datadir + "\\skins" );
......@@ -407,6 +410,8 @@ void OS2Factory::changeCursor( CursorType_t type ) const
HPOINTER hptr = WinQuerySysPointer( HWND_DESKTOP, id, FALSE );
WinSetPointer( HWND_DESKTOP, hptr );
m_cursorType = type;
}
......
......@@ -121,8 +121,12 @@ public:
/// Map to find the GenericWindow associated with a OS2Window
map<HWND, GenericWindow*> m_windowMap;
/// Get the parent window handle
HWND getParentWindow() { return m_hParentClientWindow; }
/// Get the m_cursorType
CursorType_t getCursorType() const { return m_cursorType; }
/// Callback function (Windows Procedure)
static MRESULT EXPENTRY OS2FrameProc( HWND hwnd, ULONG msg,
MPARAM mp1, MPARAM Mp2 );
......@@ -136,12 +140,14 @@ private:
HAB m_hab;
/// Handle of message queue
HMQ m_hmq;
/// Window procedure of the old frame window
PFNWP m_pfnwpOldFrameProc;
/// Handle of the parent window
HWND m_hParentWindow;
/// Handle of the client window of the parent window
HWND m_hParentClientWindow;
/// Window procedure of the old frame window
PFNWP m_pfnwpOldFrameProc;
/// Cursor type
mutable CursorType_t m_cursorType;
/// Directory separator
const string m_dirSep;
/// Resource path
......
......@@ -147,14 +147,17 @@ MRESULT EXPENTRY OS2Loop::processEvent( HWND hwnd, ULONG msg,
}
case WM_MOUSEMOVE:
{
pFactory->changeCursor( pFactory->getCursorType());
// Compute the absolute position of the mouse
int x = GET_X_MP( mp1 ) + win.getLeft();
int y = GET_Y_MP( mp1 ) + win.getTop();
POINTL ptl;
WinQueryPointerPos( HWND_DESKTOP, &ptl );
int x = ptl.x;
int y = ( pFactory->getScreenHeight() - 1 ) - ptl.y;
EvtMotion evt( getIntf(), x, y );
win.processEvent( evt );
// fall though to WinDefWindowProc()
break;
return MRFROMLONG( TRUE );
}
case WM_MOUSELEAVE:
{
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment