potocpav / python-concur

Concur UI Framework for Python
MIT License
49 stars 2 forks source link

maximizing a c.window() causes infinite flickering #33

Closed sla-te closed 3 years ago

sla-te commented 3 years ago

bump

potocpav commented 3 years ago

Maximizing the application? Works fine for me on Ubuntu. Is it a Windows issue?

sla-te commented 3 years ago

Maximizing a window inside the rendered window using the internal window system which allows to drag a window into the middle to maximize it. Yes on Windows.

sla-te commented 3 years ago

Take a look at this screencast: https://nextcloud.mnwd.in/s/dcYZf38Gsf9PXcy I pushed the example to: https://github.com/chwba/concur_gui_test/blob/847d94a4d85271131023d2435a9c23d1698e6e39/src/features/nice_feature/nice_feature_gui.py#L59

potocpav commented 3 years ago

Thanks for the information. I was able to reproduce. I already had a similiar issue in the past, but I can't remember what was the cause. Will investigate.

potocpav commented 3 years ago

perhaps related to https://github.com/ocornut/imgui/issues/2286

potocpav commented 3 years ago

Caused by nested windows (https://github.com/ocornut/imgui/issues/2109#issuecomment-426960879). You shouldn't really nest windows, since the code inside a window is only executed when the window is open. This leads to a feedback loop:

  1. Window is rendered, which causes a nested window to be rendered
  2. The nested window displays in a tab, which hides the parent window
  3. Parent window doesn't render because it's hidden. This causes the child window to disappear.
  4. The parent window is now visible again, and it is rendered.

That's the reason the docs for window say they can't be nested. I will add this issue to the docs & faq.

EDIT: I will push the changes after your PR is merged.

sla-te commented 3 years ago

Alright, great, ill push the final ammendmends as discussed in the PR in a bit.

potocpav commented 3 years ago

Updated docs. Closing.

sla-te commented 3 years ago

Can you implement & push a workaround for this problem according to what how it is currently implemented here: https://github.com/chwba/concur_gui_test/blob/847d94a4d85271131023d2435a9c23d1698e6e39/src/features/nice_feature/nice_feature_gui.py#L59

potocpav commented 3 years ago

here you go https://github.com/chwba/concur_gui_test/pull/6