From 791b25400a1193007f5788dab329f90d55427007 Mon Sep 17 00:00:00 2001 From: Yukino Song Date: Mon, 20 Jan 2025 20:13:28 +0800 Subject: [PATCH] Fix output_name not working --- src/process.cpp | 10 ++++++++-- src/video.cpp | 2 +- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/src/process.cpp b/src/process.cpp index b7159fdb..c9ef4975 100644 --- a/src/process.cpp +++ b/src/process.cpp @@ -541,8 +541,14 @@ namespace proc { #endif } - // Restore output name to its original value - config::video.output_name = initial_display; + // Load the configured output_name first + // to prevent the value being write to empty when the initial terminate happens + if (proc.initial_display.empty()) { + proc.initial_display = config::video.output_name; + } else { + // Restore output name to its original value + config::video.output_name = initial_display; + } _app_id = -1; display_name.clear(); diff --git a/src/video.cpp b/src/video.cpp index 27e15538..16899aa3 100644 --- a/src/video.cpp +++ b/src/video.cpp @@ -1027,7 +1027,7 @@ namespace video { current_display_index = 0; if (current_display_name.empty()) { - current_display_name = config::video.output_name; + current_display_name = display_device::map_output_name(config::video.output_name); } // If we had a name previously, let's try to find it in the new list