-
-
Notifications
You must be signed in to change notification settings - Fork 10.4k
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
Clicking on disabled item doesn't set focus to containing window #8064
Comments
Hello, Thanks for reporting this. I consider it to a bug indeed.
It's a little complex and fragile so I would need to spend a few hours double-checking all paths and implementing new tests into the test suite to avoid making a mistake. I don't know when I would have the resources to look into this. |
Indeed, it looked quite complex when we were going through it :). |
I don't believe people would rely on this exact behavior and I would generally like to change it to focus windows in that situation. It just needs a bit of careful energy and testing. |
I have pushed a fix 83ecc84 + super basic test ocornut/imgui_test_engine@4b349fb. It seems simpler than I thought, even though digging into that code I noticed a few inconsistency which I would like to investigate later (added FIXME notes). |
Awesome, thanks for the fix. Can it also be fixed for the other widget 'kinds' (sliders, drags, textinput)? |
My bad, not only this was incomplete (some widgets using I've reverted 83ecc84 and pushed a simpler and more consistent change 706438a and amended the test. |
Great work, highly appreciated! |
Version/Branch of Dear ImGui:
Version 1.90.9, Branch: docking
Back-ends:
imgui_impl_osx.mm + imgui_impl_win32.cpp
Compiler, OS:
Windows11, VS2022; MacOS 15.0, Xcode16
Full config/build information:
Details:
We are creating a node editor, and these nodes have an editable title. However, by default, this is a disabled TextInput and the node can be dragged by click+drag on the title as well. However, doing so does not set window focus on the nodeeditor window. I understand and agree that clicking disabled items shouldn't be navigated to, or be activatable, but I'd still expect the containing window gaining focus when clicking on an item inside of it.
Is it intentional that this doesn't happen?
As a quick experiment I hacked following code into ImGui::ButtonBehavior
And this makes it 'work' for button-like item (checkbox etc...). I'm assume similar changes would be required to other widget categories (textinput, ...?)
However, it may be intentional that it doesn't work like that at the moment, and a different approach may be better?
Any advice is appreciated on this.
Screenshots/Video:
Screen.Recording.2024-10-15.at.15.48.37.mov
Minimal, Complete and Verifiable Example code:
No response
The text was updated successfully, but these errors were encountered: