diff options
author | dec05eba <dec05eba@protonmail.com> | 2025-04-04 20:51:28 +0200 |
---|---|---|
committer | dec05eba <dec05eba@protonmail.com> | 2025-04-04 20:51:28 +0200 |
commit | 2e3adfc5100c4c273529d7e0ed1cba42f184395f (patch) | |
tree | 1342ecd7e0910c739739948d31114419ce22f1bd /src/gui | |
parent | 44f35f8f3b39892def66a2a0f15d3a261f0be778 (diff) |
Add option to capture the focused monitor
Diffstat (limited to 'src/gui')
-rw-r--r-- | src/gui/ScreenshotSettingsPage.cpp | 4 | ||||
-rw-r--r-- | src/gui/SettingsPage.cpp | 4 |
2 files changed, 6 insertions, 2 deletions
diff --git a/src/gui/ScreenshotSettingsPage.cpp b/src/gui/ScreenshotSettingsPage.cpp index fd75660..2dedd86 100644 --- a/src/gui/ScreenshotSettingsPage.cpp +++ b/src/gui/ScreenshotSettingsPage.cpp @@ -40,6 +40,8 @@ namespace gsr { // record_area_box->add_item("Window", "window"); if(capture_options.region) record_area_box->add_item("Region", "region"); + if(!capture_options.monitors.empty()) + record_area_box->add_item(gsr_info->system_info.display_server == DisplayServer::WAYLAND ? "Focused monitor (Experimental on Wayland)" : "Focused monitor", "focused_monitor"); for(const auto &monitor : capture_options.monitors) { char name[256]; snprintf(name, sizeof(name), "Monitor %s (%dx%d)", monitor.name.c_str(), monitor.size.x, monitor.size.y); @@ -270,7 +272,7 @@ namespace gsr { }; if(!capture_options.monitors.empty()) - record_area_box_ptr->set_selected_item(capture_options.monitors.front().name); + record_area_box_ptr->set_selected_item("focused_monitor"); else if(capture_options.portal) record_area_box_ptr->set_selected_item("portal"); else if(capture_options.window) diff --git a/src/gui/SettingsPage.cpp b/src/gui/SettingsPage.cpp index 79b4525..663e941 100644 --- a/src/gui/SettingsPage.cpp +++ b/src/gui/SettingsPage.cpp @@ -70,6 +70,8 @@ namespace gsr { record_area_box->add_item("Region", "region"); if(capture_options.focused) record_area_box->add_item("Follow focused window", "focused"); + if(!capture_options.monitors.empty()) + record_area_box->add_item(gsr_info->system_info.display_server == DisplayServer::WAYLAND ? "Focused monitor (Experimental on Wayland)" : "Focused monitor", "focused_monitor"); for(const auto &monitor : capture_options.monitors) { char name[256]; snprintf(name, sizeof(name), "Monitor %s (%dx%d)", monitor.name.c_str(), monitor.size.x, monitor.size.y); @@ -560,7 +562,7 @@ namespace gsr { video_quality_box_ptr->on_selection_changed("", video_quality_box_ptr->get_selected_id()); if(!capture_options.monitors.empty()) - record_area_box_ptr->set_selected_item(capture_options.monitors.front().name); + record_area_box_ptr->set_selected_item("focused_monitor"); else if(capture_options.portal) record_area_box_ptr->set_selected_item("portal"); else if(capture_options.window) |