Przeglądaj źródła

win-capture: Fix reporting valid width and height if not capturing

While the inject-helper tries to hook an application, the source is
set to `active` until the inject-helper reports being unable to hook.

If the graphics thread updates the transformations of every source in
that time frame, the game-capture source will report the width and
height used from the last valid capture, leading to its selection box
flickering in and out of view.

Ensuring that width and height are only reported when the source is not
only made active but is also capturing content fixes the flickering
issue.
PatTheMav 3 lat temu
rodzic
commit
992d18b66c
1 zmienionych plików z 2 dodań i 2 usunięć
  1. 2 2
      plugins/win-capture/game-capture.c

+ 2 - 2
plugins/win-capture/game-capture.c

@@ -2194,13 +2194,13 @@ static void game_capture_render(void *data, gs_effect_t *unused)
 static uint32_t game_capture_width(void *data)
 {
 	struct game_capture *gc = data;
-	return gc->active ? gc->cx : 0;
+	return (gc->active && gc->capturing) ? gc->cx : 0;
 }
 
 static uint32_t game_capture_height(void *data)
 {
 	struct game_capture *gc = data;
-	return gc->active ? gc->cy : 0;
+	return (gc->active && gc->capturing) ? gc->cy : 0;
 }
 
 static const char *game_capture_name(void *unused)