1
0
Fork
You've already forked rowm
0

feat: RandR, monitor hotplug #1

Merged
romaintb merged 15 commits from feat/RandR into main 2026年01月04日 12:09:25 +01:00
No description provided.
refactor: extract monitor management to separate module
Some checks failed
CI / lint (pull_request) Failing after 3s
CI / build (pull_request) Failing after 3s
05a47e7165
Move all monitor detection, setup, and hotplug handling from main.zig
to monitor.zig to improve code organization and maintainability.
- Reduced main.zig from ~1800 to 1220 lines
- Created monitor module with init() function for dependency injection
- Moved setupMonitors, RandR/Xinerama detection, and hotplug handlers
- Updated main.zig to use mon.* function calls
- No functional changes, build verified
fix(bar): bar war segfaulting when clicked
Some checks failed
CI / lint (pull_request) Failing after 3s
CI / build (pull_request) Failing after 2s
96267e4ef0
please investigate more, the fix looks ugly
romaintb force-pushed feat/RandR from 96267e4ef0
Some checks failed
CI / lint (pull_request) Failing after 3s
CI / build (pull_request) Failing after 2s
to f29a6a8349
Some checks failed
CI / lint (pull_request) Failing after 3s
CI / build (pull_request) Failing after 3s
2025年12月30日 11:44:16 +01:00
Compare
romaintb force-pushed feat/RandR from f29a6a8349
Some checks failed
CI / lint (pull_request) Failing after 3s
CI / build (pull_request) Failing after 3s
to ce16021d4f
Some checks failed
CI / lint (pull_request) Successful in 19s
CI / build (pull_request) Failing after 36s
2025年12月30日 12:04:08 +01:00
Compare
ci: add libxrandr-dev to ci environment
All checks were successful
CI / lint (pull_request) Successful in 19s
CI / build (pull_request) Successful in 1m6s
8b35621e25
romaintb force-pushed feat/RandR from 8b35621e25
All checks were successful
CI / lint (pull_request) Successful in 19s
CI / build (pull_request) Successful in 1m6s
to 266e0b7a53
Some checks failed
CI / lint (pull_request) Failing after 21s
CI / build (pull_request) Successful in 1m6s
CI / test (pull_request) Failing after 41s
2026年01月02日 19:22:08 +01:00
Compare
make: add a "run-xephyr" command to test easily
Some checks failed
CI / lint (pull_request) Failing after 20s
CI / build (pull_request) Successful in 1m6s
CI / test (pull_request) Failing after 42s
701558a865
feat(randr): preserve workspace assignment when removing a monitor
Some checks failed
CI / lint (pull_request) Failing after 20s
CI / build (pull_request) Successful in 1m9s
CI / test (pull_request) Failing after 41s
8ca2d7060d
Replace unsafe i16 casts with proper i32 handling throughout monitor
initialization. Screen dimensions from X11 can exceed i16 range (32767px),
which would cause panics. The Monitor struct already uses i32 internally,
so accepting i32 parameters in createMonitor() and updateMonitorGeometry()
aligns types and eliminates casting risk.
Increase maximum supported monitors from 16 to 64, with clear warning
messages when the limit is exceeded. This provides visible diagnostics
instead of silently dropping additional displays.
Remove restrictive validation that rejected large screen dimensions,
as this conflicts with the expanded i32 coordinate space.
Fix type mismatches in monitor geometry comparisons by removing i16
casts and comparing i32 values directly.
Changes:
- Change createMonitor/createMonitorRandR to accept i32 coordinates
- Change updateMonitorGeometry to accept i32 dimensions
- Count connected outputs before allocation for diagnostics
- Increase output buffer from 16 to 64 entries
- Add warning when output count exceeds maximum
- Remove unsafe integer casts at all call sites
- Fix i32/i16 type mismatch in geometry comparison logic
- Remove screen dimension range validation that was too restrictive
improve(setup): add error handling for X11 resource creation
Some checks failed
CI / lint (pull_request) Failing after 21s
CI / build (pull_request) Successful in 1m6s
CI / test (pull_request) Failing after 40s
59810feeca
Add proper error checking and diagnostic logging for critical X11 resource
initialization failures during setup:
- XftDrawCreate: Validate drawable creation and log display/visual/colormap
 state on failure. Return XftDrawCreationFailed error instead of panicking
 with a null pointer dereference.
- XCreateGC: Check graphics context creation and log error with context
 creation details. Return GraphicsContextCreationFailed error.
- XCreateFontCursor: Validate both bar cursor and root cursor creation.
 Return CursorCreationFailed error instead of proceeding with invalid
 cursor (0).
These changes prevent crashes from X11 initialization failures and provide
clear diagnostic information for debugging display/visual/colormap issues.
enhance: remove useless comments
Some checks failed
CI / lint (pull_request) Successful in 21s
CI / build (pull_request) Successful in 1m6s
CI / test (pull_request) Failing after 41s
3324a45469
ci: add missing libxrandr to ci env
Some checks failed
CI / lint (pull_request) Successful in 20s
CI / build (pull_request) Has been cancelled
CI / test (pull_request) Has been cancelled
70291afbc0
tools: indent=4 in more file types
All checks were successful
CI / lint (pull_request) Successful in 20s
CI / build (pull_request) Successful in 1m25s
CI / test (pull_request) Successful in 38s
495ece757b
fix(render): fill root window background on empty tags
All checks were successful
CI / lint (pull_request) Successful in 20s
CI / build (pull_request) Successful in 1m3s
CI / test (pull_request) Successful in 38s
91137759b4
Replace XClearWindow with XFillRectangle to properly clear the root
window background when switching to tags with no visible clients.
XClearWindow doesn't override existing background pixmaps from the
display manager, while XFillRectangle directly draws the background color.
Also initialize all monitors during setup() to fix background rendering
on the initial tag.
config: remove way too verbose comments
All checks were successful
CI / lint (pull_request) Successful in 21s
CI / build (pull_request) Successful in 1m2s
CI / test (pull_request) Successful in 38s
d5bd5967e3
WIP
All checks were successful
CI / lint (pull_request) Successful in 19s
CI / build (pull_request) Successful in 1m0s
CI / test (pull_request) Successful in 39s
b07920c1af
because working on a laptop that has the same resolution as the xephyr
window is a PITA
fix(randr): improve RandR event filtering and remove debug logging
All checks were successful
CI / lint (pull_request) Successful in 20s
CI / build (pull_request) Successful in 1m3s
CI / test (pull_request) Successful in 39s
3dcd80e281
Only dispatch RandR event handling when event type is actually a RandR
event. Remove debug logging and the overly broad catch-all handler that
would trigger monitor updates on unrecognized RandR subtypes.
Author
Owner
Copy link

unfinished, but let's move on

unfinished, but let's move on
romaintb deleted branch feat/RandR 2026年01月04日 12:09:25 +01:00
Sign in to join this conversation.
No reviewers
Milestone
Clear milestone
No items
No milestone
Projects
Clear projects
No items
No project
Assignees
Clear assignees
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
romaintb/rowm!1
Reference in a new issue
romaintb/rowm
No description provided.
Delete branch "feat/RandR"

Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?