aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authordec05eba <dec05eba@protonmail.com>2025-01-04 03:35:46 +0100
committerdec05eba <dec05eba@protonmail.com>2025-01-04 03:35:46 +0100
commitf379b87b33282a7d583ce5e57be684a718f6a68d (patch)
treeae902e73e7391dc9e292f49a68be11bbb52c3e65
parent2ddb9980e1822cf6ad9f335d0d6af7ca3c17b2bc (diff)
Flatpak: disable hotkey section
-rw-r--r--TODO4
-rw-r--r--src/gui/GlobalSettingsPage.cpp10
2 files changed, 10 insertions, 4 deletions
diff --git a/TODO b/TODO
index c8d095a..66903dd 100644
--- a/TODO
+++ b/TODO
@@ -105,4 +105,6 @@ Show warning if another instance of gpu screen recorder is already running when
Keyboard leds get turned off when stopping gsr-global-hotkeys (for example numlock). The numlock key has to be pressed twice again to make it look correct to match its state.
Implement hotkey changing in global settings by getting mgl key events. During this time gsr-global-hotkey would either need to be paused or add code in the callback handler for the existing hotkeys since they are grabbing hotkeys.
- This can only be done after gsr-global-hotkeys properly handle different keyboard layouts to make sure mgl keys match gsr-global-hotkey keys. \ No newline at end of file
+ This can only be done after gsr-global-hotkeys properly handle different keyboard layouts to make sure mgl keys match gsr-global-hotkey keys.
+
+Re-enable hotkey enable/disable section for flatpak. \ No newline at end of file
diff --git a/src/gui/GlobalSettingsPage.cpp b/src/gui/GlobalSettingsPage.cpp
index 5153981..7b7bea5 100644
--- a/src/gui/GlobalSettingsPage.cpp
+++ b/src/gui/GlobalSettingsPage.cpp
@@ -137,13 +137,15 @@ namespace gsr {
}
void GlobalSettingsPage::add_widgets() {
+ const bool inside_flatpak = getenv("FLATPAK_ID") != NULL;
auto scrollable_page = std::make_unique<ScrollablePage>(content_page_ptr->get_inner_size());
auto settings_list = std::make_unique<List>(List::Orientation::VERTICAL);
settings_list->set_spacing(0.018f);
settings_list->add_widget(create_appearance_subsection(scrollable_page.get()));
settings_list->add_widget(create_startup_subsection(scrollable_page.get()));
- settings_list->add_widget(create_hotkey_subsection(scrollable_page.get()));
+ if(!inside_flatpak)
+ settings_list->add_widget(create_hotkey_subsection(scrollable_page.get()));
settings_list->add_widget(create_application_options_subsection(scrollable_page.get()));
scrollable_page->add_widget(std::move(settings_list));
@@ -165,12 +167,14 @@ namespace gsr {
const int exit_status = exec_program_on_host_get_stdout(args, stdout_str);
startup_radio_button_ptr->set_selected_item(exit_status == 0 ? "start_on_system_startup" : "dont_start_on_system_startup", false, false);
- enable_hotkeys_radio_button_ptr->set_selected_item(config.main_config.enable_hotkeys ? "enable_hotkeys" : "disable_hotkeys", false, false);
+ if(enable_hotkeys_radio_button_ptr)
+ enable_hotkeys_radio_button_ptr->set_selected_item(config.main_config.enable_hotkeys ? "enable_hotkeys" : "disable_hotkeys", false, false);
}
void GlobalSettingsPage::save() {
config.main_config.tint_color = tint_color_radio_button_ptr->get_selected_id();
- config.main_config.enable_hotkeys = enable_hotkeys_radio_button_ptr->get_selected_id() == "enable_hotkeys";
+ if(enable_hotkeys_radio_button_ptr)
+ config.main_config.enable_hotkeys = enable_hotkeys_radio_button_ptr->get_selected_id() == "enable_hotkeys";
save_config(config);
}
} \ No newline at end of file