From 61773bcbf20e940d3a0b6c55fa00a5178af4231d Mon Sep 17 00:00:00 2001 From: jp9000 Date: Thu, 15 Dec 2016 20:17:53 -0800 Subject: [PATCH] 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. --- plugins/win-capture/game-capture.c | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/plugins/win-capture/game-capture.c b/plugins/win-capture/game-capture.c index 6dfde2c9b..0e91d0f71 100644 --- a/plugins/win-capture/game-capture.c +++ b/plugins/win-capture/game-capture.c @@ -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;