-
-
Notifications
You must be signed in to change notification settings - Fork 10.7k
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
ImGui::IsMouseHoveringAnyWindow() - bug ? #459
Comments
I have also noticed that the "g.IO.MousePos = {x=-9999.00000 y=-9999.00000 } I think it is due to this code in my main loop. The (-1, -1) will be converted later (imgui.cpp : 1989) !
But is it the right way to do ? (This code come from the opengl3 demo) ! |
You should use io.WantCaptureMouse for that. (Its value will be similar to IsMouseHoveringAnyWindow() in basic case of hovering a window, but it will correctly handle various cases such as dragging and moving mouse outside a window).
There is no such thing as randomness. I am sure you mean well but if something feels random it is probably because you don't understand what is happening and haven't debugged it enough. Making a repro forms the act of isolating and formulating your problem (seeing you have a severe track-record at not being clear and debugging yourself it is double useful). Please try harder. Negative mouse coordinates currently stands for "no mouse". If your code sets a negative MousePos it tells ImGui that the mouse is off-screen and then it is expected that IsMouseHoveringAnyWindow() returns false. At this point it is an issue with your code if you give it a negative mouse coordinate. I am pretty sure that IsMouseHoveringAnyWindow() works seeing it is such a trivial function that rely on code that is exercised all the time. |
Krys, Please try harder with posting questions with repro! I won't answer any further of your questions without a repro. 1/ Start from the example application and try recreating your issue there. By doing so you will most likely understand the issue with more clarity and perhaps debugging your own code. Until you can reproduce the issue in the example application it means you don't understand the issue enough. 2/ When debugging, printing out live values using ImGui::Text() or printf() can be very useful. You can then use the application tools to understand how values are evolving in an interactive context. I appreciate you may be new to C++ and it is a hard language to master, to debug and to discuss. It takes years. But I can't be possibly doing the job of helping you debug your programs all the time, taking the time is actually harming ImGui. This is an ImGui issues tracker, not a heres-zero-information-but-please-debug-my-program-dot-com. Sorry I have to be harsh but your countless requests here (not mentioning the Skype messages) are too often basically asking me to debug your code and do your job for you, and you aren't making it easier for anyone to help you by being unclear in your descriptions. Many people can get away without repros because I happen to understand the situation they describe, probably because they understand it better themselves. At this point answering so many of your messages isn't in the interest of ImGui development nor the community and it is almost rude to other users than I take so much time off improving ImGui to answer you instead. (Knowing you are developing closed-source commercial software for your company perhaps you can even convince yourself to purchase private support and save you time! My time is easily bought if it is ImGui related! :) |
I agree... and it is what I try... since 4 hours now ! More will come... BTW, I don't ask to fix my problems... just if you have some ideas that can help ! If you have nothing it doesn't matter... I'll continue until I can provide more information ! So, it is a work in progress... maybe based on your experience you can quickly have a good idea or not ! I post here what I have... but it takes some times too ! It is just a discussion... not a "please fix" request ! But maybe you don't like this because you have not enough information, but I can't gives you more because I haven't more (yet) ! Let me some times to complete if necessary ! It is just maybe a way you don't like to work ! |
Surely you must not be doing the right thing. Have you actually precisely done 1/ and 2/ ?
It is true, based on my experience I am often very happy to help or give out ideas based on loose requests. People do so regularly. But you have burnt through the quota of goodwill and patience allocated to you rather fast. :( The problem is that this issue tracker is essentially a task list for me, aka work, and I am trying to keep it manageable level and as noise less as possible. A "discussion" is work. If I spend time thinking about a problem in your code I'm not spending time thinking about improving ImGui. Issues are kept open as a reminder that there is something that still need some work/attention. Perhaps someone can open a forum and let users freely discuss there and I won't feel the need to close threads. |
Hey Omar, your project is becoming to popular ;) I think the idea with a forum sounds good, but I can understand that you are not able to invest much work-time for this. So I have three suggestions: 1.) Maybe there is a community out there that discuss topics about graphic development in general. And if there are also a lot of people that use IMGUI, the community could create a sub-forum for IMGUI and you can link to that as an unofficial IMGUI forum. 2.) Maybe there is a github extension for a forum? Or you could create a community repository for IMGUI. People can upload example code there without having you as a maintainer and in the issue section they can discuss those questions from krys. 3.) Or if you see that an issue in this repository is not really a question for you, but for the community you could flag this issue with a special label "discussion" or something like that. When you look at your ToDo list, you can ignore all "discussion" issues, thus you can simply let them open. However they would still count as issues and I guess this is what you don't want. In general it is great that so many people are interested in your project and want to understand it and discuss about it. This simply means you did a fantastic work :) |
Yes, I have do 1 and 2 ... but cannot reproduce it ... as I saied it is random ! I see... that's right it is an "issues" list... what I'm looking for is more a discussion forum ! That's not the right place to put my comment anyway ! |
It is not random. If you cannot reproduce it then your repro is missing the faulty code. Again it is pretty clear the issue here has nothing to do with ImGui but with your application code setting cursor to (-1,-1) when not focused. Look at why your application is unfocused, maybe set a breakpoint there. If setting breakpoints is tedious because the code runs a lot and triggering debugger messes up with the Windows focus state, you can add a construct like |
Hi,
I use "ImGui::IsMouseHoveringAnyWindow()" to avoid to call my mouse event when the mouse is over one of the ImGui windows.
The problem is random and most of the time it works fine !
But sometimes it does not detect it !
Another side effect is that I'm unable to click on any "widget" when this happend !
Notice that I'm trying to create a small reproducable, for you and for me to isolate the problem. But because it is random it is really difficult to do... I will post it here if I can reproduce it correctly !
I'm also looking at the code that handle this, so if you have any suggestion to debug it and create a small reproducable it will really help me !! Any idea is welcome !
PS: Sorry to be so fuzzy, but I have nothing else yet. If I find something I will post it !
Thanks
The text was updated successfully, but these errors were encountered: