Explorar el Código

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.
jp9000 hace 9 años
padre
commit
61773bcbf2
Se han modificado 1 ficheros con 7 adiciones y 3 borrados
  1. 7 3
      plugins/win-capture/game-capture.c

+ 7 - 3
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;