From a81b776223b1748c2e31610ee5fa550d218c4aa6 Mon Sep 17 00:00:00 2001 From: terencehill Date: Tue, 20 Feb 2018 19:16:20 +0100 Subject: [PATCH] Don't keep focus when hovering over non-focusable elements; it fixes scrolling with mouse wheel not working in the GameSettings tab (scrollable panel) after hovering cursor over a focusable item, then over a non-focusable one, finally over an empty area of the tab --- qcsrc/menu/item/container.qc | 3 ++- qcsrc/menu/item/inputcontainer.qc | 3 +-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/qcsrc/menu/item/container.qc b/qcsrc/menu/item/container.qc index 04e1bc6f7..329ddf0f6 100644 --- a/qcsrc/menu/item/container.qc +++ b/qcsrc/menu/item/container.qc @@ -308,7 +308,8 @@ me.focusedChild.focused = 1; me.focusedChild.focusEnter(me.focusedChild); - if (me.focusedChild.instanceOfContainer) me.focusedChild.setFocus(me.focusedChild, me.focusedChild.savedFocus); + if (me.focusedChild.instanceOfContainer) + me.focusedChild.setFocus(me.focusedChild, me.focusedChild.savedFocus); } else { diff --git a/qcsrc/menu/item/inputcontainer.qc b/qcsrc/menu/item/inputcontainer.qc index 641e47745..cda342677 100644 --- a/qcsrc/menu/item/inputcontainer.qc +++ b/qcsrc/menu/item/inputcontainer.qc @@ -89,11 +89,10 @@ if (e && !e.focusable) e = NULL; entity prev = this.mouseFocusedChild; this.mouseFocusedChild = e; - if (!e) return false; // keep focus when hovering over non-focusable elements if (e != prev) { this.setFocus(this, e); - if (e.instanceOfInputContainer) + if (e && e.instanceOfInputContainer) { e.focusedChild = NULL; e._changeFocusXY(e, globalToBox(pos, e.Container_origin, e.Container_size)); -- 2.39.2