1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-22 13:45:08 +00:00

WindowServer: Added configurable mouse acceleration and scroll length

The settings are also saved to the config file to survive reboots.
This commit is contained in:
Idan Horowitz 2020-12-29 23:32:54 +02:00 committed by Andreas Kling
parent 0c51778510
commit db409db4e9
6 changed files with 51 additions and 2 deletions

View file

@ -163,6 +163,22 @@ Gfx::IntSize WindowManager::resolution() const
return Screen::the().size();
}
void WindowManager::set_acceleration_factor(double factor)
{
Screen::the().set_acceleration_factor(factor);
dbgln("Saving acceleration factor {} to config file at {}", factor, m_config->file_name());
m_config->write_entry("Mouse", "AccelerationFactor", String::formatted("{}", factor));
m_config->sync();
}
void WindowManager::set_scroll_step_size(unsigned step_size)
{
Screen::the().set_scroll_step_size(step_size);
dbgln("Saving scroll step size {} to config file at {}", step_size, m_config->file_name());
m_config->write_entry("Mouse", "ScrollStepSize", String::number(step_size));
m_config->sync();
}
void WindowManager::add_window(Window& window)
{
bool is_first_window = m_windows_in_order.is_empty();