gtk-ng/wayland: allow more quick terminal configs (#8484)
We should at least be on par with what Kitty's panels could do in terms of customizationpull/8504/head
commit
291d4ed423
|
|
@ -114,11 +114,13 @@ pub const App = struct {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (self.context.xdg_wm_dialog_present and layer_shell.getLibraryVersion().order(.{
|
if (self.context.xdg_wm_dialog_present and
|
||||||
|
layer_shell.getLibraryVersion().order(.{
|
||||||
.major = 1,
|
.major = 1,
|
||||||
.minor = 0,
|
.minor = 0,
|
||||||
.patch = 4,
|
.patch = 4,
|
||||||
}) == .lt) {
|
}) == .lt)
|
||||||
|
{
|
||||||
log.warn("the version of gtk4-layer-shell installed on your system is too old (must be 1.0.4 or newer); disabling quick terminal", .{});
|
log.warn("the version of gtk4-layer-shell installed on your system is too old (must be 1.0.4 or newer); disabling quick terminal", .{});
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
@ -128,10 +130,7 @@ pub const App = struct {
|
||||||
|
|
||||||
pub fn initQuickTerminal(_: *App, apprt_window: *ApprtWindow) !void {
|
pub fn initQuickTerminal(_: *App, apprt_window: *ApprtWindow) !void {
|
||||||
const window = apprt_window.as(gtk.Window);
|
const window = apprt_window.as(gtk.Window);
|
||||||
|
|
||||||
layer_shell.initForWindow(window);
|
layer_shell.initForWindow(window);
|
||||||
layer_shell.setLayer(window, .top);
|
|
||||||
layer_shell.setNamespace(window, "ghostty-quick-terminal");
|
|
||||||
}
|
}
|
||||||
|
|
||||||
fn getInterfaceType(comptime field: std.builtin.Type.StructField) ?type {
|
fn getInterfaceType(comptime field: std.builtin.Type.StructField) ?type {
|
||||||
|
|
@ -411,6 +410,14 @@ pub const Window = struct {
|
||||||
else
|
else
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
layer_shell.setLayer(window, switch (config.@"gtk-quick-terminal-layer") {
|
||||||
|
.overlay => .overlay,
|
||||||
|
.top => .top,
|
||||||
|
.bottom => .bottom,
|
||||||
|
.background => .background,
|
||||||
|
});
|
||||||
|
layer_shell.setNamespace(window, config.@"gtk-quick-terminal-namespace");
|
||||||
|
|
||||||
layer_shell.setKeyboardMode(
|
layer_shell.setKeyboardMode(
|
||||||
window,
|
window,
|
||||||
switch (config.@"quick-terminal-keyboard-interactivity") {
|
switch (config.@"quick-terminal-keyboard-interactivity") {
|
||||||
|
|
|
||||||
|
|
@ -2144,6 +2144,44 @@ keybind: Keybinds = .{},
|
||||||
/// terminal would be half a screen tall, and 500 pixels wide.
|
/// terminal would be half a screen tall, and 500 pixels wide.
|
||||||
@"quick-terminal-size": QuickTerminalSize = .{},
|
@"quick-terminal-size": QuickTerminalSize = .{},
|
||||||
|
|
||||||
|
/// The layer of the quick terminal window. The higher the layer,
|
||||||
|
/// the more windows the quick terminal may conceal.
|
||||||
|
///
|
||||||
|
/// Valid values are:
|
||||||
|
///
|
||||||
|
/// * `overlay`
|
||||||
|
///
|
||||||
|
/// The quick terminal appears in front of all windows.
|
||||||
|
///
|
||||||
|
/// * `top` (default)
|
||||||
|
///
|
||||||
|
/// The quick terminal appears in front of normal windows but behind
|
||||||
|
/// fullscreen overlays like lock screens.
|
||||||
|
///
|
||||||
|
/// * `bottom`
|
||||||
|
///
|
||||||
|
/// The quick terminal appears behind normal windows but in front of
|
||||||
|
/// wallpapers and other windows in the background layer.
|
||||||
|
///
|
||||||
|
/// * `background`
|
||||||
|
///
|
||||||
|
/// The quick terminal appears behind all windows.
|
||||||
|
///
|
||||||
|
/// GTK Wayland only.
|
||||||
|
///
|
||||||
|
/// Available since: 1.2.0
|
||||||
|
@"gtk-quick-terminal-layer": QuickTerminalLayer = .top,
|
||||||
|
/// The namespace for the quick terminal window.
|
||||||
|
///
|
||||||
|
/// This is an identifier that is used by the Wayland compositor and/or
|
||||||
|
/// scripts to determine the type of layer surfaces and to possibly apply
|
||||||
|
/// unique effects.
|
||||||
|
///
|
||||||
|
/// GTK Wayland only.
|
||||||
|
///
|
||||||
|
/// Available since: 1.2.0
|
||||||
|
@"gtk-quick-terminal-namespace": [:0]const u8 = "ghostty-quick-terminal",
|
||||||
|
|
||||||
/// The screen where the quick terminal should show up.
|
/// The screen where the quick terminal should show up.
|
||||||
///
|
///
|
||||||
/// Valid values are:
|
/// Valid values are:
|
||||||
|
|
@ -7202,6 +7240,14 @@ pub const QuickTerminalPosition = enum {
|
||||||
center,
|
center,
|
||||||
};
|
};
|
||||||
|
|
||||||
|
/// See quick-terminal-layer
|
||||||
|
pub const QuickTerminalLayer = enum {
|
||||||
|
overlay,
|
||||||
|
top,
|
||||||
|
bottom,
|
||||||
|
background,
|
||||||
|
};
|
||||||
|
|
||||||
/// See quick-terminal-size
|
/// See quick-terminal-size
|
||||||
pub const QuickTerminalSize = struct {
|
pub const QuickTerminalSize = struct {
|
||||||
primary: ?Size = null,
|
primary: ?Size = null,
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue