From 9ccd93bfd8c7a96754eecc531046480ad25cf294 Mon Sep 17 00:00:00 2001 From: Geoffrey McRae Date: Fri, 27 May 2022 11:36:39 +1000 Subject: [PATCH] [client] app: add option to disable dimming in overlay mode --- client/src/app.c | 5 +---- client/src/config.c | 48 ++++++++++++++++++++++++++------------------- client/src/main.h | 1 + 3 files changed, 30 insertions(+), 24 deletions(-) diff --git a/client/src/app.c b/client/src/app.c index fb838621..9f4b9e8c 100644 --- a/client/src/app.c +++ b/client/src/app.c @@ -862,16 +862,13 @@ render_again: igNewFrame(); const bool overlayMode = app_isOverlayMode(); - if (overlayMode) + if (overlayMode && g_params.overlayDim) { totalDamage = true; ImDrawList_AddRectFilled(igGetBackgroundDrawList_Nil(), (ImVec2) { 0.0f , 0.0f }, g_state.io->DisplaySize, igGetColorU32_Col(ImGuiCol_ModalWindowDimBg, 1.0f), 0, 0); - -// bool test; -// igShowDemoWindow(&test); } const bool msgModal = overlayMsg_modal(); diff --git a/client/src/config.c b/client/src/config.c index a56dadb3..9f415165 100644 --- a/client/src/config.c +++ b/client/src/config.c @@ -259,6 +259,13 @@ static struct Option options[] = .type = OPTION_TYPE_BOOL, .value.x_bool = false, }, + { + .module = "win", + .name = "overlayDimsDesktop", + .description = "Dim the desktop when in interactive overlay mode", + .type = OPTION_TYPE_BOOL, + .value.x_bool = true, + }, { .module = "win", .name = "rotate", @@ -613,26 +620,27 @@ bool config_load(int argc, char * argv[]) g_params.framePollInterval = option_get_int ("app" , "framePollInterval" ); g_params.allowDMA = option_get_bool ("app" , "allowDMA" ); - g_params.windowTitle = option_get_string("win", "title" ); - g_params.autoResize = option_get_bool ("win", "autoResize" ); - g_params.allowResize = option_get_bool ("win", "allowResize" ); - g_params.keepAspect = option_get_bool ("win", "keepAspect" ); - g_params.forceAspect = option_get_bool ("win", "forceAspect" ); - g_params.dontUpscale = option_get_bool ("win", "dontUpscale" ); - g_params.intUpscale = option_get_bool ("win", "intUpscale" ); - g_params.shrinkOnUpscale = option_get_bool ("win", "shrinkOnUpscale"); - g_params.borderless = option_get_bool ("win", "borderless" ); - g_params.fullscreen = option_get_bool ("win", "fullScreen" ); - g_params.maximize = option_get_bool ("win", "maximize" ); - g_params.fpsMin = option_get_int ("win", "fpsMin" ); - g_params.ignoreQuit = option_get_bool ("win", "ignoreQuit" ); - g_params.noScreensaver = option_get_bool ("win", "noScreensaver" ); - g_params.autoScreensaver = option_get_bool ("win", "autoScreensaver"); - g_params.showAlerts = option_get_bool ("win", "alerts" ); - g_params.quickSplash = option_get_bool ("win", "quickSplash" ); - g_params.uiFont = option_get_string("win", "uiFont" ); - g_params.uiSize = option_get_int ("win", "uiSize" ); - g_params.jitRender = option_get_bool ("win", "jitRender" ); + g_params.windowTitle = option_get_string("win", "title" ); + g_params.autoResize = option_get_bool ("win", "autoResize" ); + g_params.allowResize = option_get_bool ("win", "allowResize" ); + g_params.keepAspect = option_get_bool ("win", "keepAspect" ); + g_params.forceAspect = option_get_bool ("win", "forceAspect" ); + g_params.dontUpscale = option_get_bool ("win", "dontUpscale" ); + g_params.intUpscale = option_get_bool ("win", "intUpscale" ); + g_params.shrinkOnUpscale = option_get_bool ("win", "shrinkOnUpscale" ); + g_params.borderless = option_get_bool ("win", "borderless" ); + g_params.fullscreen = option_get_bool ("win", "fullScreen" ); + g_params.maximize = option_get_bool ("win", "maximize" ); + g_params.fpsMin = option_get_int ("win", "fpsMin" ); + g_params.ignoreQuit = option_get_bool ("win", "ignoreQuit" ); + g_params.noScreensaver = option_get_bool ("win", "noScreensaver" ); + g_params.autoScreensaver = option_get_bool ("win", "autoScreensaver" ); + g_params.showAlerts = option_get_bool ("win", "alerts" ); + g_params.quickSplash = option_get_bool ("win", "quickSplash" ); + g_params.overlayDim = option_get_bool ("win", "overlayDimsDesktop"); + g_params.uiFont = option_get_string("win", "uiFont" ); + g_params.uiSize = option_get_int ("win", "uiSize" ); + g_params.jitRender = option_get_bool ("win", "jitRender" ); if (g_params.noScreensaver && g_params.autoScreensaver) { diff --git a/client/src/main.h b/client/src/main.h index 72c39580..4d1b23d9 100644 --- a/client/src/main.h +++ b/client/src/main.h @@ -189,6 +189,7 @@ struct AppParams bool showAlerts; bool captureOnStart; bool quickSplash; + bool overlayDim; bool alwaysShowCursor; uint64_t helpMenuDelayUs; const char * uiFont;