From b4cc32c4c9499a70842e7b19e886938614650781 Mon Sep 17 00:00:00 2001 From: jpark37 Date: Mon, 29 Aug 2022 08:15:20 -0700 Subject: [PATCH] libobs: Extend NVIDIA anti-flicker to desktops --- libobs/obs-display.c | 14 ++------------ 1 file changed, 2 insertions(+), 12 deletions(-) diff --git a/libobs/obs-display.c b/libobs/obs-display.c index 6d3c04112..accd7e30b 100644 --- a/libobs/obs-display.c +++ b/libobs/obs-display.c @@ -19,13 +19,6 @@ #include "obs.h" #include "obs-internal.h" -#if defined(_WIN32) -#ifndef WIN32_LEAN_AND_MEAN -#define WIN32_LEAN_AND_MEAN 1 -#endif -#include -#endif - bool obs_display_init(struct obs_display *display, const struct gs_init_data *graphics_data) { @@ -33,11 +26,8 @@ bool obs_display_init(struct obs_display *display, pthread_mutex_init_value(&display->draw_info_mutex); #if defined(_WIN32) - /* Conservative test for NVIDIA flickering on Intel display */ - SYSTEM_POWER_STATUS status; - display->use_clear_workaround = - !GetSystemPowerStatus(&status) || - (status.BatteryFlag != 128 && gs_get_adapter_count() != 1); + /* Conservative test for NVIDIA flickering in multi-GPU setups */ + display->use_clear_workaround = gs_get_adapter_count() > 1; #elif defined(__APPLE__) /* Apple Silicon GL driver doesn't seem to track SRGB clears correctly */ display->use_clear_workaround = true;