From a5ede6e08aac4a0ff7703a1fee4f1d86741de4e0 Mon Sep 17 00:00:00 2001 From: Nimetu Date: Thu, 10 Dec 2015 10:56:03 +0200 Subject: [PATCH] Fixed: Keyboard capture not reset when clicking outside GUI. --- code/nel/src/gui/widget_manager.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/code/nel/src/gui/widget_manager.cpp b/code/nel/src/gui/widget_manager.cpp index 9417778f3..cdbe3ec73 100644 --- a/code/nel/src/gui/widget_manager.cpp +++ b/code/nel/src/gui/widget_manager.cpp @@ -2623,6 +2623,10 @@ namespace NLGUI // If the mouse is over a window, always consider the event is taken (avoid click behind) handled|= isMouseOverWindow(); + + // If mouse click was not on interface and we have keyboard captured, then release keyboard + if (!handled && getCaptureKeyboard() != NULL && eventDesc.getEventTypeExtended() != CEventDescriptorMouse::mousemove) + CWidgetManager::getInstance()->setCaptureKeyboard(NULL); } return handled;