Open parbo opened 3 years ago
Hello,
Please define "active/visible" and why IsWindowAppearing()
doesn't work for you.
When opening a window in a dockspace by calling ImGui::SetNextWindowDockId
before ImGui::Begin
, then ImGui::IsWindowAppearing
doesn't return true. Also, I had expected that switching between tabs in a dockspace would ImGui::IsWindowAppearing
to become true as the tab becomes active, but it doesn't afaict. And if that is intended, then I think there should be some other API to know that a docked window in a tab became visible.
The reason I asked the question is that there are situations we may want a different appearing condition that the one you mention here, and specifically #2283 wants a different one and couldn't obtain it. And I assumed it was still the case.
But what I'm seeing right now after testing is that we "accidentally" solved #2283 but what you mention - which is the most desirable behavior ihmo - is now broken. So there's a bug (maybe recent?) indeed, will investigate.
Amusingly this case got broken by:
Fix IsWindowAppearing() from returning true twice in most cases. (#3982, #1497, #1061)
84e6fe4fc741983824955aaba6fb8203be6c778e
Pushed a fix here: 91704b773e7e636dd83afdd2871a4fa17fa78863 Thank you!
This is a more complex than expected, because they are cases were IsWindowAppearing()
would return true while Begin()
returned false, meaning users may not submit contents. We are working on it.
Pushed two extra commits which should fix the issues we encountered.
Also added a sanity assert to ensure that Begin()
never returns false when the Appearing
flag is set.
I've been asking myself if I should do ask here my question or not, as far as I'm not a great expert on ImGui docking windows and in ImGui in general, but I decided to do so, so forgive me if this is already answered or solved or if my question does not makes sense...
I would like to know if there is way of detecting if a docked window on tabs is "visible". So if I've 3 windows tabbed as here :
There is some mouse interaction within those windows, which actually are all of the same "type". What it happens is that the mouse interaction is being triggered on all 3 windows even just one of them is visible. I was trying to understand if there is a way to avoid this.
I got to understand that even windows are docked/tabbed and maybe they are not "visible", they are being "drawn" and receiving the mouse interaction and so the interaction is being triggered on all 3 windows. I thought I could find a way of knowing if the window/tab is actually visible and so avoid the interaction to happen on hidden tabs.
Is there any other solution then detecting if the GetMousePress happened on a "focused" window ? Or how should I think about this issue properly to solve this unwanted behaviour ?
I would like to know if there is way of detecting if a docked window on tabs is "visible".
The Begin()
calls of the inactive windows returns false.
Thanks @cfillion
So I might have something wrong on my end as I do already have an if(Begin()...) before calling the draw function and doing the mouse interaction... I've checked that I'm doing in any case the ImGui::End(); (as seen in the documentation) ... so not sure if maybe there is a flag needed to have this "false return" if inactive window/tab?
I'm printing the window to the console inside the window code and even if they are all docked/tabbed, the 3 names are printed all the time.... ?¿
Any idea why my Begin() call is not returning false for my "ASTRES Rectangular2" and "ASTRES Rectangular3" ?
Just to specify it ... I'm running on :// dear imgui, v1.87 WIP
I have the same issues. Begin()
returns true on the non-visible tabs too, though only on the first frame.
@eloimaduell or someone, did you find a solution?
Version/Branch of Dear ImGui:
My Issue/Question:
In the docking branch, is there a way to figure out if a docked window (i.e. a tab) became active/visible?
ImGui::IsWindowAppearing()
does not seem to work for that.