summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--build.zig4
m---------depends/xcb-zig0
-rw-r--r--src/main.zig6
3 files changed, 5 insertions, 5 deletions
diff --git a/build.zig b/build.zig
index 63a7964..3af2642 100644
--- a/build.zig
+++ b/build.zig
@@ -9,6 +9,8 @@ pub fn build(b: *std.Build) void {
.root_source_file = .{ .path = "src/main.zig" },
.target = target,
.optimize = optimize,
+ .strip = optimize != std.builtin.OptimizeMode.Debug,
+ .single_threaded = true,
});
const xcb_dep = b.anonymousDependency("depends/xcb-zig", @import("depends/xcb-zig/build.zig"), .{
@@ -17,9 +19,7 @@ pub fn build(b: *std.Build) void {
});
exe.linkLibrary(xcb_dep.artifact("xcb-zig"));
- exe.strip = optimize != std.builtin.OptimizeMode.Debug;
exe.want_lto = optimize != std.builtin.OptimizeMode.Debug;
- exe.single_threaded = true;
b.installArtifact(exe);
diff --git a/depends/xcb-zig b/depends/xcb-zig
-Subproject 602bc79e2461c45fde4703f70442cd17cb11d88
+Subproject 1c449ccd8c24d38e567f08ee20a350a1eea056d
diff --git a/src/main.zig b/src/main.zig
index 2c30db5..366754b 100644
--- a/src/main.zig
+++ b/src/main.zig
@@ -15,13 +15,13 @@ pub fn main() !void {
const screen: *c.xcb_screen_t = @ptrCast(c.xcb_setup_roots_iterator(c.xcb_get_setup(conn)).data);
- var foreground = c.xcb_generate_id(conn);
+ const foreground = c.xcb_generate_id(conn);
mask = c.XCB_GC_FOREGROUND | c.XCB_GC_GRAPHICS_EXPOSURES;
values[0] = screen.black_pixel;
values[1] = 0;
_ = c.xcb_create_gc(conn, foreground, screen.root, mask, @ptrCast(&values));
- var background = c.xcb_generate_id(conn);
+ const background = c.xcb_generate_id(conn);
mask = c.XCB_GC_BACKGROUND | c.XCB_GC_GRAPHICS_EXPOSURES;
values[0] = screen.white_pixel;
values[1] = 0;
@@ -38,7 +38,7 @@ pub fn main() !void {
_ = c.xcb_flush(conn);
while (true) {
- var e = c.xcb_wait_for_event(conn) orelse break;
+ const e = c.xcb_wait_for_event(conn) orelse break;
defer std.c.free(e);
switch (e.*.response_type & ~@as(u8, 0x80)) {
c.XCB_EXPOSE => {