From 4e62d12e8ca0100f3470581d72cc17f21dca96f4 Mon Sep 17 00:00:00 2001 From: dec05eba Date: Sat, 6 Sep 2025 01:58:28 +0200 Subject: [PATCH] Allow 'sync to content' framerate mode option on wayland (only desktop portal) --- TODO | 4 +--- src/Overlay.cpp | 7 ++----- src/gui/SettingsPage.cpp | 9 +++------ 3 files changed, 6 insertions(+), 14 deletions(-) diff --git a/TODO b/TODO index 5827c59..4393d79 100644 --- a/TODO +++ b/TODO @@ -210,6 +210,4 @@ Window selection doesn't work when a window is fullscreen on x11. Make it possible to change replay duration of the "save 1 min" and "save 10 min" by adding them to the replay settings as options. If replay duration is set below the "save 1 min" or "save 10 min" then gray them out and when hovering over those buttons - show a tooltip that says that those buttons cant be used because the replay duration in replay settings is set to a lower value than that (and display the replay duration there). - -Add content framerate mode for wayland with desktop portal capture when it has been added to gpu-screen-recorder and if it works. \ No newline at end of file + show a tooltip that says that those buttons cant be used because the replay duration in replay settings is set to a lower value than that (and display the replay duration there). \ No newline at end of file diff --git a/src/Overlay.cpp b/src/Overlay.cpp index e4c4465..38e2048 100644 --- a/src/Overlay.cpp +++ b/src/Overlay.cpp @@ -2561,13 +2561,10 @@ namespace gsr { } static std::string get_framerate_mode_validate(const RecordOptions &record_options, const GsrInfo &gsr_info) { + (void)gsr_info; std::string framerate_mode = record_options.framerate_mode; - if(framerate_mode == "auto") { + if(framerate_mode == "auto") framerate_mode = "vfr"; - } else if(framerate_mode == "content") { - if(gsr_info.system_info.display_server != DisplayServer::X11) - framerate_mode = "vfr"; - } return framerate_mode; } diff --git a/src/gui/SettingsPage.cpp b/src/gui/SettingsPage.cpp index 2951120..8fb7036 100644 --- a/src/gui/SettingsPage.cpp +++ b/src/gui/SettingsPage.cpp @@ -568,13 +568,10 @@ namespace gsr { framerate_mode_box->add_item("Auto (Recommended)", "auto"); framerate_mode_box->add_item("Constant", "cfr"); framerate_mode_box->add_item("Variable", "vfr"); - if(gsr_info->system_info.display_server == DisplayServer::X11) { + if(gsr_info->system_info.display_server == DisplayServer::X11) framerate_mode_box->add_item("Sync to content", "content"); - framerate_mode_box->set_item_enabled("content", true); - } else { - framerate_mode_box->add_item("Sync to content (X11 only)", "content"); - framerate_mode_box->set_item_enabled("content", false); - } + else + framerate_mode_box->add_item("Sync to content (Only X11 or desktop portal capture)", "content"); framerate_mode_box_ptr = framerate_mode_box.get(); return framerate_mode_box; }