Hide UI when starting desktop portal capture (because the desktop portal selection needs to be clicked on)

This commit is contained in:
dec05eba
2025-07-18 23:45:34 +02:00
parent 9192b3eba1
commit 182c96d8e9
4 changed files with 24 additions and 2 deletions

View File

@@ -758,6 +758,12 @@ namespace gsr {
update_gsr_screenshot_process_status();
replay_status_update_status();
if(hide_ui) {
hide_ui = false;
hide();
return false;
}
if(start_region_capture) {
start_region_capture = false;
hide();
@@ -1338,6 +1344,8 @@ namespace gsr {
if(!visible)
return;
hide_ui = false;
mgl_context *context = mgl_get_context();
Display *display = (Display*)context->connection;
@@ -2588,6 +2596,9 @@ namespace gsr {
show_notification(msg, notification_timeout_seconds, get_color_theme().tint_color, get_color_theme().tint_color, NotificationType::REPLAY, recording_capture_target.c_str());
}
if(config.replay_config.record_options.record_area_option == "portal")
hide_ui = true;
return true;
}
@@ -2747,6 +2758,9 @@ namespace gsr {
snprintf(msg, sizeof(msg), "Started recording %s", capture_target_get_notification_name(recording_capture_target.c_str()).c_str());
show_notification(msg, notification_timeout_seconds, get_color_theme().tint_color, get_color_theme().tint_color, NotificationType::RECORD, recording_capture_target.c_str());
}
if(config.record_config.record_options.record_area_option == "portal")
hide_ui = true;
}
static std::string streaming_get_url(const Config &config) {
@@ -2921,6 +2935,9 @@ namespace gsr {
snprintf(msg, sizeof(msg), "Started streaming %s", capture_target_get_notification_name(recording_capture_target.c_str()).c_str());
show_notification(msg, notification_timeout_seconds, get_color_theme().tint_color, get_color_theme().tint_color, NotificationType::STREAM, recording_capture_target.c_str());
}
if(config.streaming_config.record_options.record_area_option == "portal")
hide_ui = true;
}
void Overlay::on_press_take_screenshot(bool finished_selection, bool force_region_capture) {
@@ -2995,6 +3012,9 @@ namespace gsr {
if(gpu_screen_recorder_screenshot_process == -1) {
show_notification("Failed to launch gpu-screen-recorder to take a screenshot", notification_error_timeout_seconds, mgl::Color(255, 0, 0), mgl::Color(255, 0, 0), NotificationType::SCREENSHOT);
}
if(config.screenshot_config.record_area_option == "portal")
hide_ui = true;
}
bool Overlay::update_compositor_texture(const Monitor &monitor) {

View File

@@ -120,7 +120,7 @@ namespace gsr {
ll->add_widget(std::move(capture_target_list));
ll->add_widget(create_change_image_resolution_section());
return std::make_unique<Subsection>("Record area", std::move(ll), mgl::vec2f(settings_scrollable_page_ptr->get_inner_size().x, 0.0f));
return std::make_unique<Subsection>("Capture", std::move(ll), mgl::vec2f(settings_scrollable_page_ptr->get_inner_size().x, 0.0f));
}
std::unique_ptr<List> ScreenshotSettingsPage::create_image_quality_section() {

View File

@@ -183,7 +183,7 @@ namespace gsr {
ll->add_widget(std::move(capture_target_list));
ll->add_widget(create_change_video_resolution_section());
return std::make_unique<Subsection>("Record area", std::move(ll), mgl::vec2f(settings_scrollable_page_ptr->get_inner_size().x, 0.0f));
return std::make_unique<Subsection>("Capture", std::move(ll), mgl::vec2f(settings_scrollable_page_ptr->get_inner_size().x, 0.0f));
}
static bool audio_device_is_output(const std::string &audio_device_id) {