On Sat, 02 Aug 2025 12:46:14 +0200 Jonas Smedegaard <[email protected]> wrote:
Quoting Matthias Geiger (2025-07-30 15:45:59)
> I started staging gtk-rs in experimental. I intend to upload this to
> unstable some time after the freeze.
> https://gitlab.freedesktop.org/pipewire/helvum/-/merge_requests/73
> seems like a promising starting point for a patch; haven't checked
> whether this release is non-breaking. Will try to follow up with a patch
> soon.
The referenced MR contains little beyond the existing patch that you
helped compose a year ago, and a quick attempt at simply relaxing
crate dependencies further failed to build.
So yes, this needs more work before being usable.
I managed to write a patch that build the application, but it fails to
start because of how glibs exit codes changed. Will debug more tomorrow.
Attaching here anyway; note that this needs upstreams' MR 73 applied
first.
best,
werdahias
>From 2256681dc962a2ba09105a24d4712c4e6d453bfc Mon Sep 17 00:00:00 2001
From: Matthias Geiger <[email protected]>
Date: Sun, 7 Sep 2025 19:14:51 +0200
Subject: [PATCH] feat: Port to gtk-rs 0.10
---
Cargo.toml | 4 ++--
src/application.rs | 2 +-
src/ui/graph/graph_view.rs | 3 ++-
src/ui/graph/node.rs | 3 ++-
src/ui/graph/port.rs | 3 ++-
src/ui/graph/port_handle.rs | 3 ++-
src/ui/graph/zoomentry.rs | 3 ++-
src/ui/window.rs | 2 +-
8 files changed, 14 insertions(+), 9 deletions(-)
diff --git a/Cargo.toml b/Cargo.toml
index cae367c..b469cc4 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -15,8 +15,8 @@ categories = ["gui", "multimedia"]
[dependencies]
pipewire = "0.8.0"
-adw = { version = "0.7", package = "libadwaita", features = ["v1_4"] }
-glib = { version = "0.20", features = ["log"] }
+adw = { version = "0.8", package = "libadwaita", features = ["v1_4"] }
+glib = { version = "0.21", features = ["log"] }
async-channel = "2.2"
log = "0.4.11"
diff --git a/src/application.rs b/src/application.rs
index 17aa9f6..1abcdf8 100644
--- a/src/application.rs
+++ b/src/application.rs
@@ -168,7 +168,7 @@ mod imp {
}
Err(e) => error!("Invalid socket path: {e}"),
}
- -1
+ std::ops::ControlFlow::Break(glib::ExitCode::FAILURE)
}
));
}
diff --git a/src/ui/graph/graph_view.rs b/src/ui/graph/graph_view.rs
index 24158cf..1bd5d95 100644
--- a/src/ui/graph/graph_view.rs
+++ b/src/ui/graph/graph_view.rs
@@ -743,7 +743,8 @@ mod imp {
glib::wrapper! {
pub struct GraphView(ObjectSubclass<imp::GraphView>)
- @extends gtk::Widget;
+ @extends gtk::Widget,
+ @implements gtk::Accessible, gtk::Buildable, gtk::ConstraintTarget, gtk::Scrollable;
}
impl GraphView {
diff --git a/src/ui/graph/node.rs b/src/ui/graph/node.rs
index 79eaa8d..30a3768 100644
--- a/src/ui/graph/node.rs
+++ b/src/ui/graph/node.rs
@@ -149,7 +149,8 @@ mod imp {
glib::wrapper! {
pub struct Node(ObjectSubclass<imp::Node>)
- @extends gtk::Widget;
+ @extends gtk::Widget,
+ @implements gtk::Accessible, gtk::Buildable, gtk::ConstraintTarget;
}
impl Node {
diff --git a/src/ui/graph/port.rs b/src/ui/graph/port.rs
index c0ca193..69e809f 100644
--- a/src/ui/graph/port.rs
+++ b/src/ui/graph/port.rs
@@ -332,7 +332,8 @@ mod imp {
glib::wrapper! {
pub struct Port(ObjectSubclass<imp::Port>)
- @extends gtk::Widget;
+ @extends gtk::Widget,
+ @implements gtk::Accessible, gtk::Buildable, gtk::ConstraintTarget;
}
impl Port {
diff --git a/src/ui/graph/port_handle.rs b/src/ui/graph/port_handle.rs
index a9ca8cc..2024d4c 100644
--- a/src/ui/graph/port_handle.rs
+++ b/src/ui/graph/port_handle.rs
@@ -61,7 +61,8 @@ mod imp {
glib::wrapper! {
pub struct PortHandle(ObjectSubclass<imp::PortHandle>)
- @extends gtk::Widget;
+ @extends gtk::Widget,
+ @implements gtk::Accessible, gtk::Buildable, gtk::ConstraintTarget;
}
impl PortHandle {
diff --git a/src/ui/graph/zoomentry.rs b/src/ui/graph/zoomentry.rs
index 9a96a48..0ba2096 100644
--- a/src/ui/graph/zoomentry.rs
+++ b/src/ui/graph/zoomentry.rs
@@ -177,7 +177,8 @@ mod imp {
glib::wrapper! {
pub struct ZoomEntry(ObjectSubclass<imp::ZoomEntry>)
- @extends gtk::Box, gtk::Widget;
+ @extends gtk::Box, gtk::Widget,
+ @implements gtk::Accessible, gtk::Buildable, gtk::ConstraintTarget;
}
impl ZoomEntry {
diff --git a/src/ui/window.rs b/src/ui/window.rs
index 7c10354..a35f102 100644
--- a/src/ui/window.rs
+++ b/src/ui/window.rs
@@ -52,7 +52,7 @@ mod imp {
glib::wrapper! {
pub struct Window(ObjectSubclass<imp::Window>)
@extends adw::ApplicationWindow, gtk::ApplicationWindow, gtk::Window, gtk::Widget,
- @implements gio::ActionGroup, gio::ActionMap;
+ @implements gio::ActionGroup, gio::ActionMap, gtk::Accessible, gtk::Buildable, gtk::ConstraintTarget, gtk::Native, gtk::Root, gtk::ShortcutManager;
}
impl Window {
--
2.51.0