Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 13 additions & 0 deletions src/api/wayfire/option-wrapper.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,19 @@ class option_wrapper_t : public base_option_wrapper_t<Type>
}
}

void load_option(std::shared_ptr<wf::config::section_t> section, const std::string& option_name)
{
try {
base_option_wrapper_t<Type>::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<Type>()
{}

Expand Down
13 changes: 6 additions & 7 deletions src/core/output-layout.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
17 changes: 7 additions & 10 deletions src/core/seat/keyboard.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
45 changes: 21 additions & 24 deletions src/core/seat/pointing-device.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
2 changes: 1 addition & 1 deletion src/output/render-manager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down