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(