From 431684af7ec26ac412231bd51232cf9257e99772 Mon Sep 17 00:00:00 2001 From: Joshua Holmes Date: Fri, 3 Jan 2025 01:24:39 +0000 Subject: [PATCH] linux: remove check_for_mach_updates because it was unnecessary refactoring --- src/core/Linux.zig | 17 +++++------------ 1 file changed, 5 insertions(+), 12 deletions(-) diff --git a/src/core/Linux.zig b/src/core/Linux.zig index 7351d8d4..de93d829 100644 --- a/src/core/Linux.zig +++ b/src/core/Linux.zig @@ -63,7 +63,11 @@ pub fn tick(core: *Core) !void { while (windows.next()) |window_id| { const native_opt: ?Native = core.windows.get(window_id, .native); if (native_opt) |native| { - check_for_mach_updates(core, window_id); + // checks for updates in mach object fields + const core_window = core.windows.getValue(window_id); + if (core.windows.updated(window_id, .title)) { + setTitle(&native, core_window.title); + } // check for display server events switch (native) { .x11 => try X11.tick(window_id), @@ -187,17 +191,6 @@ pub fn setCursorShape(_: *Linux, _: CursorShape) void { return; } -/// Checks for updates in mach object fields. Does nothing if window is not initialized. -fn check_for_mach_updates(core: *Core, window_id: mach.ObjectID) void { - const core_window = core.windows.getValue(window_id); - const native = &core_window.native; - if (native.*) |n| { - if (core.windows.updated(window_id, .title)) { - setTitle(&n, core_window.title); - } - } -} - /// Check if gamemode should be activated pub fn wantGamemode(allocator: std.mem.Allocator) error{ OutOfMemory, InvalidWtf8 }!bool { const use_gamemode = std.process.getEnvVarOwned(