From 41819354ace7a55ea4dcb4af8c6c025afca9cc7f Mon Sep 17 00:00:00 2001 From: Paul Chote Date: Mon, 30 May 2011 21:02:23 +1200 Subject: [PATCH] Fix selection box dragging behind other ui elements --- OpenRA.Game/Widgets/WorldInteractionControllerWidget.cs | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/OpenRA.Game/Widgets/WorldInteractionControllerWidget.cs b/OpenRA.Game/Widgets/WorldInteractionControllerWidget.cs index f0e3ed19ab..a95c88fa28 100644 --- a/OpenRA.Game/Widgets/WorldInteractionControllerWidget.cs +++ b/OpenRA.Game/Widgets/WorldInteractionControllerWidget.cs @@ -62,6 +62,9 @@ namespace OpenRA.Widgets var xy = Game.viewport.ViewToWorldPx(mi); if (mi.Button == MouseButton.Left && mi.Event == MouseInputEvent.Down) { + if (!TakeFocus(mi)) + return false; + dragStart = dragEnd = xy; ApplyOrders(world, xy, mi); } @@ -78,6 +81,7 @@ namespace OpenRA.Widgets } dragStart = dragEnd = xy; + LoseFocus(mi); } if (mi.Button == MouseButton.None && mi.Event == MouseInputEvent.Move)