add supports_window_fullscreen_state and don't show "X11 applications only" in settings where applicable

Also fixed the lower-case "led" instead of "LED" in settings as it was bothering me!
This commit is contained in:
p0358
2026-02-19 23:11:13 +01:00
committed by dec05eba
parent 48609e33c9
commit 4b47063406
4 changed files with 14 additions and 9 deletions

View File

@@ -290,5 +290,6 @@ namespace gsr {
std::unique_ptr<LedIndicator> led_indicator = nullptr; std::unique_ptr<LedIndicator> led_indicator = nullptr;
bool supports_window_title = false; bool supports_window_title = false;
bool supports_window_fullscreen_state = false;
}; };
} }

View File

@@ -41,7 +41,7 @@ namespace gsr {
STREAM STREAM
}; };
SettingsPage(Type type, const GsrInfo *gsr_info, Config &config, PageStack *page_stack, bool supports_window_title); SettingsPage(Type type, const GsrInfo *gsr_info, Config &config, PageStack *page_stack, bool supports_window_title, bool supports_window_fullscreen_state);
SettingsPage(const SettingsPage&) = delete; SettingsPage(const SettingsPage&) = delete;
SettingsPage& operator=(const SettingsPage&) = delete; SettingsPage& operator=(const SettingsPage&) = delete;
@@ -249,5 +249,6 @@ namespace gsr {
std::optional<GsrCameraSetup> selected_camera_setup; std::optional<GsrCameraSetup> selected_camera_setup;
bool supports_window_title = false; bool supports_window_title = false;
bool supports_window_fullscreen_state = false;
}; };
} }

View File

