Skip to content
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

Platform_SetWindowPos/Platform_SetWindowSize called continously in the viewport branch #2205

Closed
marius-luca-87 opened this issue Nov 23, 2018 · 3 comments

Comments

@marius-luca-87
Copy link

Revision: 2515413
Date: 22-Nov-18 16:29:18

imgui.cpp after line 7850 "// Apply Position and Size (from ImGui to Platform/Renderer back-ends)"

    if (!viewport->PlatformRequestMove)
        g.PlatformIO.Platform_SetWindowPos(viewport, viewport->Pos);
    if (!viewport->PlatformRequestResize)
        g.PlatformIO.Platform_SetWindowSize(viewport, viewport->Size);

There seems to be a typo in the "platform request move/size"condition leading to continuous calls.

@marius-luca-87 marius-luca-87 changed the title Platform_SetWindowPos/Renderer_SetWindowSize called continously in the docking branch Platform_SetWindowPos/Platform_SetWindowSize called continously in the docking branch Nov 23, 2018
@ocornut ocornut changed the title Platform_SetWindowPos/Platform_SetWindowSize called continously in the docking branch Platform_SetWindowPos/Platform_SetWindowSize called continously in the viewport branch Nov 23, 2018
@ocornut
Copy link
Owner

ocornut commented Nov 23, 2018

It is currently intentional that we call those functions every frame, currently it doesn't seem to be problematic cost wise. The back-end can freely compare last known position.

@marius-luca-87
Copy link
Author

Thanks for the info. I was unsure if this is something that needs to be handled on the backend side.

@ocornut
Copy link
Owner

ocornut commented Nov 23, 2018

I think I'll actually add a cache to compare too on imgui side now. I was hesitant because we may run into bugs, but if that's the case I'd rather run into them on imgui side.

ocornut added a commit that referenced this issue Nov 23, 2018
…#2205) + Fix GLFW ImGui_ImplGlfw_CreateWindow() from not applying position immediately. Clear LastNameHash properly (bug already fixed in Docking branch)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants