-
Notifications
You must be signed in to change notification settings - Fork 22
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
GTK 4 support #221
GTK 4 support #221
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks really good!
I am getting a few warnings while running the demo:
Gtk-CRITICAL **: 21:27:25.049: gtk_event_controller_get_propagation_phase: assertion 'GTK_IS_EVENT_CONTROLLER (controller)' failed
I am not sure if it is a setup issue on my side, but the demo loads ok besides that.
Should we wait until a pygobject version with support is released?
I haven't seen that warning.
Although it works fine for both GTK+ 3 and GTK 4, I think we do not want to depend on a master branch of PyGObject. We'd better wait for an official release. |
Sourcery Code Quality Report❌ Merging this PR will decrease code quality in the affected files by 1.37%.
Here are some functions in these files that still need a tune-up:
Legend and ExplanationThe emojis denote the absolute quality of the code:
The 👍 and 👎 indicate whether the quality has improved or gotten worse with this pull request. Please see our documentation here for details on how these metrics are calculated. We are actively working on this report - lots more documentation and extra metrics to come! Let us know what you think of it by mentioning @sourcery-ai in a comment. |
@danyeaw I changed the default PyGObject version back to stable. I added a separate job to test with GTK 4. It's using Fedora, since it already ships GTK 4. I think now it's safe to merge. |
Nice one @amolenaar 👍 |
PR Type
What kind of change does this PR introduce?
The change
Gaphas works for GTK+ 3. This PR adds support for GTK 4 -- without breaking backwards compatibility.
Where there are incompatibilities between the GTK 3 and 4 api, a check for
Gtk.get_major_version() == 3
is done.Tests can be executed with GTK 4 by running
TEST_GTK_VERSION=4.0 pytest
.Issue Number: gaphor/gaphor#618
Does this PR introduce a breaking change?
Other information
In GTK 4, the canvas is a lot more responsive, on macOS at least.