Make work focus on preferred controls on dialog open (only root dialogs!). You can...
authorterencehill <piuntn@gmail.com>
Mon, 13 Apr 2015 18:09:36 +0000 (20:09 +0200)
committerterencehill <piuntn@gmail.com>
Mon, 13 Apr 2015 18:09:36 +0000 (20:09 +0200)
qcsrc/menu/menu.qc

index e348796..a2c2c94 100644 (file)
@@ -960,7 +960,10 @@ void m_setpointerfocus(entity wnd)
                        menuMousePos = focus.origin + 0.5 * focus.size;
                        menuMousePos.x *= 1 / conwidth;
                        menuMousePos.y *= 1 / conheight;
-                       if(wnd.focused) // why does this never happen?
+                       entity par = wnd.parent;
+                       if(par.focused)
+                               par.setFocus(par, wnd);
+                       if(wnd.focused)
                                m_focus_item_chain(wnd, focus);
                }
        }