From: terencehill Date: Tue, 20 Feb 2018 18:16:20 +0000 (+0100) Subject: Don't keep focus when hovering over non-focusable elements; it fixes scrolling with... X-Git-Tag: xonotic-v0.8.5~2288 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=a81b776223b1748c2e31610ee5fa550d218c4aa6;p=xonotic%2Fxonotic-data.pk3dir.git 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 --- 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));