Skip to content

Commit

Permalink
Fix older adwaita tab bars appearing above the title bar (#5410)
Browse files Browse the repository at this point in the history
When setting up the GTK window with older Adwaita versions, we need to
explicitly create and add a tab bar. The previous code simply prepended
the tab bar into the GtkBox, which resulted in it being the very first
element (ahead of the title bar).

Instead, we grab a reference to the GTK title bar widget and call
`gtk_box_insert_child_after()` to explicitly insert our tab bar into the
hierarchy just after the title bar.
  • Loading branch information
mitchellh authored Jan 29, 2025
2 parents 603639a + a80cf3d commit d31e6c8
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions src/apprt/gtk/Window.zig
Original file line number Diff line number Diff line change
Expand Up @@ -335,10 +335,7 @@ pub fn init(self: *Window, app: *App) !void {
.top,
.left,
.right,
=> c.gtk_box_prepend(
@ptrCast(box),
@ptrCast(@alignCast(tab_bar)),
),
=> c.gtk_box_insert_child_after(@ptrCast(box), @ptrCast(@alignCast(tab_bar)), @ptrCast(@alignCast(self.headerbar.asWidget()))),

.bottom => c.gtk_box_append(
@ptrCast(box),
Expand Down

0 comments on commit d31e6c8

Please sign in to comment.