mirror of
https://github.com/gnif/LookingGlass.git
synced 2024-11-25 14:57:20 +00:00
[host] nvfbc: generate cursor position update on startup
Before this commit, the NvFBC backend only generated the first cursor position update when the mouse moves. Therefore, if the user does not move the mouse, the cursor will be shown at (0, 0), which is not ideal. This commit changes this behaviour to unconditionally generate a cursor update when the mouse hook initializes.
This commit is contained in:
parent
05f2305fa0
commit
b97130cf20
@ -56,6 +56,13 @@ static bool switchDesktopAndHook(void)
|
|||||||
}
|
}
|
||||||
CloseDesktop(desk);
|
CloseDesktop(desk);
|
||||||
|
|
||||||
|
POINT position;
|
||||||
|
GetCursorPos(&position);
|
||||||
|
|
||||||
|
mouseHook.x = position.x;
|
||||||
|
mouseHook.y = position.y;
|
||||||
|
mouseHook.callback(position.x, position.y);
|
||||||
|
|
||||||
mouseHook.hook = SetWindowsHookEx(WH_MOUSE_LL, mouseHook_hook, NULL, 0);
|
mouseHook.hook = SetWindowsHookEx(WH_MOUSE_LL, mouseHook_hook, NULL, 0);
|
||||||
if (!mouseHook.hook)
|
if (!mouseHook.hook)
|
||||||
{
|
{
|
||||||
@ -84,11 +91,11 @@ static DWORD WINAPI threadProc(LPVOID lParam) {
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
mouseHook.callback = (MouseHookFn)lParam;
|
||||||
if (!switchDesktopAndHook())
|
if (!switchDesktopAndHook())
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
mouseHook.installed = true;
|
mouseHook.installed = true;
|
||||||
mouseHook.callback = (MouseHookFn)lParam;
|
|
||||||
|
|
||||||
HWINEVENTHOOK eventHook = SetWinEventHook(
|
HWINEVENTHOOK eventHook = SetWinEventHook(
|
||||||
EVENT_SYSTEM_DESKTOPSWITCH, EVENT_SYSTEM_DESKTOPSWITCH, NULL,
|
EVENT_SYSTEM_DESKTOPSWITCH, EVENT_SYSTEM_DESKTOPSWITCH, NULL,
|
||||||
|
Loading…
Reference in New Issue
Block a user