From 0755e37d7b4de9919c55cdff1d638d7992825b0d Mon Sep 17 00:00:00 2001 From: Simon McVittie <smcv@collabora.com> Date: Fri, 7 Feb 2025 16:16:05 +0000 Subject: [PATCH] pv-wrap: Take "remove game overlay" option from PvWrapContext It's slightly simpler without duplicating 1 bit of information like this. Signed-off-by: Simon McVittie <smcv@collabora.com> --- pressure-vessel/wrap-setup.c | 2 +- pressure-vessel/wrap-setup.h | 2 -- pressure-vessel/wrap.c | 3 --- tests/pressure-vessel/wrap-setup.c | 12 +++++------- 4 files changed, 6 insertions(+), 13 deletions(-) diff --git a/pressure-vessel/wrap-setup.c b/pressure-vessel/wrap-setup.c index 8e1f3da16..d7f481941 100644 --- a/pressure-vessel/wrap-setup.c +++ b/pressure-vessel/wrap-setup.c @@ -896,7 +896,7 @@ pv_wrap_append_preload (PvWrapContext *context, return; } - if ((flags & PV_APPEND_PRELOAD_FLAGS_REMOVE_GAME_OVERLAY) + if (context->options.remove_game_overlay && g_str_has_suffix (preload, "/gameoverlayrenderer.so")) { g_info ("Disabling Steam Overlay: %s", preload); diff --git a/pressure-vessel/wrap-setup.h b/pressure-vessel/wrap-setup.h index f89c1f5d9..c96393e80 100644 --- a/pressure-vessel/wrap-setup.h +++ b/pressure-vessel/wrap-setup.h @@ -66,7 +66,6 @@ void pv_wrap_move_into_scope (const char *steam_app_id); * PvAppendPreloadFlags: * @PV_APPEND_PRELOAD_FLAGS_FLATPAK_SUBSANDBOX: The game will be run in * a Flatpak subsandbox - * @PV_APPEND_PRELOAD_FLAGS_REMOVE_GAME_OVERLAY: Disable the Steam Overlay * @PV_APPEND_PRELOAD_FLAGS_IN_UNIT_TESTS: Normalize $LIB and $PLATFORM, * for unit testing * @PV_APPEND_PRELOAD_FLAGS_ONE_ARCHITECTURE: Behave as though there is @@ -78,7 +77,6 @@ void pv_wrap_move_into_scope (const char *steam_app_id); typedef enum { PV_APPEND_PRELOAD_FLAGS_FLATPAK_SUBSANDBOX = (1 << 0), - PV_APPEND_PRELOAD_FLAGS_REMOVE_GAME_OVERLAY = (1 << 1), PV_APPEND_PRELOAD_FLAGS_IN_UNIT_TESTS = (1 << 2), PV_APPEND_PRELOAD_FLAGS_ONE_ARCHITECTURE = (1 << 3), PV_APPEND_PRELOAD_FLAGS_NONE = 0 diff --git a/pressure-vessel/wrap.c b/pressure-vessel/wrap.c index de465d657..0e20c0997 100644 --- a/pressure-vessel/wrap.c +++ b/pressure-vessel/wrap.c @@ -820,9 +820,6 @@ main (int argc, adverb_preload_argv = g_ptr_array_new_with_free_func (g_free); - if (self->options.remove_game_overlay) - append_preload_flags |= PV_APPEND_PRELOAD_FLAGS_REMOVE_GAME_OVERLAY; - /* We need the LD_PRELOADs from Steam visible at the paths that were * used for them, which might be their physical rather than logical * locations. Steam doesn't generally use LD_AUDIT, but the Steam app diff --git a/tests/pressure-vessel/wrap-setup.c b/tests/pressure-vessel/wrap-setup.c index 88ec05bbe..af7762be6 100644 --- a/tests/pressure-vessel/wrap-setup.c +++ b/tests/pressure-vessel/wrap-setup.c @@ -1819,8 +1819,7 @@ test_remap_ld_preload_flatpak (Fixture *f, /* * In addition to testing the rare case where there's no runtime, - * this one also exercises PV_APPEND_PRELOAD_FLAGS_REMOVE_GAME_OVERLAY, - * which is the implementation of --remove-game-overlay. + * this one also exercises --remove-game-overlay. */ static void test_remap_ld_preload_no_runtime (Fixture *f, @@ -1833,16 +1832,15 @@ test_remap_ld_preload_no_runtime (Fixture *f, gsize i, j; gboolean expect_i386 = FALSE; + f->context->options.remove_game_overlay = TRUE; + #if defined(__i386__) || defined(__x86_64__) if (!(config->preload_flags & PV_APPEND_PRELOAD_FLAGS_ONE_ARCHITECTURE)) expect_i386 = TRUE; #endif g_assert_null (f->context->runtime); - populate_ld_preload (f, argv, - (config->preload_flags - | PV_APPEND_PRELOAD_FLAGS_REMOVE_GAME_OVERLAY), - exports); + populate_ld_preload (f, argv, config->preload_flags, exports); g_assert_cmpuint (argv->len, ==, filtered->len - 1); @@ -1855,7 +1853,7 @@ test_remap_ld_preload_no_runtime (Fixture *f, argument += strlen("--ld-preload="); /* /steam/lib/gameoverlayrenderer.so is missing because we used the - * REMOVE_GAME_OVERLAY flag */ + * equivalent of --remove-game-overlay */ if (g_str_has_suffix (expected, "/gameoverlayrenderer.so")) { /* We expect to skip only one element */ -- GitLab