gtk: add setMonitor binding and kde-output-order-v1 protocol

Add the missing setMonitor() function to the gtk4-layer-shell Zig
bindings and provide the gdk module so it can reference gdk.Monitor.

Register the kde-output-order-v1 Wayland protocol from
plasma-wayland-protocols and generate its scanner binding. This
protocol reports the compositor's monitor priority ordering and is
needed to correctly identify the primary monitor for
quick-terminal-screen support on Linux.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
Jake Guthmiller
2026-02-07 20:20:49 -06:00
parent 2d69568a67
commit 96f8f0d93c
2 changed files with 13 additions and 0 deletions

View File

@@ -3,6 +3,7 @@ const std = @import("std");
const c = @cImport({
@cInclude("gtk4-layer-shell.h");
});
const gdk = @import("gdk");
const gtk = @import("gtk");
pub const ShellLayer = enum(c_uint) {
@@ -61,6 +62,10 @@ pub fn setKeyboardMode(window: *gtk.Window, mode: KeyboardMode) void {
c.gtk_layer_set_keyboard_mode(@ptrCast(window), @intFromEnum(mode));
}
pub fn setMonitor(window: *gtk.Window, monitor: ?*gdk.Monitor) void {
c.gtk_layer_set_monitor(@ptrCast(window), if (monitor) |m| @ptrCast(m) else null);
}
pub fn setNamespace(window: *gtk.Window, name: [:0]const u8) void {
c.gtk_layer_set_namespace(@ptrCast(window), name.ptr);
}