@@ -545,6 +545,7 @@ namespace gsr {
if(this->gsr_info.system_info.display_server == DisplayServer::X11) { if(this->gsr_info.system_info.display_server == DisplayServer::X11) {
cursor_tracker = std::make_unique<CursorTrackerX11>((Display*)mgl_get_context()->connection); cursor_tracker = std::make_unique<CursorTrackerX11>((Display*)mgl_get_context()->connection);
supports_window_title = true; supports_window_title = true;
supports_window_fullscreen_state = true;
} else if(this->gsr_info.system_info.display_server == DisplayServer::WAYLAND) { } else if(this->gsr_info.system_info.display_server == DisplayServer::WAYLAND) {
if(!this->gsr_info.gpu_info.card_path.empty()) if(!this->gsr_info.gpu_info.card_path.empty())
cursor_tracker = std::make_unique<CursorTrackerWayland>(this->gsr_info.gpu_info.card_path.c_str(), wayland_dpy); cursor_tracker = std::make_unique<CursorTrackerWayland>(this->gsr_info.gpu_info.card_path.c_str(), wayland_dpy);
@@ -563,6 +564,7 @@ namespace gsr {
} else if (wm_name == "KWin") { } else if (wm_name == "KWin") {
start_kwin_helper_thread(); start_kwin_helper_thread();
supports_window_title = true; supports_window_title = true;
supports_window_fullscreen_state = true;
} }
} }
@@ -1274,7 +1276,7 @@ namespace gsr {
button->set_item_icon("settings", &get_theme().settings_extra_small_texture); button->set_item_icon("settings", &get_theme().settings_extra_small_texture);
button->on_click = [this](const std::string &id) { button->on_click = [this](const std::string &id) {
if(id == "settings") { if(id == "settings") {
auto replay_settings_page = std::make_unique<SettingsPage>(SettingsPage::Type::REPLAY, &gsr_info, config, &page_stack, supports_window_title); auto replay_settings_page = std::make_unique<SettingsPage>(SettingsPage::Type::REPLAY, &gsr_info, config, &page_stack, supports_window_title, supports_window_fullscreen_state);
replay_settings_page->on_config_changed = [this]() { replay_settings_page->on_config_changed = [this]() {
replay_startup_mode = replay_startup_string_to_type(config.replay_config.turn_on_replay_automatically_mode.c_str()); replay_startup_mode = replay_startup_string_to_type(config.replay_config.turn_on_replay_automatically_mode.c_str());
if(recording_status == RecordingStatus::REPLAY) if(recording_status == RecordingStatus::REPLAY)
@@ -1308,7 +1310,7 @@ namespace gsr {
button->set_item_icon("settings", &get_theme().settings_extra_small_texture); button->set_item_icon("settings", &get_theme().settings_extra_small_texture);
button->on_click = [this](const std::string &id) { button->on_click = [this](const std::string &id) {
if(id == "settings") { if(id == "settings") {
auto record_settings_page = std::make_unique<SettingsPage>(SettingsPage::Type::RECORD, &gsr_info, config, &page_stack, supports_window_title); auto record_settings_page = std::make_unique<SettingsPage>(SettingsPage::Type::RECORD, &gsr_info, config, &page_stack, supports_window_title, supports_window_fullscreen_state);
record_settings_page->on_config_changed = [this]() { record_settings_page->on_config_changed = [this]() {
if(recording_status == RecordingStatus::RECORD) if(recording_status == RecordingStatus::RECORD)
show_notification(TR("Recording settings have been modified.\nYou may need to restart recording to apply the changes."), notification_timeout_seconds, mgl::Color(255, 255, 255), get_color_theme().tint_color, NotificationType::RECORD); show_notification(TR("Recording settings have been modified.\nYou may need to restart recording to apply the changes."), notification_timeout_seconds, mgl::Color(255, 255, 255), get_color_theme().tint_color, NotificationType::RECORD);
@@ -1335,7 +1337,7 @@ namespace gsr {
button->set_item_icon("settings", &get_theme().settings_extra_small_texture); button->set_item_icon("settings", &get_theme().settings_extra_small_texture);
button->on_click = [this](const std::string &id) { button->on_click = [this](const std::string &id) {
if(id == "settings") { if(id == "settings") {
auto stream_settings_page = std::make_unique<SettingsPage>(SettingsPage::Type::STREAM, &gsr_info, config, &page_stack, supports_window_title); auto stream_settings_page = std::make_unique<SettingsPage>(SettingsPage::Type::STREAM, &gsr_info, config, &page_stack, supports_window_title, supports_window_fullscreen_state);
stream_settings_page->on_config_changed = [this]() { stream_settings_page->on_config_changed = [this]() {
if(recording_status == RecordingStatus::STREAM) if(recording_status == RecordingStatus::STREAM)
show_notification(TR("Streaming settings have been modified.\nYou may need to restart streaming to apply the changes."), notification_timeout_seconds, mgl::Color(255, 255, 255), get_color_theme().tint_color, NotificationType::STREAM); show_notification(TR("Streaming settings have been modified.\nYou may need to restart streaming to apply the changes."), notification_timeout_seconds, mgl::Color(255, 255, 255), get_color_theme().tint_color, NotificationType::STREAM);

View File

@@ -37,13 +37,14 @@ namespace gsr {
return ""; return "";
} }
SettingsPage::SettingsPage(Type type, const GsrInfo *gsr_info, Config &config, PageStack *page_stack, bool supports_window_title) : SettingsPage::SettingsPage(Type type, const GsrInfo *gsr_info, Config &config, PageStack *page_stack, bool supports_window_title, bool supports_window_fullscreen_state) :
StaticPage(mgl::vec2f(get_theme().window_width, get_theme().window_height).floor()), StaticPage(mgl::vec2f(get_theme().window_width, get_theme().window_height).floor()),
type(type), type(type),
config(config), config(config),
gsr_info(gsr_info), gsr_info(gsr_info),
page_stack(page_stack), page_stack(page_stack),
supports_window_title(supports_window_title) supports_window_title(supports_window_title),
supports_window_fullscreen_state(supports_window_fullscreen_state)
{ {
audio_devices = get_audio_devices(); audio_devices = get_audio_devices();
application_audio = get_application_audio(); application_audio = get_application_audio();
@@ -1125,9 +1126,9 @@ namespace gsr {
} }
std::unique_ptr<RadioButton> SettingsPage::create_start_replay_automatically() { std::unique_ptr<RadioButton> SettingsPage::create_start_replay_automatically() {
// TODO: Support kde plasma wayland and hyprland (same ones that support getting window title) // TODO: Support hyprland (same ones that support getting window title)
char fullscreen_text[256]; char fullscreen_text[256];
snprintf(fullscreen_text, sizeof(fullscreen_text), TR("Turn on replay when starting a fullscreen application%s"), gsr_info->system_info.display_server == DisplayServer::X11 ? "" : TR(" (X11 applications only)")); snprintf(fullscreen_text, sizeof(fullscreen_text), TR("Turn on replay when starting a fullscreen application%s"), supports_window_fullscreen_state ? "" : TR(" (X11 applications only)"));
auto radiobutton = std::make_unique<RadioButton>(&get_theme().body_font, RadioButton::Orientation::VERTICAL); auto radiobutton = std::make_unique<RadioButton>(&get_theme().body_font, RadioButton::Orientation::VERTICAL);
radiobutton->add_item(TR("Don't turn on replay automatically"), "dont_turn_on_automatically"); radiobutton->add_item(TR("Don't turn on replay automatically"), "dont_turn_on_automatically");
@@ -1203,7 +1204,7 @@ namespace gsr {
std::unique_ptr<CheckBox> SettingsPage::create_led_indicator(const char *type) { std::unique_ptr<CheckBox> SettingsPage::create_led_indicator(const char *type) {
char label_str[256]; char label_str[256];
snprintf(label_str, sizeof(label_str), TR("Show %s status with scroll lock led"), type); snprintf(label_str, sizeof(label_str), TR("Show %s status with scroll lock LED"), type);
auto checkbox = std::make_unique<CheckBox>(&get_theme().body_font, label_str); auto checkbox = std::make_unique<CheckBox>(&get_theme().body_font, label_str);
checkbox->set_checked(false); checkbox->set_checked(false);