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

Improve window handling in the SDL backend #3244

Closed
wants to merge 2 commits into from

Conversation

funchal
Copy link
Contributor

@funchal funchal commented May 18, 2020

SDL_Window* is stored in a global (g_Window) by ImGui_ImplSDL2_Init. However some apis in the SDL backend use the global and some don't, creating potential for inconsistency/mistakes when starting a new frame, or when processing events. This change makes the SDL backend always use the window passed to ImGui_ImplSDL2_Init originally.

@ocornut
Copy link
Owner

ocornut commented May 19, 2020

Hello,

I get the removal of the window parameter to NewFrame() function (I'd accept it as a breaking change), but I think the windowID filtering, albeit correct here, would conflict with how the multi-viewport feature in docking branch uses this function. It's just easier to leave it unfiltered.

Did you need the filter or did you add the filter for correctness?

@funchal
Copy link
Contributor Author

funchal commented May 21, 2020

In my own code I do filter the events, but I wasn't aware of conflict with the docking branch, so I just reverted the windowID filtering change. I think getting rid of the window parameter is good enough on its own.

@funchal
Copy link
Contributor Author

funchal commented Jun 6, 2020

Fixed the merge conflicts, @ocornut do you think this is worth merging?

@ocornut
Copy link
Owner

ocornut commented Jun 9, 2020

Yes probably will merge eventually, sorry been juggling with lots of PR :)

@ocornut
Copy link
Owner

ocornut commented Jun 30, 2021

Hello @funchal ,
I have now merged 6792e1a with include your change + a temporary inline redirection function.
Thank you!

@ocornut ocornut closed this Jun 30, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants