win-capture: Fix cursor not painting with UWP windows

Because the hook cannot get the window handle of UWP windows, fall back
to using the window handle stored in the game capture source itself if
it's unavailable from the hook.
This commit is contained in:
jp9000
2016-12-15 20:17:53 -08:00
parent b3119e0a8d
commit 61773bcbf2

View File

@@ -1729,13 +1729,17 @@ static void game_capture_tick(void *data, float seconds)
static inline void game_capture_render_cursor(struct game_capture *gc)
{
POINT p = {0};
HWND window;
if (!gc->global_hook_info->window ||
!gc->global_hook_info->base_cx ||
if (!gc->global_hook_info->base_cx ||
!gc->global_hook_info->base_cy)
return;
ClientToScreen((HWND)(uintptr_t)gc->global_hook_info->window, &p);
window = !!gc->global_hook_info->window
? (HWND)(uintptr_t)gc->global_hook_info->window
: gc->window;
ClientToScreen(window, &p);
float x_scale = (float)gc->global_hook_info->cx /
(float)gc->global_hook_info->base_cx;