From 22d70318192fd89d78e1d2d09151b370e014d3b6 Mon Sep 17 00:00:00 2001 From: Paul Chote Date: Wed, 9 Aug 2017 17:58:54 +0000 Subject: [PATCH] Focus the ViewportController on Standard/Inverted scroll modes. --- OpenRA.Mods.Common/Widgets/ViewportControllerWidget.cs | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/OpenRA.Mods.Common/Widgets/ViewportControllerWidget.cs b/OpenRA.Mods.Common/Widgets/ViewportControllerWidget.cs index 9d73a8f06b..1e9036f992 100644 --- a/OpenRA.Mods.Common/Widgets/ViewportControllerWidget.cs +++ b/OpenRA.Mods.Common/Widgets/ViewportControllerWidget.cs @@ -306,7 +306,12 @@ namespace OpenRA.Mods.Common.Widgets if (scrollType == MouseScrollType.Standard || scrollType == MouseScrollType.Inverted) { if (mi.Event == MouseInputEvent.Down && !isStandardScrolling) + { + if (!TakeMouseFocus(mi)) + return false; + standardScrollStart = mi.Location; + } else if (mi.Event == MouseInputEvent.Move && (isStandardScrolling || (standardScrollStart.HasValue && ((standardScrollStart.Value - mi.Location).Length > Game.Settings.Game.MouseScrollDeadzone)))) { @@ -320,6 +325,7 @@ namespace OpenRA.Mods.Common.Widgets var wasStandardScrolling = isStandardScrolling; isStandardScrolling = false; standardScrollStart = null; + YieldMouseFocus(mi); if (wasStandardScrolling) return true; @@ -333,6 +339,7 @@ namespace OpenRA.Mods.Common.Widgets { if (!TakeMouseFocus(mi)) return false; + joystickScrollStart = mi.Location; }