2zw - X11 Windowmanager
Files | Log | Commits | Refs | README
Author: erikbackman
Date: 2024-02-21
Subject: move things around
commit 8a2f6508648cf2cdc35f7abd094849d35ae2ecdb
Author: erikbackman <erikbackman@users.noreply.github.com>
Date: Wed Feb 21 14:04:18 2024 +0100
move things around
diff --git a/src/main.zig b/src/main.zig
index 247320b..9ce9158 100644
--- a/src/main.zig
+++ b/src/main.zig
@@ -97,15 +97,16 @@ var display: *C.Display = undefined;
var root: C.Window = undefined;
var mouse: C.XButtonEvent = undefined;
var window_changes: C.XWindowChanges = undefined;
-// IMPROVE: Keeping a pointer to previously_focused window as the previs node in the window list
-// may or may not be the previously focused one.
-var previously_focused: ?*L.Node = undefined;
// Clients are kept in a doubly-linked list
const L = std.DoublyLinkedList(Client);
var list = L{};
var cursor: ?*L.Node = null; // having the cursor be nullable is annoying..
+// IMPROVE: Keeping a pointer to previously_focused window as the previs node in the window list
+// may or may not be the previously focused one.
+var previously_focused: ?*L.Node = undefined;
+
fn addClient(allocator: std.mem.Allocator, window: C.Window) !*L.Node {
var attributes: C.XWindowAttributes = undefined;
_ = C.XGetWindowAttributes(display, window, &attributes);