From 844f813ab68ee3104e639b0e8197dd386ec373b7 Mon Sep 17 00:00:00 2001 From: "Alexander Cusaac (MightyChubz)" Date: Wed, 13 May 2026 00:51:31 -0400 Subject: [PATCH 1/6] refactor: Add returns to all window mapping/unmapping functions These do return a `b32` value on return, true for success and false for failure. They should be here since these can fail. --- vendor/x11/xlib/xlib_procs.odin | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/vendor/x11/xlib/xlib_procs.odin b/vendor/x11/xlib/xlib_procs.odin index 528bcaa72..12d12c4ef 100644 --- a/vendor/x11/xlib/xlib_procs.odin +++ b/vendor/x11/xlib/xlib_procs.odin @@ -181,11 +181,11 @@ foreign xlib { DestroyWindow :: proc(display: ^Display, window: Window) --- DestroySubwindows :: proc(display: ^Display, window: Window) --- // Windows: mapping/unmapping - MapWindow :: proc(display: ^Display, window: Window) --- - MapRaised :: proc(display: ^Display, window: Window) --- - MapSubwindows :: proc(display: ^Display, window: Window) --- - UnmapWindow :: proc(display: ^Display, window: Window) --- - UnmapSubwindows :: proc(display: ^Display, window: Window) --- + MapWindow :: proc(display: ^Display, window: Window) -> b32 --- + MapRaised :: proc(display: ^Display, window: Window) -> b32 --- + MapSubwindows :: proc(display: ^Display, window: Window) -> b32 --- + UnmapWindow :: proc(display: ^Display, window: Window) -> b32 --- + UnmapSubwindows :: proc(display: ^Display, window: Window) -> b32 --- // Windows: configuring ConfigureWindow :: proc( display: ^Display, From a1a201b4ffe21920bdbfcb46003fc44d78c2eecc Mon Sep 17 00:00:00 2001 From: "Alexander Cusaac (MightyChubz)" Date: Wed, 13 May 2026 00:51:40 -0400 Subject: [PATCH 2/6] typo oops --- vendor/x11/xlib/xlib_procs.odin | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/vendor/x11/xlib/xlib_procs.odin b/vendor/x11/xlib/xlib_procs.odin index 12d12c4ef..19087fccb 100644 --- a/vendor/x11/xlib/xlib_procs.odin +++ b/vendor/x11/xlib/xlib_procs.odin @@ -1367,7 +1367,7 @@ foreign xlib { display: ^Display, window: Window, ) -> ^XWMHints --- - // Setting and reading MW_NORMAL_HINTS property + // Setting and reading WM_NORMAL_HINTS property AllocSizeHints :: proc() -> ^XSizeHints --- SetWMNormalHints :: proc( display: ^Display, From e294f3f1e16119c2d28fd92d4c2189b7f2997431 Mon Sep 17 00:00:00 2001 From: "Alexander Cusaac (MightyChubz)" Date: Wed, 13 May 2026 02:11:58 -0400 Subject: [PATCH 3/6] feat: Add atom constants for XA_CARDINAL and XA_INTEGER XA_CARDINAL is used in particular for frame extents. --- vendor/x11/xlib/xlib_const.odin | 2 ++ 1 file changed, 2 insertions(+) diff --git a/vendor/x11/xlib/xlib_const.odin b/vendor/x11/xlib/xlib_const.odin index 6a57a516f..cb4037e45 100644 --- a/vendor/x11/xlib/xlib_const.odin +++ b/vendor/x11/xlib/xlib_const.odin @@ -110,6 +110,8 @@ PropModePrepend :: 1 PropModeAppend :: 2 XA_ATOM :: Atom(4) +XA_CARDINAL :: Atom(6) +XA_INTEGER :: Atom(19) XA_WM_CLASS :: Atom(67) XA_WM_CLIENT_MACHINE :: Atom(36) XA_WM_COMMAND :: Atom(34) From 53dd8075b1618710ec052abb287d9fa416f16a89 Mon Sep 17 00:00:00 2001 From: "Alexander Cusaac (MightyChubz)" Date: Wed, 13 May 2026 02:13:15 -0400 Subject: [PATCH 4/6] refactor: Clean signature for GetWindowProperty --- vendor/x11/xlib/xlib_procs.odin | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/vendor/x11/xlib/xlib_procs.odin b/vendor/x11/xlib/xlib_procs.odin index 19087fccb..ad4a2b6e9 100644 --- a/vendor/x11/xlib/xlib_procs.odin +++ b/vendor/x11/xlib/xlib_procs.odin @@ -339,10 +339,10 @@ foreign xlib { long_len: int, delete: b32, req_type: Atom, - act_type: [^]Atom, - act_format: [^]i32, - nitems: [^]uint, - bytes_after: [^]uint, + act_type: ^Atom, + act_format: ^i32, + nitems: ^uint, + bytes_after: ^uint, props: ^rawptr, ) -> i32 --- ListProperties :: proc( From 310d27ff19df7c97eae9305223284c99be44171a Mon Sep 17 00:00:00 2001 From: "Alexander Cusaac (MightyChubz)" Date: Wed, 13 May 2026 02:13:46 -0400 Subject: [PATCH 5/6] fix: Change discard from bool to b32 in Sync --- vendor/x11/xlib/xlib_procs.odin | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/vendor/x11/xlib/xlib_procs.odin b/vendor/x11/xlib/xlib_procs.odin index ad4a2b6e9..30bf54921 100644 --- a/vendor/x11/xlib/xlib_procs.odin +++ b/vendor/x11/xlib/xlib_procs.odin @@ -1027,7 +1027,7 @@ foreign xlib { // Events SelectInput :: proc(display: ^Display, window: Window, mask: EventMask) --- Flush :: proc(display: ^Display) -> i32 --- - Sync :: proc(display: ^Display, discard: bool) -> i32 --- + Sync :: proc(display: ^Display, discard: b32) -> i32 --- EventsQueued :: proc(display: ^Display, mode: EventQueueMode) -> i32 --- Pending :: proc(display: ^Display) -> i32 --- NextEvent :: proc(display: ^Display, event: ^XEvent) --- From 6888cca9822d98cab1781f4137d6cf7c1da3041c Mon Sep 17 00:00:00 2001 From: "Alexander Cusaac (MightyChubz)" Date: Wed, 13 May 2026 18:07:57 -0400 Subject: [PATCH 6/6] refactor: Change bit_set type for SizeHints to int This doesn't really change actual behavior, but to stay accurate to the internal logic of X11, this would be a regular long for the flags, not an unsigned long. --- vendor/x11/xlib/xlib_const.odin | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/vendor/x11/xlib/xlib_const.odin b/vendor/x11/xlib/xlib_const.odin index cb4037e45..9163d1830 100644 --- a/vendor/x11/xlib/xlib_const.odin +++ b/vendor/x11/xlib/xlib_const.odin @@ -713,7 +713,7 @@ AllHints :: WMHints{ .WindowGroupHint, } -SizeHints :: bit_set[SizeHintsBits; uint] +SizeHints :: bit_set[SizeHintsBits; int] SizeHintsBits :: enum { USPosition = 0, USSize = 1,