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

Update viewport flags from window flags every frame #7392

Open
wants to merge 1 commit into
base: docking
Choose a base branch
from

Conversation

cfillion
Copy link
Contributor

@cfillion cfillion commented Mar 12, 2024

This fixes WindowFlags_NoInputs (for mouse passthrough) only being taken in consideration when the viewport is intially created.

I'm not 100% sure this is free of side-effects (why wasn't AddUpdateViewport done every frame before?). Another possibility could be to update ViewportFlags_NoInputs in WindowSyncOwnedViewport.

Use-case demo

static int flags, reset;

if(reset && reset < ImGui::GetTime())
  flags = reset = 0;

ImGui::Begin("Hello, world!", nullptr, flags);
if(ImGui::CheckboxFlags("WindowFlags_NoInputs", &flags, ImGuiWindowFlags_NoInputs))
  reset = ImGui::GetTime() + 4;
if(reset)
  ImGui::Text("reset in %d\n", static_cast<int>(reset - ImGui::GetTime()) + 1);
ImGui::End();

Fixes WindowFlags_NoInputs only being taken in consideration when the viewport is intially created.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants