Merge pull request #397 from mitchellh/mrn/gtk-window-decoration

gtk: allow hiding window decoration in configuration
This commit is contained in:
Mitchell Hashimoto
2023-09-03 12:41:14 -07:00
committed by GitHub
2 changed files with 11 additions and 0 deletions

View File

@ -354,6 +354,12 @@ const Window = struct {
c.gtk_widget_set_opacity(@ptrCast(window), app.config.@"background-opacity");
}
// Hide window decoration if configured. This has to happen before
// `gtk_widget_show`.
if (!app.config.@"window-decoration") {
c.gtk_window_set_decorated(gtk_window, 0);
}
c.gtk_widget_show(window);
_ = c.g_signal_connect_data(window, "close-request", c.G_CALLBACK(&gtkCloseRequest), self, null, G_CONNECT_DEFAULT);
_ = c.g_signal_connect_data(window, "destroy", c.G_CALLBACK(&gtkDestroy), self, null, G_CONNECT_DEFAULT);

View File

@ -219,6 +219,11 @@ pub const Config = struct {
/// specified in the configuration "font-size" will be used.
@"window-inherit-font-size": bool = true,
/// If false, windows won't have native decorations, i.e. titlebar and
/// borders.
/// Currently only supported with GTK.
@"window-decoration": bool = true,
/// Whether to allow programs running in the terminal to read/write to
/// the system clipboard (OSC 52, for googling). The default is to
/// disallow clipboard reading but allow writing.