-
-
Notifications
You must be signed in to change notification settings - Fork 784
Add Infrastructure for GTK4 testing and ActivityIndicator on GTK4. #3530
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
base: main
Are you sure you want to change the base?
Conversation
Co-authored-by: Muhammad Murad <[email protected]>
Co-authored-by: Muhammad Murad <[email protected]>
Co-authored-by: Muhammad Murad <[email protected]>
Co-authored-by: Muhammad Murad <[email protected]>
Co-authored-by: Muhammad Murad <[email protected]>
Co-authored-by: Muhammad Murad <[email protected]>
This commit resolves variable binding issues in the test_cleanup function when used with pytest's parameterization. The errors appear as runtime NameErrors.
|
Hi @danyeaw, is the widget "mapped" in CI? If not it gets filtered out. But the same thing exist in GTK3 sources just hidden deeperly, so not sure if this is the cause. If this is not it, we need to start looking into GDK. GTK seems to be doing the right thing. |
|
Hi @johnzhou721 , what do you mean by mapped? |
|
@danyeaw Not sure if the internal mapped flag is related to https://docs.gtk.org/gtk4/signal.Widget.map.html but that latter says "A widget is mapped when the widget is visible [...] and all its parents up to the toplevel widget are also visible." |
|
Yes, I understand that to GTK, the widgets are mapped and visible. GTK doesn't know that it is drawing to a virtual framebuffer on CI. |
|
@danyeaw OK... sorry for not knowing some of the perks of CI... closing the loop on this for now. |
|
@danyeaw Any progress here, or are you still investigating? Also, is there a way for us to monitor all calls to GTK native APIs while the test suite is running? If so, we could log all the calls and use it to write a C reproducer to report upstream. I don't think this is possible because while you can intercept getattr for getting the function property, of e.g. Gio, you don't know what arguments the function is being called with... does there exist a feature in Python when you can intercept method calls on a class to grab the method name and its arguments, so we can pass it on to GTK as well as print the call? |
|
Wait... you can define a wrapper function that grabs args and kwargs and forward them to the native GTK function! Untested code (do |
|
Hey @johnzhou721 - unfortunately I haven't had a much time to dig in to this as I would like. I think we really need to root cause this upstream though since BeeWare depends on the full stack of libraries working together, not just the BeeWare code. Hopefully I can get back to working on this more soon |
|
@danyeaw Totally fine! Will see if I can execute my (sort of tough) plan about capturing all system calls, but it might be 6--8 weeks later b/c the rest of my summer is packed... |
|
Also, fair winds and following seas if you're investigating this further. |
|
I am unable to investigate this issue any further because my VM is basically not working at all. I'd need to clean up my disk before I can get a new one up and running (because I archived my old VM disk... and it still takes disk space), and the amount of time I'm spending with Since I'm not going to work on this until perhaps a few months from now, I will close this PR (and also since it duplicates a lot of the TextInput PR); changes required to the widget can be found in a9570a4, and the skip in the probe should be removed. I explicitly give permission for anyone to reuse this commit for any other PRs on this repo. @danyeaw TL;DR Use the TextInput PR if you have any further progress, and feel free to add my ActivityIndicator code after that is up and running. |
Add a delay before calling queue_draw to ensure it's queued properly.
|
@danyeaw I'm... elated right now. I found the issue with the redrawing. I just searched "gtk queue draw dropped" and found https://stackoverflow.com/questions/13593113/gtk3-sometimes-ignores-gtk-widget-queue-draw-when-repeated-too-quickly which suggests using g_idle_add to queue the queue_draw to prevent race condition with rapid queue_draws. https://discourse.gnome.org/t/gtk-widget-queue-draw-discared-while-drawing-in-multiple-times/21018 shows this is also applicable to GTK4 However we're queueing a queue draw (ironic...) so we need an additional asyncio.sleep... Can you investigate if there is a way to determine when an idle_add is actaully executed? All ActivityIndicator tests are passed now, right now I'm taking a break before looking over all this again and rerequesting a review. |
Skip tests for DateInput and TimeInput with GTK4.
|
@danyeaw May I please get a review on this one when you have time now that I've cleaned stuff up? The idle_add thing was trivial, I just created an asyncio Event to pass into a separate function to call the actual queue_draw and set that event as complete, and use that function in idle_add and then awaiting the resulting eevnt. Are you okay with this fix? Thanks! |
709b9ff to
52d51ac
Compare
|
Hi @johnzhou721, that seems like a reasonable approach to me - I pushed that change to #3239, we'll see if it passes CI now. |
Refs #3529.
Enable lots of testing things as done by @danyeaw in #3239 sans TextInput things. Most tests are passing on Ubuntu 22.04.
Revert a352470 and 1e03f9a in that reversion order to re-enable textinput.
PR Checklist: