[PR #380] [MERGED] Update GTK-related crates, replace GLib channels with Tokio channels, refactor Tokio runtime code #7702

Closed
opened 2026-05-23 02:55:34 +01:00 by JakeStanger · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/JakeStanger/ironbar/pull/380
Author: @JakeStanger
Created: 12/17/2023
Status: Merged
Merged: 12/18/2023
Merged by: @JakeStanger

Base: masterHead: refactor/update-gtk


📝 Commits (2)

  • bea442e refactor: update gtk/glib, remove glib channels
  • e847a84 refactor: fix casting based clippy warnings

📊 Changes

39 files changed (+428 additions, -467 deletions)

View changed files

📝 Cargo.lock (+73 -61)
📝 Cargo.toml (+3 -3)
📝 src/bar.rs (+18 -20)
src/bridge_channel.rs (+0 -44)
📝 src/clients/clipboard.rs (+1 -2)
📝 src/clients/compositor/hyprland.rs (+1 -2)
📝 src/clients/compositor/sway.rs (+1 -2)
📝 src/clients/music/mpd.rs (+1 -2)
📝 src/clients/music/mpris.rs (+2 -3)
📝 src/clients/system_tray.rs (+1 -2)
📝 src/clients/wayland/client.rs (+1 -2)
📝 src/config/common.rs (+4 -5)
📝 src/dynamic_value/dynamic_bool.rs (+13 -11)
📝 src/dynamic_value/dynamic_string.rs (+9 -11)
📝 src/image/provider.rs (+7 -7)
📝 src/ipc/server.rs (+5 -14)
📝 src/macros.rs (+49 -0)
📝 src/main.rs (+50 -14)
📝 src/modules/clipboard.rs (+13 -20)
📝 src/modules/clock.rs (+9 -14)

...and 19 more files

📄 Description

This is a major refactor which updates GTK, GLib and GTK Layer Shell to their latest versions.

GLib channels, previously used for receiving events on the GLib Main Context thread have been deprecated and a new method for running Futures on the main thread has been added instead. This commit also replaces all the deprecated code with this.

As part of the above, a bug was uncovered related to creating the GLib main context inside the Tokio runtime. Spawning of Tokio tasks has been refactored to fix this.


This change means async code and GObjects can now co-exist, which simplifies a lot of the message passing, opening the gates to more refactoring to simplify code, and hopefully will make weird issues with channels less likely. In turn, this should help unlock a fix for some outstanding issues (cough #291).


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/JakeStanger/ironbar/pull/380 **Author:** [@JakeStanger](https://github.com/JakeStanger) **Created:** 12/17/2023 **Status:** ✅ Merged **Merged:** 12/18/2023 **Merged by:** [@JakeStanger](https://github.com/JakeStanger) **Base:** `master` ← **Head:** `refactor/update-gtk` --- ### 📝 Commits (2) - [`bea442e`](https://github.com/JakeStanger/ironbar/commit/bea442ed960f513288cf857e8ee9a5c61f742dfa) refactor: update gtk/glib, remove glib channels - [`e847a84`](https://github.com/JakeStanger/ironbar/commit/e847a84c21763164d7f90b7c85e48c386b41002c) refactor: fix casting based clippy warnings ### 📊 Changes **39 files changed** (+428 additions, -467 deletions) <details> <summary>View changed files</summary> 📝 `Cargo.lock` (+73 -61) 📝 `Cargo.toml` (+3 -3) 📝 `src/bar.rs` (+18 -20) ➖ `src/bridge_channel.rs` (+0 -44) 📝 `src/clients/clipboard.rs` (+1 -2) 📝 `src/clients/compositor/hyprland.rs` (+1 -2) 📝 `src/clients/compositor/sway.rs` (+1 -2) 📝 `src/clients/music/mpd.rs` (+1 -2) 📝 `src/clients/music/mpris.rs` (+2 -3) 📝 `src/clients/system_tray.rs` (+1 -2) 📝 `src/clients/wayland/client.rs` (+1 -2) 📝 `src/config/common.rs` (+4 -5) 📝 `src/dynamic_value/dynamic_bool.rs` (+13 -11) 📝 `src/dynamic_value/dynamic_string.rs` (+9 -11) 📝 `src/image/provider.rs` (+7 -7) 📝 `src/ipc/server.rs` (+5 -14) 📝 `src/macros.rs` (+49 -0) 📝 `src/main.rs` (+50 -14) 📝 `src/modules/clipboard.rs` (+13 -20) 📝 `src/modules/clock.rs` (+9 -14) _...and 19 more files_ </details> ### 📄 Description This is a major refactor which updates GTK, GLib and GTK Layer Shell to their latest versions. GLib channels, previously used for receiving events on the GLib Main Context thread have been deprecated and a new method for running Futures on the main thread has been added instead. This commit also replaces all the deprecated code with this. As part of the above, a bug was uncovered related to creating the GLib main context inside the Tokio runtime. Spawning of Tokio tasks has been refactored to fix this. --- This change means async code and GObjects can now co-exist, which simplifies a lot of the message passing, opening the gates to more refactoring to simplify code, and hopefully will make weird issues with channels less likely. In turn, this should help unlock a fix for some outstanding issues (*cough* #291). --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
JakeStanger 2026-05-23 02:55:34 +01:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
JakeStanger/ironbar#7702
No description provided.