-
-
Notifications
You must be signed in to change notification settings - Fork 10.3k
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
Multiple viewports get confused by negative coordinates #2176
Comments
Hello @tom-seddon, I looked at this today (SDL+GL3, Windows) and couldn't reproduce the issue. See e.g. a screenshot of the Metrics window being moved in the second monitor which has negative coordinates: Could you confirm that the issue is happening for you with the latest version? One reason I can think that may cause this sort of bug is if the Could you:
Thank you. |
It turns out this problem seems to be associated with having a mixed-DPI setup. I have a Macbook Pro, with high-DPI laptop screen on the left (1), then two normal-DPI monitors (2, 3 - 2 is the primary display): It behaves OK in a Parallels VM, where the laptop screen is treated as normal DPI, but I get the bug when running Windows 10 natively, where the laptop screen is high DPI.
SDL version is 2.0.9, from https://www.libsdl.org/release/SDL2-devel-2.0.9-VC.zip
Win32+DX11 version is usable, though when a window straddles a low DPI and a high DPI display it appears to lternates (at 60Hz...) between being drawn at low DPI scale and drawn at high DPI scale. I can file a separate bug for this if you like.
GLFW+GL3 is sort-of usable, though when a window is on a high DPI display the contents are drawn unscaled, so you get a window that's the right size visually (i.e., 4x as many pixels) with tiny contents: I can file a separate bug for this if you like.
Mouse positions look OK, it's just the window position that apperas to be clamped. What I did to build: I'm using Visual Studio 2017, with compiler
Thanks, --Tom |
Thanks for the details.
I couldn't reproduce with mixed-DPI. More over, the fact that it seems to work (even partially) with other back-ends suggest this might be an issue related to the back-end? I am not sure I understand the reason at this point.
I also cannot reproduce this either (testing on Windows 10 with mixed DPI).
It would be good to add some printing (e.g. using Because multiple-DPI is currently such in flex in Windows 10, specifying the exact Platform Toolset version and Platform/Windows SDK version might be important (I am not sure) Even though multiple-DPI is not trivially supported by default it appears to be possible by overriding Sorry this is all incredibly tricky!
Does the PR in #2306 fixes it? |
Just an update, as it's been nearly a month: I haven't forgotten about this! I just haven't been doing any dear imgui and/or Windows work lately. But I will look at this within the next week or two, I hope. --Tom |
I had a look at this today, commit 7a51966, so hopefully #2306 is in there. I tried this on my other laptop, which has never had Parallels on it. Windows 1809 (17763.379), Visual Studio 2017, Windows SDK 10.0.16299.0, build tools v141. Working with example_sdl_opengl3. The problem with the screwy window dragging appears to be that the monitors are disjoint. Monitor arrangement is roughly as per the image above. Monitor 1 (the high DPI one, on the left) runs from (-2880,0) to (-1440,900), as it's got a position measured in pixels, but a size that's measured in logical units, or whatever the Windows term is. And Monitor 0 (normal DPI, in the middle) is from (0,0) to (1440,2560), leaving a 1440 pixel gap. Monitor 2 (normal DPI, on the right) is where you'd expect.
The monitors are disjoint because the sdl_opengl3 example doesn't have some of the Windows stuff that the DirectX11 has. So I experimentally put some of it in, and that seemed to fix it. Adding Adding So maybe the bug then is just that the sdl_opengl3 example doesn't have this Windows stuff in it, or maybe simply doesn't have this Windows stuff in it just yet? Or perhaps it shouldn't have any Windows stuff in it, being SDL/OpenGL3, and therefore theoretically portable? - in which case maybe a note in the readme would suffice. Regarding the oscillating behaviour, with all this extra code in place I reproduced it with the sdl_opengl3 example. I think this is due to the resizing interacting with Thanks, --Tom |
This issue still applies to the current docking branch, i tested it with the provided GLFW+GL3 example by moving a viewport to a secondary monitor. |
In the end, no. I decided to stick with single-window mode. --Tom |
Version/Branch of Dear ImGui:
168af9b
Back-end file/Renderer/OS: (or specify if you are using a custom engine back-end)
Back-ends: imgui_impl_opengl3.cpp + imgui_impl_sdl.cpp
OS: Windows 10
Compiler: VC++ (if the question is related to building)
My Issue/Question: (please provide context)
If you have a display with negative coordinates, floating dear imgui windows - what's the right term for this? - the ones outside the main viewport, I mean - can't be moved on to it.
Standalone, minimal, complete and verifiable example: (see CONTRIBUTING.md)
Expected result: window moves as you'd expect
Actual result: window isn't allowed to move onto the display with negative coordinates. Looks similar to when you try to drag a dear imgui window off the edge of the viewport in the non-multiple-viewports case
Thanks,
--Tom
The text was updated successfully, but these errors were encountered: