diff --git a/src/api/wayfire/option-wrapper.hpp b/src/api/wayfire/option-wrapper.hpp index 6a9fe91f0..3fe76d5aa 100644 --- a/src/api/wayfire/option-wrapper.hpp +++ b/src/api/wayfire/option-wrapper.hpp @@ -46,6 +46,19 @@ class option_wrapper_t : public base_option_wrapper_t } } + void load_option(std::shared_ptr section, const std::string& option_name) + { + try { + base_option_wrapper_t::load_option(section, option_name); + } catch (const std::runtime_error& err) + { + detail::option_wrapper_debug_message(section->get_name() + "/" + option_name, err); + } catch (const std::logic_error& err) + { + detail::option_wrapper_debug_message(section->get_name() + "/" + option_name, err); + } + } + option_wrapper_t() : wf::base_option_wrapper_t() {} diff --git a/src/core/output-layout.cpp b/src/core/output-layout.cpp index 76d5b80c1..4d4344326 100644 --- a/src/core/output-layout.cpp +++ b/src/core/output-layout.cpp @@ -352,13 +352,12 @@ struct output_layout_output_t void initialize_config_options() { config_section = wf::get_core().config_backend->get_output_section(handle); - auto name = config_section->get_name(); - mode_opt.load_option(name + "/mode"); - position_opt.load_option(name + "/position"); - scale_opt.load_option(name + "/scale"); - transform_opt.load_option(name + "/transform"); - vrr_opt.load_option(name + "/vrr"); - depth_opt.load_option(name + "/depth"); + mode_opt.load_option(config_section, "mode"); + position_opt.load_option(config_section, "position"); + scale_opt.load_option(config_section, "scale"); + transform_opt.load_option(config_section, "transform"); + vrr_opt.load_option(config_section, "vrr"); + depth_opt.load_option(config_section, "depth"); } output_layout_output_t(wlr_output *handle) diff --git a/src/core/seat/keyboard.cpp b/src/core/seat/keyboard.cpp index 8f3340d1d..e58847d53 100644 --- a/src/core/seat/keyboard.cpp +++ b/src/core/seat/keyboard.cpp @@ -124,16 +124,13 @@ wf::keyboard_t::keyboard_t(wlr_input_device *dev) : { auto section = wf::get_core().config_backend->get_input_device_section("input", dev); - auto section_name = section->get_name(); - - model.load_option(section_name + "/xkb_model"); - variant.load_option(section_name + "/xkb_variant"); - layout.load_option(section_name + "/xkb_layout"); - options.load_option(section_name + "/xkb_options"); - rules.load_option(section_name + "/xkb_rules"); - - repeat_rate.load_option(section_name + "/kb_repeat_rate"); - repeat_delay.load_option(section_name + "/kb_repeat_delay"); + model.load_option(section, "xkb_model"); + variant.load_option(section, "xkb_variant"); + layout.load_option(section, "xkb_layout"); + options.load_option(section, "xkb_options"); + rules.load_option(section, "xkb_rules"); + repeat_rate.load_option(section, "kb_repeat_rate"); + repeat_delay.load_option(section, "kb_repeat_delay"); // When the configuration options change, mark them as dirty. // They are applied at the config-reloaded signal. diff --git a/src/core/seat/pointing-device.cpp b/src/core/seat/pointing-device.cpp index e5bb9aaf7..ebcac542f 100644 --- a/src/core/seat/pointing-device.cpp +++ b/src/core/seat/pointing-device.cpp @@ -13,30 +13,27 @@ void wf::pointing_device_t::load_options() { auto section = wf::get_core().config_backend->get_input_device_section("input", get_wlr_handle()); - auto section_name = section->get_name(); - - left_handed_mode.load_option(section_name + "/left_handed_mode"); - middle_emulation.load_option(section_name + "/middle_emulation"); - - mouse_scroll_speed.load_option(section_name + "/mouse_scroll_speed"); - mouse_cursor_speed.load_option(section_name + "/mouse_cursor_speed"); - touchpad_cursor_speed.load_option(section_name + "/touchpad_cursor_speed"); - touchpad_scroll_speed.load_option(section_name + "/touchpad_scroll_speed"); - - mouse_natural_scroll_enabled.load_option(section_name + "/mouse_natural_scroll"); - touchpad_tap_enabled.load_option(section_name + "/tap_to_click"); - touchpad_dwt_enabled.load_option(section_name + "/disable_touchpad_while_typing"); - touchpad_dwmouse_enabled.load_option(section_name + "/disable_touchpad_while_mouse"); - touchpad_natural_scroll_enabled.load_option(section_name + "/natural_scroll"); - touchpad_tap_and_drag_enabled.load_option(section_name + "/tap_and_drag"); - touchpad_drag_lock_enabled.load_option(section_name + "/drag_lock"); - touchpad_3fg_drag.load_option(section_name + "/3fg_drag"); - - mouse_accel_profile.load_option(section_name + "/mouse_accel_profile"); - touchpad_accel_profile.load_option(section_name + "/touchpad_accel_profile"); - - touchpad_click_method.load_option(section_name + "/click_method"); - touchpad_scroll_method.load_option(section_name + "/scroll_method"); + left_handed_mode.load_option(section, "left_handed_mode"); + middle_emulation.load_option(section, "middle_emulation"); + + mouse_scroll_speed.load_option(section, "mouse_scroll_speed"); + mouse_cursor_speed.load_option(section, "mouse_cursor_speed"); + touchpad_cursor_speed.load_option(section, "touchpad_cursor_speed"); + touchpad_scroll_speed.load_option(section, "touchpad_scroll_speed"); + + mouse_natural_scroll_enabled.load_option(section, "mouse_natural_scroll"); + touchpad_tap_enabled.load_option(section, "tap_to_click"); + touchpad_dwt_enabled.load_option(section, "disable_touchpad_while_typing"); + touchpad_dwmouse_enabled.load_option(section, "disable_touchpad_while_mouse"); + touchpad_natural_scroll_enabled.load_option(section, "natural_scroll"); + touchpad_tap_and_drag_enabled.load_option(section, "tap_and_drag"); + touchpad_drag_lock_enabled.load_option(section, "drag_lock"); + touchpad_3fg_drag.load_option(section, "3fg_drag"); + + mouse_accel_profile.load_option(section, "mouse_accel_profile"); + touchpad_accel_profile.load_option(section, "touchpad_accel_profile"); + touchpad_click_method.load_option(section, "click_method"); + touchpad_scroll_method.load_option(section, "scroll_method"); } static void set_libinput_accel_profile(libinput_device *dev, std::string name) diff --git a/src/output/render-manager.cpp b/src/output/render-manager.cpp index f6e4ed123..975528c72 100644 --- a/src/output/render-manager.cpp +++ b/src/output/render-manager.cpp @@ -866,7 +866,7 @@ class wf::render_manager::impl damage_manager->schedule_repaint(); auto section = wf::get_core().config_backend->get_output_section(output->handle); - icc_profile.load_option(section->get_name() + "/icc_profile"); + icc_profile.load_option(section, "icc_profile"); icc_profile.set_callback([=] () { reload_icc_profile(); diff --git a/subprojects/wf-config b/subprojects/wf-config index 6e25b6d38..76a5897cf 160000 --- a/subprojects/wf-config +++ b/subprojects/wf-config @@ -1 +1 @@ -Subproject commit 6e25b6d380c2280e5631a327b98670a4eaa5eb0e +Subproject commit 76a5897cf40503007370686247dc9a45ec96fca9