Skip to content

Make X11 and Wayland libraries optional - #6

Closed
elcritch wants to merge 16 commits into
masterfrom
fix/optional-platform-libraries
Closed

elcritch wants to merge 16 commits into
masterfrom
fix/optional-platform-libraries

Conversation

@elcritch

@elcritch elcritch commented Sep 21, 2026 •

Copy link
Copy Markdown
Owner

Summary

  • Load Linux/BSD X11, GLX, XRender, Xcursor, Xext, Wayland, xkbcommon, EGL, wayland-egl, and Vulkan entry points through optional runtime handles.
  • Keep one Siwin binary while advertising only platforms whose required symbols are available.
  • Correct foreign ABI boundaries and rollback/cleanup for partially-created windows and EGL/GLX contexts.
  • Preserve pointer-compatible Vulkan surface access on 64-bit targets while retaining the full 64-bit handle on 32-bit targets.

Validation

  • nim check src/siwin.nim
  • nim check --cpu:i386 src/siwin.nim
  • nim check tests/t_vulkan.nim
  • nim r tests/tscale_pixels.nim
  • X11 event-loop and OpenGL tests passed under Xvfb with Wayland disabled.
  • Full nim c src/siwin.nim link succeeded; readelf -d showed only libc, libm, and libthr as required shared libraries.
  • C and C++ syntax checks of bindings/siwin.h passed.

tpopup_api still requires a live Wayland compositor and is not runnable in this headless environment.

levovix0 and others added 14 commits August 29, 2026 22:23
* Fix unbounded X11 window size limits

* Fix CI after event loop refactor
* Fix transparent X11 popup window attributes

* Export WinAPI window initialization helper

* Export WinAPI OpenGL window class

* Export WinAPI renderer event helper

* Retry CI after GrabNim download failure

* Retry GrabNim installer downloads in CI
* fix: compilation for android

* refactor: move popup mathematics into windowUtils

* fix: platforms/x11/offscreen standalone compilation
* Request renders for native X11 and WinAPI damage

* Fix example dependency feature in CI

* Initialize event loop render test frames

* Keep optional examples enabled for Windows Vulkan tests

* Avoid requiring an empty input poll in render test

* Diagnose initial render delivery on Windows

* Use concrete callbacks for multi-window render test

* Avoid captured state in multi-window render test

* Use one window for native damage test

* Avoid visible first-step race in native damage test

* Drain native events before damage assertions

* Log Windows paint queue state on damage failure

* Log paint rectangle during Windows damage test

* Inspect native paint flags without peeking the queue

* Read Windows paint damage before EndPaint

* Keep native event drain bounded

* Avoid looping while draining native messages

* Inspect paint rectangle before EndPaint

* Detect update region before BeginPaint

* Render on every WinAPI paint notification

* Trace WinAPI paint service path

* Fix Windows native damage test fixture
@elcritch

Copy link
Copy Markdown
Owner Author

Bigger change, but it changes both x11 and wayland to be runtime loaded so a single linux or bsd binary can run on either.

For example users running wayland for example end up needing libxrender and others. The same for x11 users.

@elcritch
elcritch marked this pull request as ready for review September 21, 2026 17:32
@elcritch

Copy link
Copy Markdown
Owner Author

Superseded by the upstream-targeted draft PR levovix0#56: levovix0#56

@elcritch elcritch closed this Sep 21, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants