Skip to content

Conversation

@pbuckner
Copy link
Contributor

@pbuckner pbuckner commented Mar 6, 2021

This should fix #137.

Rather than use a single global _io, use a global hash which is keyed by context pointer.

The only data that needs to be stored are the get & set clipboard functions. All other data contained with _IO() is retrieved through the actual imgui-cpp pointer, so no data is lost on switch of context (which yields a new IO).

Sample test file, demonstrating context-specific set and get clipboards functions attached.

clipboard_test.py.gz

@coveralls
Copy link

Coverage Status

Coverage decreased (-0.02%) to 55.932% when pulling 3bcbc8e on pbuckner:get_io_fix into 480b4de on swistakm:master.

@KinoxKlark
Copy link
Member

Looks good to me, thanks! I will have to triple-check that it does not conflict with #192 since context management has become a little bit convoluted but seeing your implementation I don't think they will be any major issue.

@KinoxKlark KinoxKlark merged commit 53291b2 into pyimgui:master Aug 9, 2021
@KinoxKlark KinoxKlark added the release pending Merged but still needs official release label Aug 9, 2021
@KinoxKlark KinoxKlark removed the release pending Merged but still needs official release label Oct 31, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Two windows with two imgui contexts causes an assert

3 participants