mirror of
https://foundry.openuru.org/gitblit/r/CWE-ou-minkata.git
synced 2025-07-20 12:19:10 +00:00
Fix no cursor on window frame and title bar.
Remove mouse capture and handle visibility via WM_SETCURSOR messages instead of window activation events.
This commit is contained in:
@ -57,6 +57,7 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com
|
|||||||
#include "../plNetClient/plNetClientMgr.h"
|
#include "../plNetClient/plNetClientMgr.h"
|
||||||
#include "../plNetClient/plNetLinkingMgr.h"
|
#include "../plNetClient/plNetLinkingMgr.h"
|
||||||
#include "../plInputCore/plInputManager.h"
|
#include "../plInputCore/plInputManager.h"
|
||||||
|
#include "../plInputCore/plInputDevice.h"
|
||||||
#include "../plUnifiedTime/plUnifiedTime.h"
|
#include "../plUnifiedTime/plUnifiedTime.h"
|
||||||
#include "plPipeline.h"
|
#include "plPipeline.h"
|
||||||
#include "../plResMgr/plResManager.h"
|
#include "../plResMgr/plResManager.h"
|
||||||
@ -497,6 +498,31 @@ LRESULT CALLBACK WndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam)
|
|||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
case WM_SETCURSOR:
|
||||||
|
{
|
||||||
|
static bool winCursor = true;
|
||||||
|
if (LOWORD(lParam) == HTCLIENT)
|
||||||
|
{
|
||||||
|
if (winCursor)
|
||||||
|
{
|
||||||
|
winCursor = false;
|
||||||
|
ShowCursor(FALSE);
|
||||||
|
plMouseDevice::ShowCursor();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
if (!winCursor)
|
||||||
|
{
|
||||||
|
winCursor = true;
|
||||||
|
ShowCursor(TRUE);
|
||||||
|
plMouseDevice::HideCursor();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return TRUE;
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
|
||||||
case WM_ACTIVATE:
|
case WM_ACTIVATE:
|
||||||
{
|
{
|
||||||
bool active = (LOWORD(wParam) == WA_ACTIVE || LOWORD(wParam) == WA_CLICKACTIVE);
|
bool active = (LOWORD(wParam) == WA_ACTIVE || LOWORD(wParam) == WA_CLICKACTIVE);
|
||||||
|
@ -933,26 +933,3 @@ hsBool plMouseDevice::MsgReceive(plMessage* msg)
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
void plMouseDevice::HandleWindowActivate(bool bActive, HWND hWnd)
|
|
||||||
{
|
|
||||||
if ( bActive )
|
|
||||||
{
|
|
||||||
RECT rect;
|
|
||||||
::GetClientRect(hWnd,&rect);
|
|
||||||
|
|
||||||
// rect.right /= plInputManager::GetInstance()->GetMouseScale();
|
|
||||||
// rect.bottom /= plInputManager::GetInstance()->GetMouseScale();
|
|
||||||
|
|
||||||
::MapWindowPoints( hWnd, NULL, (POINT *)&rect, 2 );
|
|
||||||
::ShowCursor( FALSE );
|
|
||||||
SetCapture(hWnd);
|
|
||||||
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
ReleaseCapture();
|
|
||||||
::ShowCursor( TRUE );
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
@ -173,7 +173,6 @@ public:
|
|||||||
~plMouseDevice();
|
~plMouseDevice();
|
||||||
|
|
||||||
const char* GetInputName() { return "mouse"; }
|
const char* GetInputName() { return "mouse"; }
|
||||||
void HandleWindowActivate(bool bActive, HWND hWnd);
|
|
||||||
|
|
||||||
hsBool HasControlFlag(int f) const { return fControlFlags.IsBitSet(f); }
|
hsBool HasControlFlag(int f) const { return fControlFlags.IsBitSet(f); }
|
||||||
void SetControlFlag(int f)
|
void SetControlFlag(int f)
|
||||||
|
@ -564,8 +564,6 @@ void plDInputMgr::AddDevice(IDirectInputDevice8* device)
|
|||||||
void plDInputMgr::ConfigureDevice()
|
void plDInputMgr::ConfigureDevice()
|
||||||
{
|
{
|
||||||
::ShowCursor( TRUE );
|
::ShowCursor( TRUE );
|
||||||
ReleaseCapture();
|
|
||||||
|
|
||||||
|
|
||||||
DICOLORSET dics;
|
DICOLORSET dics;
|
||||||
ZeroMemory(&dics, sizeof(DICOLORSET));
|
ZeroMemory(&dics, sizeof(DICOLORSET));
|
||||||
@ -587,8 +585,6 @@ void plDInputMgr::ConfigureDevice()
|
|||||||
fDI->fSticks[i]->fDevice->SetActionMap( fDI->fActionFormat, NULL, DIDSAM_FORCESAVE );
|
fDI->fSticks[i]->fDevice->SetActionMap( fDI->fActionFormat, NULL, DIDSAM_FORCESAVE );
|
||||||
|
|
||||||
::ShowCursor( FALSE );
|
::ShowCursor( FALSE );
|
||||||
SetCapture(fhWnd);
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
hsBool plDInputMgr::MsgReceive(plMessage* msg)
|
hsBool plDInputMgr::MsgReceive(plMessage* msg)
|
||||||
|
@ -2233,7 +2233,6 @@ hsBool plDXPipeline::IResetDevice()
|
|||||||
{
|
{
|
||||||
IClearShadowSlaves();
|
IClearShadowSlaves();
|
||||||
|
|
||||||
ReleaseCapture();
|
|
||||||
Sleep(100);
|
Sleep(100);
|
||||||
HRESULT coopLev = fD3DDevice->TestCooperativeLevel();
|
HRESULT coopLev = fD3DDevice->TestCooperativeLevel();
|
||||||
if( coopLev == D3DERR_DEVICELOST )
|
if( coopLev == D3DERR_DEVICELOST )
|
||||||
@ -2281,8 +2280,6 @@ hsBool plDXPipeline::IResetDevice()
|
|||||||
/// all device-specific stuff needs to be recreated
|
/// all device-specific stuff needs to be recreated
|
||||||
plDeviceRecreateMsg* clean = TRACKED_NEW plDeviceRecreateMsg();
|
plDeviceRecreateMsg* clean = TRACKED_NEW plDeviceRecreateMsg();
|
||||||
plgDispatch::MsgSend(clean);
|
plgDispatch::MsgSend(clean);
|
||||||
|
|
||||||
SetCapture(fSettings.fHWnd);
|
|
||||||
}
|
}
|
||||||
fDevWasLost = true;
|
fDevWasLost = true;
|
||||||
fDeviceLost = false;
|
fDeviceLost = false;
|
||||||
|
Reference in New Issue
Block a user