diff --git a/src/apprt/gtk/Window.zig b/src/apprt/gtk/Window.zig index ea863051c1..79eb5d0695 100644 --- a/src/apprt/gtk/Window.zig +++ b/src/apprt/gtk/Window.zig @@ -216,6 +216,14 @@ pub fn init(self: *Window, app: *App) !void { } } + // If Adwaita is older than 1.4.0 we don't have the tab overview and so we + // need to stick the headerbar into the content box. + if (comptime !adwaita.versionAtLeast(1, 4, 0)) { + if (self.header) |h| { + c.gtk_box_append(@ptrCast(box), h.asWidget()); + } + } + // In debug we show a warning and apply the 'devel' class to the window. // This is a really common issue where people build from source in debug and performance is really bad. if (comptime std.debug.runtime_safety) { @@ -364,7 +372,12 @@ pub fn init(self: *Window, app: *App) !void { // The box is our main child c.gtk_window_set_child(gtk_window, box); - if (self.header) |h| c.gtk_window_set_titlebar(gtk_window, h.asWidget()); + if (self.header) |h| { + switch (h) { + .adw => {}, + .gtk => c.gtk_window_set_titlebar(gtk_window, h.asWidget()), + } + } } // Show the window