-
Notifications
You must be signed in to change notification settings - Fork 71
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
FR: Port on new WebKitGTK #535
Comments
I would like to do this, but do you know what I'd have to change to get this to work? You got any error message when using the new one? |
With new v43 runtime: Traceback (most recent call last):
File "/app/bin/minigalaxy", line 50, in <module>
main()
File "/app/bin/minigalaxy", line 40, in main
from minigalaxy.ui.gtk import Gtk
File "/app/lib/python3.10/site-packages/minigalaxy/ui/__init__.py", line 3, in <module>
from minigalaxy.ui.window import Window # noqa: F401
File "/app/lib/python3.10/site-packages/minigalaxy/ui/window.py", line 4, in <module>
from minigalaxy.ui.login import Login
File "/app/lib/python3.10/site-packages/minigalaxy/ui/login.py", line 6, in <module>
from minigalaxy.ui.webkit import WebKit2
File "/app/lib/python3.10/site-packages/minigalaxy/ui/webkit.py", line 3, in <module>
gi.require_version('WebKit2', '4.0')
File "/usr/lib/python3.10/site-packages/gi/__init__.py", line 129, in require_version
raise ValueError('Namespace %s not available for version %s' %
ValueError: Namespace WebKit2 not available for version 4.0 |
What does it say if you remove line 3 from
Maybe there is some way to check available versions before importing or to silence this error. I don't know if the newer version works without further changes, though. |
Without 3rd line in Traceback (most recent call last):
File "/usr/lib/python3.10/site-packages/gi/importer.py", line 142, in load_module
introspection_module = get_introspection_module(namespace)
File "/usr/lib/python3.10/site-packages/gi/module.py", line 257, in get_introspection_module
module = IntrospectionModule(namespace, version)
File "/usr/lib/python3.10/site-packages/gi/module.py", line 109, in __init__
repository.require(namespace, version)
gi.RepositoryError: Requiring namespace 'Gtk' version '4.0', but '3.0' is already loaded
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/app/bin/minigalaxy", line 64, in <module>
main()
File "/app/bin/minigalaxy", line 46, in main
from minigalaxy.ui.gtk import Gtk
File "/app/lib/python3.10/site-packages/minigalaxy/ui/__init__.py", line 3, in <module>
from minigalaxy.ui.window import Window # noqa: F401
File "/app/lib/python3.10/site-packages/minigalaxy/ui/window.py", line 5, in <module>
from minigalaxy.ui.login import Login
File "/app/lib/python3.10/site-packages/minigalaxy/ui/login.py", line 6, in <module>
from minigalaxy.ui.webkit import WebKit2
File "/app/lib/python3.10/site-packages/minigalaxy/ui/webkit.py", line 3, in <module>
from gi.repository import WebKit2 # noqa: E402,F401
File "/usr/lib/python3.10/site-packages/gi/importer.py", line 144, in load_module
raise ImportError(e)
ImportError: Requiring namespace 'Gtk' version '4.0', but '3.0' is already loaded |
Does it work if you just set it to require 3.0? If it does, I'll try to find a method to detect what is loaded. |
So, according to
Porting on new WebKitGTK probably require porting on new 💫 Somewhat related: #485 (comment). |
Agreed, I think GTK4 would also provide us with some nice looking new widgets. Please keep the comments coming :D |
In the GNOME 43 SDK, there are two WebKit2 bindings - 5.0 and 4.1. I guess the Gtk 3.0/4.0 collision happens when WebKit2 5.0 is imported (and it's probably imported by default if you don't specify a version in diff --git a/minigalaxy/ui/webkit.py b/minigalaxy/ui/webkit.py
index c71a7ff..4b36a52 100644
--- a/minigalaxy/ui/webkit.py
+++ b/minigalaxy/ui/webkit.py
@@ -1,4 +1,7 @@
import gi
-gi.require_version('WebKit2', '4.0')
+try:
+ gi.require_version('WebKit2', '4.0')
+except gi.RepositoryError:
+ gi.require_version('WebKit2', '4.1')
from gi.repository import WebKit2 # noqa: E402,F401 |
I've found a solution which is not the prettiest, but does work: ec823d4 |
Works with ec823d4 and new v43 runtime. Awesome. Do you plan made a new minor release or i can backport this patch on Flathub build? |
Use webkit 4.1 when possible. sharkwouter/minigalaxy#535
Use webkit 4.1 when possible. sharkwouter/minigalaxy#535
Use webkit 4.1 when possible. sharkwouter/minigalaxy#535
Consider port on latest WebKitGTK version https://webkitgtk.org/2022/09/16/webkitgtk2.38.0-released.html.
Rationale: latest GNOME v43 runtime contains
2.38
version so currently not possible to upgrade runtime on Flathub build without bundling old WebKitGTK version which is not optimal. New runtime is always nice to have for project like Minigalaxy since they are contain latest Mesa versions and other cool stuff which useful for games.The text was updated successfully, but these errors were encountered: