Commit dc6bae3b authored by adlr's avatar adlr Committed by Commit bot

Chrome OS Touchpad Settings: Always update natural scrolling pref.

Natural (aka australian) scrolling occurs outside Chrome in the X11
touchpad driver. Chrome dictates via an inputcontrol script what the
value (true/false) should be. The script notes (in the user's homedir)
what the last set value is so that added devices get it applied.

Unfortunately, what was happening was Chrome would update the pref
before the user logged in, so the inputcontrol script couldn't make a
note. Later, when a user was logged in and a new device was attached,
the script wouldn't know if australian scrolling should be on or off.

To fix, we always set australian scrolling whenever we consider
sending touchpad value changes to the inputcontrol script.

BUG=chromium:406480
TEST=Tested that when user logs in, chrome always sends the current
value of natural scrolling to the inputcontrol script. Also tested
that changing non-mouse/tp settings doesn't trigger calls to
inputcontrol script.

Review URL: https://codereview.chromium.org/553153004

Cr-Commit-Position: refs/heads/master@{#294058}
parent bbadba6b
...@@ -353,7 +353,10 @@ bool TouchpadSettings::Update(const TouchpadSettings& settings, ...@@ -353,7 +353,10 @@ bool TouchpadSettings::Update(const TouchpadSettings& settings,
if (argv) if (argv)
AddTPControlArguments("tapdrag", tap_dragging_.value(), argv); AddTPControlArguments("tapdrag", tap_dragging_.value(), argv);
} }
if (natural_scroll_.Update(settings.natural_scroll_)) { natural_scroll_.Update(settings.natural_scroll_);
// Always send natural scrolling to the shell command, as a workaround.
// See crbug.com/406480
if (natural_scroll_.is_set()) {
updated = true; updated = true;
if (argv) if (argv)
AddTPControlArguments("australian_scrolling", natural_scroll_.value(), AddTPControlArguments("australian_scrolling", natural_scroll_.value(),
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment