-
Notifications
You must be signed in to change notification settings - Fork 8
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
scrollToWidget called continually #55
Comments
I can see the logic you speak of. I'm still surprised & confused on why I never came into this problem (AFAIK I do have scrollable windows with all non-keyboard-naviagable widgets). It seems like the conditions to trigger this bug are even more restrictive than what you mention? |
Also: I don't see a way to prevent the pointless loop every frame you speak of when using your solution. It seems like a corner case we just have to ignore every frame, for which taking care of it would consume a lot of code (which means lots of potential bugs), time and resources (it doesn't seem to be free to track which windows are entirely composed of non-keyboard-navigable widgets) |
The scenario for me was that I had a completely blank screen, where I then created a window and then a window child to contain the scrolling. This was for an inventory screen, so you can see the title inventory above in the parent window, with the scrollable content below. I've reproduced this in the demo project and it does show the issue.
Create the parent window first, so it's registered as the keyboardFocused window in I agree that this is a corner case, but I do still wonder why objects that are not keyboard navigable can be set as keyboardFocusable, for instance in this patch
I just call setKeyboardFocus on a widget that has m_keyboardNavigable set as false and it's just allowed to steal the focus (and cause the same issue to occur). I agree with what you're saying about tracking the keyboard focusability per window. It will be difficult, and this does look like an edge case to me. |
I discovered this issue when trying to create a scrollable window which contained only non keyboard focusable widgets (labels). In this case,
ColibriManager.cpp:1531
resetsm_keyboardFocusedPair.widget
to 0 each frame, and then the block below beginning at1540
notices that the widget is missing so tries to query the default widget from the window and set it. If the widget returned happens to be non keyboard navigable, then it gets setup, scrolled to, but the next frame it is reset again and the cycle continues, meaningscrollToWidget
is constantly called each frame. For me this effectively disabled scrolling on this window as any time you scroll, it scrolled back to the top automatically to the default widget.My solution to this was to add a check for keyboard focusability
However on closer inspection I see that this doesn't break the cycle and the getDefaultWidget function would be called each frame, which is just a pointless for loop.
The text was updated successfully, but these errors were encountered: