-
-
Notifications
You must be signed in to change notification settings - Fork 784
New Backend - Qt #3769
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?
New Backend - Qt #3769
Conversation
|
@freakboy3742 By now I have not added CI testing yet because the test skips have not yet convereged at 100% This is rough, I need to go back and clean up comments (especially some random jokes I've made -- if you have spare time I give you permission to try to spot them) but a few things I need confirmation on:
So if beeware/briefcase#2480 (which I've filed for a feature to replace installed PySide6 with system symlink when packaging an app) doesn't get resolved in the duration of this PR, should I still remove this hack such that the new backend will not be able to look native and access system themes?
Thank you! |
|
@freakboy3742 Could you please respond to those questions I've asked about above? Thank you! |
No. Platform identification is only used because You'll also note that the current GTK backend doesn't describe its platform as GTK - it's The approach used by Textual is the model to follow here. If you're on Linux, toga_qt is a candidate backend; if that's the only backend, it's used; if there's more than one candidate installed in the current environment,
For now, I'd say yes. We can only cook with the ingredients we're given. If Qt doesn't work in virtual environments, that's a problem for Qt to resolve. It's not up to us to work around it - if only because there may be use cases for not adopting the global environment. If there's a hack that could be installed, I'd argue the
In core - No - or, at least, there's a much bigger concept that needs to be wrapped here. If the underlying question is about "system icons" - GTK has an analogous concept, which we don't currently handle. See #2441 for some initial thoughts about this (although it doesn't mention the GTK analog that exists). |
|
@freakboy3742 Thanks for the responses, there's much going on and I'm in the middle of a major comments cleanup (it's done through GitHub's review interface so expect a huge email next week with all the ntoes I made for myself, sorry about that) Re to response 1: Then how the heck am I gonna get all the tests skipped by platform? Do I need a bunch of stub probes to just say "skip on Qt", sort of like GTK4? Anyways if there's 1 platform only also for Briefcase how do we handle the testbed then? Right now I used tests_backend_qt for qt probes and hacks it at conftest.py: https://github.com/beeware/toga/pull/3769/files#diff-b845936988736dd9f884ab2aeb4175fa8ee7914217ed87d3c8aad18f803e74f0R24-R33 -- I can check the backend there [b]ut (EDITED TYPO) it just feels messy to have a hack like that at all. Re to response 2: IMO system-pyside6 for symlinking system packages is not feasible. With all this wheel madness going on you simply don't know where the final system-pyside6 package even gets installed and you can't put symlinks in wheels either (it extracts as plain text when extracted by pip, which uses its own extraction logic). There's some options for "build destination" in setup.py but that's to like an intermediate location. Should I extract this sys.modules hackery into a system-pyside6 package that installs a shim PySide6.py to replace itself, then? Re to response 3: Yeah, but it'd look really weird on Qt without like a native icon attached to the actions. KDE inserts extra space before an action with no icon to fill up for the icon space. |
|
@freakboy3742 Also do you think that beeware/briefcase#2480 is a candicate issue to be handled on Briefcase? Or are we like if PySide6 doesn't work it doesn't work and we're not going to have our packaging tool symlink a system copy? |
Increase delay to ensure it completes on slow systems
Removed duplicate FIXME comment regarding unique value combinations.
|
@freakboy3742 Can macOS-arm64 be reran? Thanks. |
... I don't think this has clarified things as much as you think it has.
It seems like you've missed a middle ground here: allow state transitions, and document (for now, at least) that retrieving the MIMIMIZED window state on Wayland may not work, skipping any tests that exercise that code path. Again - we don't need to solve all problems at once. We need an initial proof of life that this backend "works" for some non-trivial definition of "work", with an architecture that passes the sniff tests, with a test suite that runs reliably without generating test failures. The feature set you've got here definitely meets the first criterion. We can iterate on new features once the core Qt support lands. Right now, I'm trying to nail down the last of the "sniff test" items. An architecture for state changes that is prone to recursive behavior definitely doesn't pass that test. |
|
@freakboy3742 I've reworked the architechture to be much simpler to make it block the next 100ms whenever a window state change occurs (or is requested, in case there is another request between the request and the signal back from Qt). If in the 100ms block someone requests another state change from the programatic side, we buffer it and at the end of the 100ms, check for if the program requested a state change (NOT if the requested state change matches the current state), then we reapply. Multiple change events from the user in rapid succession will keep blocking until 100ms from the last one. I'll wait for test pass, and rerequest a review. All items should be resolved. EDIT -- To clarify: this will no longer handle rapid changes correctly if the user mashes keys or presses MINIMIZE in the middle of the changes, but you said in the Qt issue that this is not a major concern (as opposed to an infinite-loop architechutre). |
… that the tests are passing and I resolved the conflicts.
|
@johnzhou721 Ack - I'll take a look as soon as I can; early next week seems most likely. |
|
@freakboy3742 FYI -- While updating the support table, I also corrected some errors in it -- they should be fairly obvious. |
WIP: Fixes #1142
PR Checklist: