Commit 5891386e authored by Sergey Radionov's avatar Sergey Radionov Committed by Jean-Baptiste Kempf

ActiveX, npapi: fixed not popping of control panel in fullscreen mode.

(was broken by "ActiveX, NpApi: DVD Menu control for VIDEO_TS")
Signed-off-by: Jean-Baptiste Kempf's avatarJean-Baptiste Kempf <jb@videolan.org>
parent f3ffb56a
......@@ -36,8 +36,8 @@ ATOM VLCHolderWnd::_holder_wndclass_atom = 0;
enum{
WM_TRY_SET_MOUSE_HOOK = WM_USER+1,
WM_LBUTTONDBLCLK_NOTIFY = WM_APP+1,
WM_LBUTTONDBLCLK_NOTIFY_SUCCESS = 0xFF
WM_MOUSE_EVENT_NOTIFY = WM_APP+1,
WM_MOUSE_EVENT_NOTIFY_SUCCESS = 0xFF
};
void VLCHolderWnd::RegisterWndClassName(HINSTANCE hInstance)
......@@ -130,10 +130,9 @@ LRESULT CALLBACK VLCHolderWnd::VLCHolderClassWndProc(HWND hWnd, UINT uMsg, WPARA
}
break;
}
case WM_LBUTTONDBLCLK_NOTIFY:{
h_data->_WindowsManager->ToggleFullScreen();
return WM_LBUTTONDBLCLK_NOTIFY_SUCCESS;
break;
case WM_MOUSE_EVENT_NOTIFY:{
h_data->_WindowsManager->OnMouseEvent(wParam);
return WM_MOUSE_EVENT_NOTIFY_SUCCESS;
}
default:
return DefWindowProc(hWnd, uMsg, wParam, lParam);
......@@ -151,18 +150,24 @@ void VLCHolderWnd::DestroyWindow()
LRESULT CALLBACK VLCHolderWnd::MouseHookProc(int nCode, WPARAM wParam, LPARAM lParam)
{
bool AllowReceiveMessage = true;
if(nCode >= 0 && WM_LBUTTONDBLCLK == wParam){
MOUSEHOOKSTRUCT* mhs = reinterpret_cast<MOUSEHOOKSTRUCT*>(lParam);
//try find HolderWnd and notify it
HWND hNotifyWnd = mhs->hwnd;
LRESULT SMRes = ::SendMessage(hNotifyWnd, WM_LBUTTONDBLCLK_NOTIFY, 0, 0);
while( hNotifyWnd && WM_LBUTTONDBLCLK_NOTIFY_SUCCESS != SMRes){
hNotifyWnd = GetParent(hNotifyWnd);
SMRes = ::SendMessage(hNotifyWnd, WM_LBUTTONDBLCLK_NOTIFY, 0, 0);
}
if(nCode >= 0){
switch(wParam){
case WM_MOUSEMOVE:
case WM_LBUTTONDBLCLK:{
MOUSEHOOKSTRUCT* mhs = reinterpret_cast<MOUSEHOOKSTRUCT*>(lParam);
//try find HolderWnd and notify it
HWND hNotifyWnd = mhs->hwnd;
LRESULT SMRes = ::SendMessage(hNotifyWnd, WM_MOUSE_EVENT_NOTIFY, wParam, 0);
while( hNotifyWnd && WM_MOUSE_EVENT_NOTIFY_SUCCESS != SMRes){
hNotifyWnd = GetParent(hNotifyWnd);
SMRes = ::SendMessage(hNotifyWnd, WM_MOUSE_EVENT_NOTIFY, wParam, 0);
}
AllowReceiveMessage = (WM_LBUTTONDBLCLK_NOTIFY_SUCCESS != SMRes);
AllowReceiveMessage = WM_MOUSEMOVE==wParam || (WM_MOUSE_EVENT_NOTIFY_SUCCESS != SMRes);
break;
}
}
}
LRESULT NHRes = CallNextHookEx(NULL, nCode, wParam, lParam);
......@@ -328,13 +333,6 @@ LRESULT CALLBACK VLCFullScreenWnd::FSWndWindowProc(HWND hWnd, UINT uMsg, WPARAM
delete fs_data;
SetWindowLongPtr(hWnd, GWLP_USERDATA, 0);
break;
case WM_MOUSEMOVE:{
if(fs_data->Last_WM_MOUSEMOVE_lParam!=lParam){
fs_data->Last_WM_MOUSEMOVE_lParam = lParam;
fs_data->NeedShowControls();
}
break;
}
case WM_SHOWWINDOW:{
if(FALSE==wParam){ //hidding
fs_data->UnRegisterEvents();
......@@ -471,11 +469,6 @@ LRESULT CALLBACK VLCFullScreenWnd::FSControlsWndWindowProc(HWND hWnd, UINT uMsg,
break;
}
case WM_MOUSEMOVE:{
fs_data->Last_WM_MOUSEMOVE_lParam = lParam;
fs_data->NeedShowControls();//not allow close controll window while mouse within
break;
}
case WM_LBUTTONUP:{
POINT BtnUpPoint = {LOWORD(lParam), HIWORD(lParam)};
RECT VideoPosRect;
......@@ -911,7 +904,8 @@ void VLCFullScreenWnd::UnRegisterEvents()
//VLCWindowsManager
///////////////////////
VLCWindowsManager::VLCWindowsManager(HMODULE hModule)
:_hModule(hModule), _hWindowedParentWnd(0), _HolderWnd(0), _FSWnd(0), _b_new_messages_flag(false)
:_hModule(hModule), _hWindowedParentWnd(0), _HolderWnd(0), _FSWnd(0),
_b_new_messages_flag(false), Last_WM_MOUSEMOVE_Pos(0)
{
VLCHolderWnd::RegisterWndClassName(hModule);
VLCFullScreenWnd::RegisterWndClassName(hModule);
......@@ -1019,3 +1013,19 @@ bool VLCWindowsManager::IsFullScreen()
return 0!=_FSWnd && 0!=_HolderWnd && GetParent(_HolderWnd->getHWND())==_FSWnd->getHWND();
}
void VLCWindowsManager::OnMouseEvent(UINT uMouseMsg)
{
switch(uMouseMsg){
case WM_LBUTTONDBLCLK:
ToggleFullScreen();
break;
case WM_MOUSEMOVE:{
DWORD MsgPos = GetMessagePos();
if(Last_WM_MOUSEMOVE_Pos != MsgPos){
Last_WM_MOUSEMOVE_Pos = MsgPos;
if(IsFullScreen()) _FSWnd->NeedShowControls();
}
break;
}
}
}
......@@ -98,7 +98,7 @@ private:
private:
VLCFullScreenWnd(HWND hWnd, VLCWindowsManager* WM)
: Last_WM_MOUSEMOVE_lParam(0),_WindowsManager(WM), hControlsWnd(0), hToolTipWnd(0),
: _WindowsManager(WM), hControlsWnd(0), hToolTipWnd(0),
hNewMessageBitmap(0), hFSButtonBitmap(0), hFSButton(0),
hPauseBitmap(0), hPlayBitmap(0), hPlayPauseButton(0), hVideoPosScroll(0),
hVolumeBitmap(0), hVolumeMutedBitmap(0),hMuteButton(0),
......@@ -130,14 +130,14 @@ private:
void SyncVolumeSliderWithVLCVolume();
void SetVLCVolumeBySliderPos(int CurScrollPos);
public:
void NeedShowControls();
void NeedHideControls();
private:
void CreateToolTip();
void NeedHideControls();
private:
LPARAM Last_WM_MOUSEMOVE_lParam;
void CreateToolTip();
private:
VLCWindowsManager* _WindowsManager;
......@@ -207,6 +207,8 @@ public:
{_b_new_messages_flag = Yes;};
bool getNewMessageFlag() const
{return _b_new_messages_flag;};
public:
void OnMouseEvent(UINT uMouseMsg);
private:
HMODULE _hModule;
......@@ -216,6 +218,9 @@ private:
VLCFullScreenWnd* _FSWnd;
bool _b_new_messages_flag;
private:
DWORD Last_WM_MOUSEMOVE_Pos;
};
#endif //_WIN32
......
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