wxWidgets / Phoenix

wxPython's Project Phoenix. A new implementation of wxPython, better, stronger, faster than he was before.
http://wxpython.org/
2.21k stars 509 forks source link

wx.agw.aui: Make behavior in all platforms more equal #2501

Closed jmoraleda closed 4 months ago

jmoraleda commented 4 months ago

This is a very small PR. It removes an unnecessary if '__WXGTK__' in wx.PlatformInfo: Removing it makes the code base two lines smaller, as well as make the behavior in different platforms more equal in some corner cases.

Remark that the change is to defer the actual update (DoUpdate) in all platforms, as it is currently done in GTK. This makes sense as Update is called internally by various functions inside framemanager and not all resizing of components may have taken place when it is called.

The following images show one such corner case when this deferral makes the different between incorrect and correct layout. In particular when aui panes have callbacks that impact dock sizes when they are added programmatically to a notebook so that the dock becomes taller to make room for the tabs in the notebook. (The patient data shows is not from an actual patient.)

GTK (same, correct, behavior before and after the proposed change)

image

MSW (incorrect behavior before the change. Notice how the patient data is cut because the dock tabs take space)

image

MSW (correct behavior after the change)

image

Metallicow commented 4 months ago

While that looks correct, I have taken the stance to fork agw.aui in my project... ... which also led me to numerous fixes and such I have shared with all "you's" ... but in the end it still lead up to the same result for me. RIP agw.aui all apart and rewrite it to work right from the getgo instead of monkey/hotpatching everything. ... This is a tedious type of attack and takes a lot of experience, but if you want to keep trying to fix the damned bird, then by all means do so, as it seems others are still making progress on that front. ... it doesn't mean that other design implementations will not be considered, it's just that you really have to stay on one side of the fence or another. The grass is always greener on the other side so to speak. CPU vs GPU ect...

jmoraleda commented 4 months ago

@Metallicow I completely agree. This is exactly why I closed: https://github.com/wxWidgets/Phoenix/pull/2473 without waiting to be merged. My current feeling is that I want to submit a PR to tackle the race conditions that occur rather under intensive usage in the current implementation of agw.aui, but only after thorough testing suggests that with those patches the errors are materially reduced.

(This PR where we are comenting on is not that: I was not attempting to fix any bug. Rather I wanted to make the behavior more equal across platforms which I think is always desirable)

Metallicow commented 3 months ago

@jmoraleda I see your direction... It started just as simple fixing thing and then rRIPPING them out from awg.aui. This is because the original aui guy/gal fell off the planet and we are left with this stuff Andrea ported.

I have since ported the whole wxpy demo and whatnot, so it seems easiest to start with a clean slate(call it a movable panel) as basics and work from there(many base widgets are available). Walk thru all unit tests/DesignImplementations one by one and make sure they pass. Don't proceed on a fork unless the base implementation passes. For this type of simple geometry... there should be no exceptions as to how it should work, I understand this is opensource, but take pride in your work to get it ported into the standard library.

Note: Some of us have not our widgets into the standard library yet.... why? Probably because they(TimeBearers/CoreDevelopers)(so to speak don't have TIME(to review or otherwise), or they haven't fleshed out their code that makes it easy to port into c/c++(this takes time also...)) have other things todo in their lives.

Anyhow.... Keeping a good eye on the current flawed implementation for fixes is still a good idea. Don't get me wrong... that is the reason why I have a custom GUI I written completely myself.

There is the "wxPyDemo" but not everyone uses it before opening or commenting on a issue on github.... haha

Thank you for your work.time. :~

Metallicow commented 3 months ago

By the way, I had done something similar in my mcow.agw private version... I moved the DoUpdate(method) elsewhere....