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