Browse Source

win-capture: Fix game capture hotkey activating immediately

When game capture was set to hotkey mode by the user, it would try to
activate the capture right away without waiting for the user to press a
hotkey.
jp9000 9 years ago
parent
commit
2c531f04df
1 changed files with 7 additions and 1 deletions
  1. 7 1
      plugins/win-capture/game-capture.c

+ 7 - 1
plugins/win-capture/game-capture.c

@@ -420,9 +420,15 @@ static void game_capture_update(void *data, obs_data_t *settings)
 		gc->error_acquiring = false;
 	}
 
+	if (cfg.mode == CAPTURE_MODE_HOTKEY &&
+	    gc->config.mode != CAPTURE_MODE_HOTKEY) {
+		gc->activate_hook = false;
+	} else {
+		gc->activate_hook = !!window && !!*window;
+	}
+
 	free_config(&gc->config);
 	gc->config = cfg;
-	gc->activate_hook = !!window && !!*window;
 	gc->retry_interval = DEFAULT_RETRY_INTERVAL;
 	gc->wait_for_target_startup = false;