-
Notifications
You must be signed in to change notification settings - Fork 383
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
Update windowing.py to GTK 3.24 #1212
Conversation
windowing.py: revert commit a89f983.
#1161 Replaced New problem is line 238, |
Okay, do you want me to merge this PR into gtk-4.0 branch? |
This is still a draft. It partially fixes the relevant issues, but I'd like to focus on other issues (new directory structure, upgrading build system, upgrading unit tests) before merging this one in, as those issues will help me better understand the project as a whole. The lack of this fix breaks MyPaint on Wayland compositors, so it is important to finish this draft before v2.1.0 |
In other projects that were migrated to GTK 4, we often incrementally update the deprecations for minor GTK version upgrades in small, self-contained, easy-to-review PRs and target them directly to the development branch once they are ready. As they are self-contained, they should not affect the functionality of the rest of the app (at most we will need to bump minimal GTK version, which should be fine for development branch) so this will reduce divergence between GTK 4 branch and develoment branch, making it in turn easier to review and rebase onto master. |
@jtojnar I will ask, thanks to PyGI's (and Python's) fun way of calling methods I have trouble finding all the depreciated calls to begin with (this is why I was considering going straight into gtk4 and patching warnings and errors as they appear in the interpreter). Do you know of a way to find them quickly? |
Yeah, this is much easier with compiled languages. Here we can only see the deprecations through at runtime. But you should not need to switch to GTK 4, you should be able to enable the deprecation warnings (silenced by default) with the following patch: --- a/mypaint.py
+++ b/mypaint.py
@@ -26,6 +26,9 @@ import os.path
from os.path import join, isdir, dirname, abspath
import re
import logging
+import warnings
+import gi
+warnings.simplefilter('default', gi.PyGIDeprecationWarning)
logger = logging.getLogger('mypaint')
if sys.version_info >= (3,): There are also some deprecations which need to be enabled with (Though for some reason I am not getting all the warnings I would expect. Edit: asked on pygobject chat.) There was a feature request for mypy to find deprecations using static analysis but it fizzled out due to a lack of standard deprecation markings. Looks like those has been accepted since in PEP-0702 but it will take time until they are recognized by tooling. And since we do not do static analysis currently, we would need to start first. Also since the bindings are generated at runtime, we would need to employ pygobject/pygobject-stubs#165. |
Quoting Neui from the GNOME Python chat:
|
wait, I have fingers don't I? I'll do it |
Part of #1211
Depreciated GDK references:
I haven't checked GTK API references, though.