Description
Critical foundational work for robust per-monitor configurations. Note: hyprlax already implements a shared EGL context with per-monitor Wayland layer surfaces. This issue now focuses on completing hotplug removal/cleanup, per-output frame scheduling, and a shared texture cache.
Current Status
- Phase 0 (zero-config multi-monitor) completed ✅
- Phase 0.5 (workspace abstraction) completed ✅
Currently using single surface architecture
Need refactoring to properly support multiple monitors
- Multi-surface + shared EGL context implemented; remaining foundations: output removal + cleanup, per-monitor frame scheduling, texture cache, CLI monitor filters
Core Tasks
Monitor Data Structure Refactoring
Wayland Platform Multi-Surface
Shared EGL Context
Per-Output Frame Scheduling
Why This Is Needed
Without this foundation, we cannot:
- Properly render to multiple monitors independently under hotplug and mixed-refresh
- Handle different refresh rates per monitor accurately
- Support per-monitor configurations and monitor filters
- Implement monitor groups or spanning wallpapers safely
Success Criteria
- Multiple surfaces rendering simultaneously
- No performance regression (maintain 144 FPS)
- Proper cleanup on exit and on monitor removal
- No memory leaks
- Handle monitor hotplug correctly (add and remove)
- Mixed refresh rates render correctly per output
References
Note
This is infrastructure work that enables the user-facing features described in issues #17–#19.
Description
Critical foundational work for robust per-monitor configurations. Note: hyprlax already implements a shared EGL context with per-monitor Wayland layer surfaces. This issue now focuses on completing hotplug removal/cleanup, per-output frame scheduling, and a shared texture cache.
Current Status
Currently using single surface architectureNeed refactoring to properly support multiple monitorsCore Tasks
Monitor Data Structure Refactoring
monitor_instance_tstructure with per-monitor statehyprlax_context_tto use monitor list--monitor,--disable-monitor)Wayland Platform Multi-Surface
wl_outputlistener for monitor hotplug (addition) eventswl_surface,zwlr_layer_surface_v1,wl_egl_window,EGLSurface; remove from list)registry_globalto track outputsregistry_global_removeto handle output removal and teardownUSE_LEGACYShared EGL Context
Createegl_shared_tstructure for shared contextgles2_create_monitor_surface,gles2_make_current)eglMakeCurrentmanagement for surface switchingPer-Output Frame Scheduling
wl_surface_frameper monitor)monitor_should_render, callbacks, and per-monitor cadence)last_frame_timeon frame done; respecttarget_frame_time)Why This Is Needed
Without this foundation, we cannot:
Success Criteria
References
Note
This is infrastructure work that enables the user-facing features described in issues #17–#19.