[GH-ISSUE #933] Port to GTK4 #1688

Closed
opened 2026-05-22 22:54:00 +01:00 by JakeStanger · 2 comments
Owner

Originally created by @JakeStanger on GitHub (Apr 9, 2025).
Original GitHub issue: https://github.com/JakeStanger/ironbar/issues/933

As the GTK3 gtk and gtk-layer-shell crates are now deprecated, there is a need to move to GTK4.

This is a tracking issue for the port. Issues requiring GTK4 will be linked as as child - these are not required for the port.

Progress document: https://github.com/JakeStanger/ironbar/wiki/gtk4
Pull request: https://github.com/JakeStanger/ironbar/pull/112

Originally created by @JakeStanger on GitHub (Apr 9, 2025). Original GitHub issue: https://github.com/JakeStanger/ironbar/issues/933 As the GTK3 `gtk` and `gtk-layer-shell` crates are now deprecated, there is a need to move to GTK4. This is a tracking issue for the port. Issues requiring GTK4 will be linked as as child - these are **not** required for the port. Progress document: https://github.com/JakeStanger/ironbar/wiki/gtk4 Pull request: https://github.com/JakeStanger/ironbar/pull/112
Author
Owner

@JakeStanger commented on GitHub (Sep 15, 2025):

All modules are now ported across! While there are still some rough edges, the bar is now in a usable state in GTK4 and is in a great place for people to start testing.

The progress document is being kept up to date with known issues, but I've included these below in more detail.

If you'd like to contribute, there's a few ways:

  • Simply test the PR (#112). Run with it, and report any issues you find either in this thread, or in an issue with [GTK4] in the issue name.
  • Investigate and fix any of the below. I'll be working on what I can, but any help will speed up the process :)
  • Submit fixes for any other issues you find. Just remember to target the GTK4 branch.

Config - Format

GTK 4 does away with the "angle" property on widgets. This has two effects:

  1. Widgets are no longer automatically rotated on vertical bars.
  2. Setting the orientation property on a widget will no longer rotate it.

Instead, rotation is now handled in CSS.

.label {
  transform: rotate(90deg);
}

IPC

All commands related to opening popups are currently unimplemented. Closing works as expected. All other commands should work as expected. Resolved

Menu module

Occasionally on startup all sub-menus for all categories will show, creating a very wide mega-menu.

There are major issues related to specifying the width/height in the config. Setting the height causes the widget width to shrink to the minimum, and setting the width appears to have no effect. This results in menus being inaccessible.

RESOLVED

Tray module

The current (GTK3) implementation makes use of libdbusmenu-gtk3, a library that handles all of the hard work around listening to DBus and converting that into a GTK3 menu widget. GTK4 however threw two problems at us:

  • Some of the widgets this made use of no longer exist
  • There is no equivalent library for GTK4

This means the entire client code and process has been implemented from scratch, without a library. The UI works great thanks to @tglman, but the client code has known problems.

This is technically using client code from my system_tray crate, which previous versions of Ironbar also made use of. The switch away was made due to long-standing evasive bugs related to activating some menu items. It is known, for example, that if you interact with VLC through its UI and then attempt to control it via its tray icon, the entire tray client will lock up until Ironbar restarts. RESOLVED 🎉

GTK 4 also removes the ability to show both an icon and label on a menu item, for some reason. This means that menu items will not have their icons show.

For the most part though, it should work as expected.

<!-- gh-comment-id:3292948775 --> @JakeStanger commented on GitHub (Sep 15, 2025): All modules are now ported across! While there are still some rough edges, the bar is now in a usable state in GTK4 and is in a great place for people to start testing. The progress document is being kept up to date with known issues, but I've included these below in more detail. If you'd like to contribute, there's a few ways: - Simply test the PR (#112). Run with it, and report any issues you find either in this thread, or in an issue with **[GTK4]** in the issue name. - Investigate and fix any of the below. I'll be working on what I can, but any help will speed up the process :) - Submit fixes for any other issues you find. Just remember to target the GTK4 branch. ## **Config - Format** GTK 4 does away with the "angle" property on widgets. This has two effects: 1. Widgets are no longer automatically rotated on vertical bars. 2. Setting the `orientation` property on a widget will no longer rotate it. Instead, rotation is now handled in CSS. ```css .label { transform: rotate(90deg); } ``` ## IPC ~~All commands related to opening popups are currently unimplemented. Closing works as expected. All other commands should work as expected.~~ Resolved ## Menu module ~~Occasionally on startup all sub-menus for all categories will show, creating a very wide mega-menu.~~ ~~There are major issues related to specifying the width/height in the config. Setting the height causes the widget width to shrink to the minimum, and setting the width appears to have no effect. This results in menus being inaccessible.~~ RESOLVED ## Tray module The current (GTK3) implementation makes use of `libdbusmenu-gtk3`, a library that handles all of the hard work around listening to DBus and converting that into a GTK3 menu widget. GTK4 however threw two problems at us: - Some of the widgets this made use of no longer exist - There is no equivalent library for GTK4 This means the entire client code and process has been implemented from scratch, without a library. The UI works great thanks to @tglman, ~~but the client code has known problems~~. This is technically using client code from my `system_tray` crate, which previous versions of Ironbar also made use of. ~~The switch away was made due to long-standing evasive bugs related to activating some menu items. It is known, for example, that if you interact with VLC through its UI and then attempt to control it via its tray icon, the entire tray client will lock up until Ironbar restarts.~~ RESOLVED 🎉 GTK 4 also removes the ability to show both an icon and label on a menu item, for some reason. This means that menu items will not have their icons show. For the most part though, it should work as expected.
Author
Owner

@JakeStanger commented on GitHub (Sep 28, 2025):

I will be aiming to merge the PR next weekend.

Before merging, I will create a release to represent the last GTK3 version as a "stable" fallback in case there are any issues with the GTK 4 build. There will then be a period of a few weeks where any fixes are prioritised, and as soon as the GTK
4 version is stable, I will create another baseline release.

Once there is a GTK 4 release in place, focus on general bugfixes and feature requests will resume.

<!-- gh-comment-id:3343215979 --> @JakeStanger commented on GitHub (Sep 28, 2025): I will be aiming to merge the PR __next weekend__. Before merging, I will create a release to represent the **last GTK3 version** as a "stable" fallback in case there are any issues with the GTK 4 build. There will then be a period of a few weeks where any fixes are prioritised, and as soon as the GTK 4 version is stable, I will create another baseline release. Once there is a GTK 4 release in place, focus on general bugfixes and feature requests will resume.
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#1688
No description provided.