Bug 1845580 - Remove unintuitive mouswheel scroll distance behavior on release builds. r=botond

On the release channel, do not suppress overriding the scroll distance on
Windows when:

 - The setting for the number of lines to scroll per mousewheel tick is not the
   default
 - The scroll speed is fast.

Differential Revision: https://phabricator.services.mozilla.com/D184621
This commit is contained in:
Dan Robertson 2023-07-26 21:08:58 +00:00
Родитель 1827dc203b
Коммит 83508a8875
2 изменённых файлов: 0 добавлений и 45 удалений

Просмотреть файл

@ -803,32 +803,6 @@ bool MouseScrollHandler::LastEventInfo::InitWheelEvent(
// If the scroll delta mode isn't per line scroll, we shouldn't allow to
// override the system scroll speed setting.
aWheelEvent.mAllowToOverrideSystemScrollSpeed = false;
#ifndef EARLY_BETA_OR_EARLIER
} else if (!MouseScrollHandler::sInstance->mSystemSettings
.IsOverridingSystemScrollSpeedAllowed()) {
// If the system settings are customized by either the user or
// the mouse utility, we shouldn't allow to override the system scroll
// speed setting.
aWheelEvent.mAllowToOverrideSystemScrollSpeed = false;
} else {
// For suppressing too fast scroll, we should ensure that the maximum
// overridden delta value should be less than overridden scroll speed
// with default scroll amount.
double defaultScrollAmount = mIsVertical
? SystemSettings::DefaultScrollLines()
: SystemSettings::DefaultScrollChars();
double maxDelta = WidgetWheelEvent::ComputeOverriddenDelta(
defaultScrollAmount, mIsVertical);
if (maxDelta != defaultScrollAmount) {
double overriddenDelta =
WidgetWheelEvent::ComputeOverriddenDelta(Abs(delta), mIsVertical);
if (overriddenDelta > maxDelta) {
// Suppress to fast scroll since overriding system scroll speed with
// current delta value causes too big delta value.
aWheelEvent.mAllowToOverrideSystemScrollSpeed = false;
}
}
#endif
}
MOZ_LOG(
@ -1004,14 +978,6 @@ void MouseScrollHandler::SystemSettings::TrustedScrollSettingsDriver() {
// XXX We're not sure about other touchpad drivers...
}
#ifndef EARLY_BETA_OR_EARLIER
bool MouseScrollHandler::SystemSettings::
IsOverridingSystemScrollSpeedAllowed() {
return mScrollLines == DefaultScrollLines() &&
mScrollChars == DefaultScrollChars();
}
#endif
/******************************************************************************
*
* UserPrefs

Просмотреть файл

@ -260,14 +260,6 @@ class MouseScrollHandler {
// handling if we meet known device whose utility may hook the API.
void TrustedScrollSettingsDriver();
#ifndef EARLY_BETA_OR_EARLIER
// Returns true if the system scroll may be overridden for faster scroll.
// Otherwise, false. For example, if the user maybe uses an expensive
// mouse which supports acceleration of scroll speed, faster scroll makes
// the user inconvenient.
bool IsOverridingSystemScrollSpeedAllowed();
#endif
int32_t GetScrollAmount(bool aForVertical) const {
MOZ_ASSERT(mInitialized, "SystemSettings must be initialized");
return aForVertical ? mScrollLines : mScrollChars;
@ -282,9 +274,6 @@ class MouseScrollHandler {
// The default vertical and horizontal scrolling speed is 3, this is defined
// on the document of SystemParametersInfo in MSDN.
static int32_t DefaultScrollLines() { return 3; }
#ifndef EARLY_BETA_OR_EARLIER
static int32_t DefaultScrollChars() { return 3; }
#endif
private:
bool mInitialized;