-
-
Notifications
You must be signed in to change notification settings - Fork 30
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
GTK4 support? #94
Comments
I'm not sure whether webkit2gtk has a release supporting gtk4, you might have to build it with some cli options as specified here. |
I have a super hacky branch for Gtk4 here: https://github.com/jangernert/webkit2gtk-rs/tree/gtk4 Just enough for me to port my application to Gtk4. |
@jangernert, would it be beneficial to move your branch over to the main Additionally, for those finding this GitHub issue, I've written a script to build & install WebKitGTK with GTK4 support ( #!/bin/bash
# Cleanup
rm -rf ./gtk4-dependencies
mkdir gtk4-dependencies && cd gtk4-dependencies
# GLib
git clone --depth 1 --recurse-submodules --shallow-submodules https://gitlab.gnome.org/GNOME/glib.git
cd ./glib
meson _build && ninja -C _build
sudo ninja -C _build install
cd ../
# glib-networking
git clone --depth 1 --recurse-submodules --shallow-submodules https://gitlab.gnome.org/GNOME/glib-networking.git
cd ./glib-networking
mkdir build && cd build
meson --prefix=/usr --buildtype=release .. && ninja
sudo ninja install
cd ../../
# libsoup 3
git clone --depth 1 --recurse-submodules --shallow-submodules https://gitlab.gnome.org/GNOME/libsoup.git
cd ./libsoup
mkdir build && cd build
meson --prefix=/usr --buildtype=release .. && ninja
sudo ninja install
cd ../../
# WebKitGTK 5.0
git clone --depth 1 --recurse-submodules --shallow-submodules https://github.com/WebKit/WebKit.git
cd ./WebKit
mkdir build && cd build
cmake -DCMAKE_BUILD_TYPE=Release \
-DCMAKE_INSTALL_PREFIX=/usr \
-DCMAKE_SKIP_RPATH=ON -DPORT=GTK \
-DLIB_INSTALL_DIR=/usr/lib \
-DUSE_GTK4=ON \
-DUSE_AVIF=ON \
-GNinja .. && ninja
sudo ninja install
cd ../../ |
I don't see any reason for that. It's just as easy to reference the fork in your cargo.toml. And once webkitgtk 5.0 is released and packaged I would start generating bindings from scratch. I manually copied and patched the |
I've since encountered two issues which I suspect are upstream:
I've filed a bug report in the WebKit Bugzilla: https://bugs.webkit.org/show_bug.cgi?id=228268 |
Well, this is weird. Epiphany uses Gtk4, what exactly is stopping webkit2gtk-rs? |
Epiphany does not use GTK4. It uses GTK3 with libhandy. It does appear that WebKitGTK 5.0 (WebKit for GTK 4) cannot render properly on Nvidia GPUs. |
@jangernert I've been unable to get your branch working with my project as of recent, and would appreciate some quick assistance. I've been compiling libsoup3 and WebKitGTK 5.0 (with the I encounter the same exact error when using the I do have libsoup2 and libsoup3 co-existing on my Arch Linux system. Could this be the source of the issue? Any thoughts on how I can fix this, short of uninstalling libsoup2? |
You should try the official WIP bindings: https://gitlab.gnome.org/World/Rust/webkit2gtk5-rs You'll need to use the Gtk-Bindings from git as well. |
It appears WebKit2Gtk now supports GTK-4 bindings in its new stable release: https://webkitgtk.org/2023/03/17/webkitgtk2.40.0-released.html Of course, this release was only a week or two ago, so it'll be a while until this version is available on most "scheduled-release" distros (debian, ubuntu, etc.). Regardless, I think this is an issue to keep a look out for 👀 |
for tauri, becuase it depends on https://github.com/tauri-apps/libappindicator-rs , which depends on libayatana, and libayatana only support gtk3 (see AyatanaIndicators/libayatana-appindicator#22 ). I do not think it can upgrade to gtk4 for the current. |
Just for my understanding, does this mean that there is no way to use webkit2gtk in rust with gtk4 right now and for the foreseeable future? |
@jeena there is no |
Currently I need to use GTK to be able to add some functions such as getting the desktop icons in GNU Linux and some other things... As far as I can see, gtk-rs cannot be used yet because of this it is pointing to gtk4 and tauri does not. supports. I reconsidered supporting it, I saw the thread and I understand that due to dependencies it is still not possible, is this so? |
the only blocking dependency afaik, is libappindicator but we might move away soon to ksni (KStatusNotifierItem), see tauri-apps/tauri#11293. If and once that lands, we can migrate to gtk4 in tauri@v3 |
Relevant issue from the recent migration to libwebkitgtk-4.1 (tauri-apps/tauri#9662) Without a build time option (to select older API levels) moving to libwebkitgtk-6.0.so and gtk4 would require
|
This blog post has got me wanting to port my WebKit-powered browser project over to GTK4-rs, as I'm seeking to replacing my implementation of tabs with the Libadwaita widget. This would accomplish two things for me: it removes the burden on me to solely develop & maintain a major component of my project, and it would additionally allow my project to match the design guidelines that other GTK projects follow.
As of present, I'm unable to make this switch to GTK4 + Libadwaita. I've:
libadwaita-rs
uses release numbers and not Git for its dependencies)make gir
)However, I still encounter 6 build errors within
webkit2gtk-sys
, which reflect the following errors given by GIR:Specifically,
webkit2gtk-rs
is currently expectingGdkEventKey
,GtkContainerClass
,GtkContainer
, andGtkAction
to still exist.During my work on getting this repository building again (see: #89), I became a little familiar with how this all works, but I must admit there's still a lot I don't know. I'm not good with Rust or C (hell, software development in general), I'm not familiar with the technical work being done in the GTK/GNOME world, nor am I familiar with the goings on with GTK-rs, so I'm sorry I can't work on this myself. I wish I had the knowledge and ability to contribute directly instead of just opening a GitHub issue.
The text was updated successfully, but these errors were encountered: