diff --git a/include/Overlay.hpp b/include/Overlay.hpp index f151de7..3bc4e25 100644 --- a/include/Overlay.hpp +++ b/include/Overlay.hpp @@ -290,5 +290,6 @@ namespace gsr { std::unique_ptr led_indicator = nullptr; bool supports_window_title = false; + bool supports_window_fullscreen_state = false; }; } \ No newline at end of file diff --git a/include/gui/SettingsPage.hpp b/include/gui/SettingsPage.hpp index 13c80a6..fcb34e5 100644 --- a/include/gui/SettingsPage.hpp +++ b/include/gui/SettingsPage.hpp @@ -41,7 +41,7 @@ namespace gsr { 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& operator=(const SettingsPage&) = delete; @@ -249,5 +249,6 @@ namespace gsr { std::optional selected_camera_setup; bool supports_window_title = false; + bool supports_window_fullscreen_state = false; }; } \ No newline at end of file diff --git a/src/Overlay.cpp b/src/Overlay.cpp index 879bcdf..12d232d 100644 --- a/src/Overlay.cpp +++ b/src/Overlay.cpp @@ -545,6 +545,7 @@ namespace gsr { if(this->gsr_info.system_info.display_server == DisplayServer::X11) { cursor_tracker = std::make_unique((Display*)mgl_get_context()->connection); supports_window_title = true; + supports_window_fullscreen_state = true; } else if(this->gsr_info.system_info.display_server == DisplayServer::WAYLAND) { if(!this->gsr_info.gpu_info.card_path.empty()) cursor_tracker = std::make_unique(this->gsr_info.gpu_info.card_path.c_str(), wayland_dpy); @@ -563,6 +564,7 @@ namespace gsr { } else if (wm_name == "KWin") { start_kwin_helper_thread(); 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->on_click = [this](const std::string &id) { if(id == "settings") { - auto replay_settings_page = std::make_unique(SettingsPage::Type::REPLAY, &gsr_info, config, &page_stack, supports_window_title); + auto replay_settings_page = std::make_unique(SettingsPage::Type::REPLAY, &gsr_info, config, &page_stack, supports_window_title, supports_window_fullscreen_state); 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()); if(recording_status == RecordingStatus::REPLAY) @@ -1308,7 +1310,7 @@ namespace gsr { button->set_item_icon("settings", &get_theme().settings_extra_small_texture); button->on_click = [this](const std::string &id) { if(id == "settings") { - auto record_settings_page = std::make_unique(SettingsPage::Type::RECORD, &gsr_info, config, &page_stack, supports_window_title); + auto record_settings_page = std::make_unique(SettingsPage::Type::RECORD, &gsr_info, config, &page_stack, supports_window_title, supports_window_fullscreen_state); record_settings_page->on_config_changed = [this]() { 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); @@ -1335,7 +1337,7 @@ namespace gsr { button->set_item_icon("settings", &get_theme().settings_extra_small_texture); button->on_click = [this](const std::string &id) { if(id == "settings") { - auto stream_settings_page = std::make_unique(SettingsPage::Type::STREAM, &gsr_info, config, &page_stack, supports_window_title); + auto stream_settings_page = std::make_unique(SettingsPage::Type::STREAM, &gsr_info, config, &page_stack, supports_window_title, supports_window_fullscreen_state); stream_settings_page->on_config_changed = [this]() { 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); diff --git a/src/gui/SettingsPage.cpp b/src/gui/SettingsPage.cpp index 898a17b..1aa6ebc 100644 --- a/src/gui/SettingsPage.cpp +++ b/src/gui/SettingsPage.cpp @@ -37,13 +37,14 @@ namespace gsr { 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()), type(type), config(config), gsr_info(gsr_info), 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(); application_audio = get_application_audio(); @@ -1125,9 +1126,9 @@ namespace gsr { } std::unique_ptr 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]; - 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(&get_theme().body_font, RadioButton::Orientation::VERTICAL); radiobutton->add_item(TR("Don't turn on replay automatically"), "dont_turn_on_automatically"); @@ -1203,7 +1204,7 @@ namespace gsr { std::unique_ptr SettingsPage::create_led_indicator(const char *type) { 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(&get_theme().body_font, label_str); checkbox->set_checked(false);