Skip to content

Commit

Permalink
gtk(wayland): respect window-decoration=none on GNOME (ghostty-org#5463)
Browse files Browse the repository at this point in the history
This is, admittedly, a very silly bug. On GNOME the SSD protocol is not
available and past me just decided to always enable CSDs in that case,
*even when* `window-decoration = none`. I now question my own
intelligence.
  • Loading branch information
mitchellh authored Feb 3, 2025
2 parents 61fd411 + ac582cc commit 3b3e75c
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions src/apprt/gtk/winproto/wayland.zig
Original file line number Diff line number Diff line change
Expand Up @@ -251,12 +251,13 @@ pub const Window = struct {
}

pub fn clientSideDecorationEnabled(self: Window) bool {
// Compositor doesn't support the SSD protocol
if (self.decoration == null) return true;

return switch (self.getDecorationMode()) {
.Client => true,
.Server, .None => false,
// If we support SSDs, then we should *not* enable CSDs if we prefer SSDs.
// However, if we do not support SSDs (e.g. GNOME) then we should enable
// CSDs even if the user prefers SSDs.
.Server => if (self.app_context.kde_decoration_manager) |_| false else true,
.None => false,
else => unreachable,
};
}
Expand Down

0 comments on commit 3b3e75c

Please sign in to comment.