gtk: address PR review feedback for quick-terminal-screen

This commit is contained in:
Jake Guthmiller
2026-03-02 23:33:19 -06:00
parent 18fa161222
commit beeb810c04
2 changed files with 7 additions and 4 deletions

View File

@@ -63,7 +63,7 @@ pub fn setKeyboardMode(window: *gtk.Window, mode: KeyboardMode) void {
}
pub fn setMonitor(window: *gtk.Window, monitor: ?*gdk.Monitor) void {
c.gtk_layer_set_monitor(@ptrCast(window), if (monitor) |m| @ptrCast(m) else null);
c.gtk_layer_set_monitor(@ptrCast(window), @ptrCast(monitor));
}
pub fn setNamespace(window: *gtk.Window, name: [:0]const u8) void {

View File

@@ -178,7 +178,6 @@ pub const App = struct {
// Try to find the monitor matching the primary output name.
if (context.primary_output_name) |*stored_name| {
const name = std.mem.sliceTo(stored_name, 0);
var i: u32 = 0;
while (monitors.getObject(i)) |item| : (i += 1) {
const monitor = gobject.ext.cast(gdk.Monitor, item) orelse {
@@ -186,8 +185,7 @@ pub const App = struct {
continue;
};
if (monitor.getConnector()) |connector_z| {
const connector = std.mem.sliceTo(connector_z, 0);
if (std.mem.eql(u8, connector, name)) {
if (std.mem.orderZ(u8, connector_z, stored_name) == .eq) {
context.primary_output_match_failed_logged = false;
return monitor;
}
@@ -282,6 +280,11 @@ pub const App = struct {
// Already bound: skip duplicate, allow replacement for
// protocols tracked by registry global name.
// Compositors may re-advertise globals at runtime
// (e.g. when a display server component restarts).
// For protocols with a stored global name we detect
// replacement (different name) vs harmless duplicate
// (same name); simple protocols just keep the first.
if (existing_global != null) {
if (global_name_field != null) {
if (existing_global_name != null and existing_global_name.? == v.name) {