-
Notifications
You must be signed in to change notification settings - Fork 1
Pixel city - advanced example #59
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
dskvr
wants to merge
64
commits into
master
Choose a base branch
from
feature/pixel-city-advanced
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Extract core functionality into separate modules as part of the effort to make hyprlax compatible with multiple compositors beyond Hyprland. This commit implements Phase 0 of the modularization plan: - Created modular directory structure (src/core/, src/include/) - Extracted easing functions to core/easing.c module - Extracted animation state management to core/animation.c - Extracted layer management to core/layer.c - Extracted configuration parsing to core/config.c - Created internal header files for module interfaces - Updated Makefile to support modular compilation - Maintained single-binary architecture with static linking Note: Temporarily renamed core module's layer_t to parallax_layer_t to avoid conflicts with IPC's layer_t. This will be unified in future phases. The binary still compiles and maintains existing functionality while laying the groundwork for compositor abstraction. 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <[email protected]>
Create a renderer abstraction layer to decouple rendering from the main application logic, enabling support for different rendering backends. This commit implements Phase 1 of the modularization plan: - Created renderer interface (include/renderer.h) with operations struct - Created shader management interface (include/shader.h) - Implemented OpenGL ES 2.0 renderer backend (renderer/gles2.c) - Implemented shader compilation and management (renderer/shader.c) - Added renderer factory for backend selection (renderer/renderer.c) - Updated Makefile to include renderer modules The renderer abstraction provides: - Texture management (create, destroy, bind) - Frame management (begin, end, present) - Shader program compilation and uniform management - Capability querying for feature detection - Support for blur effects and vsync control Note: The renderer is not yet integrated with the main application. This maintains compilation but doesn't change runtime behavior yet. 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <[email protected]>
Create a platform abstraction layer to decouple windowing system operations from the main application, enabling support for different platforms beyond Wayland. This commit implements Phase 2 of the modularization plan: - Created platform interface (include/platform.h) with operations struct - Implemented Wayland platform backend (platform/wayland.c) - Added X11 platform stub for future implementation (platform/x11.c) - Added platform factory with auto-detection (platform/platform.c) - Updated Makefile to include platform modules The platform abstraction provides: - Connection management (connect, disconnect, status) - Window management (create, destroy, show, hide) - Event handling (poll, wait, flush) - Native handle access for renderer integration - Platform capability detection (transparency, blur support) - Auto-detection of best available platform Platform detection uses environment variables: - Checks WAYLAND_DISPLAY and XDG_SESSION_TYPE for Wayland - Checks DISPLAY and XDG_SESSION_TYPE for X11 - Defaults to Wayland if nothing detected Note: The platform layer is not yet integrated with the main application. Shell-specific code will be moved to compositor adapters in Phase 3. 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <[email protected]>
Create compositor-specific adapters to abstract IPC and features across different Wayland compositors and X11 window managers. This commit implements Phase 3 of the modularization plan: - Created compositor interface (include/compositor.h) with operations struct - Implemented Hyprland adapter with IPC support (compositor/hyprland.c) - Added Sway adapter stub with i3-compatible IPC (compositor/sway.c) - Added generic Wayland adapter for wlr-layer-shell (compositor/generic_wayland.c) - Added X11/EWMH adapter stub for future support (compositor/x11_ewmh.c) - Added compositor factory with auto-detection (compositor/compositor.c) - Updated Makefile to include compositor modules The compositor abstraction provides: - Layer surface management (create, configure, destroy) - Workspace management (current, count, list) - Monitor management (current, list with properties) - IPC communication (connect, disconnect, send commands) - Event polling for workspace/monitor changes - Feature detection (blur, transparency, animations) - Compositor-specific optimizations Compositor detection order: 1. Hyprland (via HYPRLAND_INSTANCE_SIGNATURE) 2. Sway (via SWAYSOCK or XDG_CURRENT_DESKTOP) 3. X11/EWMH (via DISPLAY) 4. Generic Wayland (fallback for any wlr-layer-shell compositor) Note: Adapters are not yet integrated with the main application. The modular architecture now spans core, renderer, platform, and compositor layers. 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <[email protected]>
Wire together all modular components into a working application with runtime backend selection and dynamic compositor detection. This commit implements Phase 4 of the modularization plan: - Created main application context (include/hyprlax.h) - Implemented integration module (hyprlax_main.c) tying all modules together - Added simple entry point (main.c) using the modular system - Updated Makefile to support both legacy and modular builds - Added command-line backend selection options: * --renderer <backend>: Choose renderer (gles2, auto) * --platform <backend>: Choose platform (wayland, x11, auto) * --compositor <backend>: Choose compositor (hyprland, sway, generic, auto) The integration provides: - Proper initialization chain (platform → compositor → window → renderer) - Unified command-line argument parsing - Backend auto-detection with manual override - Event handling from both platform and compositor layers - Animation updates using core modules - Clean shutdown sequence Key improvements: - Binary size reduced from 217KB to 55KB (75% smaller!) - Modular architecture allows easy addition of new backends - Runtime selection enables single binary for all environments - Maintains backward compatibility through USE_LEGACY=1 make flag The application now supports: - Multiple compositors: Hyprland, Sway, generic Wayland, X11/EWMH (stub) - Multiple platforms: Wayland, X11 (stub) - Multiple renderers: OpenGL ES 2.0 (more can be added) Usage: ./hyprlax [OPTIONS] [--layer <image:shift:opacity:blur>...] ./hyprlax --compositor sway --debug ./hyprlax --platform x11 --renderer gl3 # Future support 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <[email protected]>
Co-authored-by: Copilot <[email protected]>
…rm (no longer just a stub)
Add example parallax configurations for testing multi-monitor support: - examples/multi/: Mountain scene with multiple layers - examples/space/: Space scene with 8 parallax layers 🤖 Generated with Claude Code Co-Authored-By: Claude <[email protected]>
…logies, multi-monitors onm wayland should work
…ure flags for custom builds
The hyprlax-ctl standalone binary is no longer built in the refactor. Control functionality is now integrated into the main hyprlax binary.
Co-authored-by: sandwich <[email protected]>
* implement niri parallax correctly * finish and correfct delta calculations * fix lagging state bug caused by multi-state tracking * remove all state tracking from Niri compositor adapter, fix bugs in core monitor.c * fix tests * appease linter --------- Co-authored-by: sandwich <[email protected]>
* Performance optimization: Implement smart rendering to fix 100% GPU usage - Add animation state tracking to only render when needed - Implement proper frame limiting with separate render and update timers - Skip rendering when no animations are active (idle state) - Increase sleep time to 100ms when idle (10 FPS polling) - Only update animations when they're actually active - Add needs_render flag for events that require re-rendering - Properly separate frame timing from render timing This should dramatically reduce GPU usage when the wallpaper is static. * Further GPU optimization: Disable VSync by default and increase idle polling interval - VSync now defaults to off to prevent GPU blocking when idle - Made VSync configurable via command line (--vsync) and config file - Increased idle polling interval from 100ms to 500ms (2 FPS when idle) - GPU should no longer block on eglSwapBuffers when idle - This should significantly reduce GPU power consumption when static The VSync blocking was causing the GPU to stay active even when no frames were being rendered. With VSync off by default and longer idle sleep times, the GPU can properly enter low power states. * Critical fix: GPU now properly returns to idle after animations complete The issue was that after animations completed, the render loop would get stuck in an infinite rendering state due to incorrect flag management. Problems fixed: 1. needs_render flag was not being properly cleared after rendering 2. Animation completion was checked at the wrong time in the loop 3. The final frame of animation wasn't guaranteed to be rendered Changes: - Clear needs_render flag after each render (it gets re-set if needed) - Re-check animation state AFTER updating animations, not just before - Ensure one final frame is rendered when animations complete - Properly update animation state flags for next iteration This fixes the bug where GPU would stay at 140W+ and P2 state after workspace changes, instead of returning to 32W and P8 idle state. * Fix sleep timing bug that prevented proper idle after animations The issue was in the sleep time calculation. After animations completed, we were still calculating sleep_time based on last_render_time + frame_time, but time_since_render kept growing, making sleep_time negative or very small. This prevented proper sleeping and kept the GPU active. Fix: - Only calculate frame-based sleep timing when actively rendering - When idle, use a fixed 500ms sleep time directly - This ensures we actually sleep when idle, allowing GPU to power down * Fix FPS being capped at 30 during animations The issue was that needs_render was only set once per loop iteration, causing unnecessary delays between frames during animations. Fix: - Set needs_render = true immediately when animations are active - This ensures we render as soon as frame_time has elapsed - Simplified the render flag logic to avoid double-checking Now animations should run at the configured FPS (60/144) instead of 30. * CRITICAL FIX: Animations were running forever due to unit mismatch The monitor animation duration was being multiplied by 1000 (converting to milliseconds) but compared against elapsed time in seconds. This meant a 4 second animation would take 4000 seconds (over an hour) to complete! This caused: - Animations to run forever at 60 FPS - GPU stuck at 350W+ power consumption - GPU utilization at 65-67% continuously Fixed by keeping both elapsed time and duration in seconds. * Fix additional animation timing bugs - Use get_time() directly instead of ctx->last_frame_time for animation start - Remove another instance of * 1000.0 ms conversion bug - Animations now properly use current time for calculations However, there's still an issue with animations not fully stopping or restarting after completion. * SUCCESS: All performance issues fixed! Animations now properly complete and GPU returns to idle power. Test results: - Baseline (no hyprlax): 42W - Hyprlax idle: 42W - During animation: 350W (expected for 4K rendering) - Post-animation: Returns to 30-33W within 4 seconds Key fixes applied: 1. Smart rendering - only render when needed 2. Fixed animation duration bugs (ms vs seconds) 3. Proper idle detection and sleep timing 4. VSync off by default to prevent GPU blocking 5. Correct time calculations using get_time() The GPU now properly idles at low power when no animations are active! * Additional performance optimizations - Increased idle sleep time from 500ms to 1s (reduces polling overhead) - Added glFinish() before buffer swap to ensure GPU work completes - This may help with frame timing consistency These changes further reduce CPU/GPU usage when idle while maintaining smooth animations when active. * Add configurable idle polling frequency - Added --idle-poll-rate command line option with validation - Added idle_poll_rate config file option - Default value is 2.0 Hz (500ms) for balanced responsiveness - Valid range is 0.1 to 10.0 Hz with automatic fallback to default - Shows the rate in debug output as both Hz and milliseconds - Replaces hardcoded 1-second idle sleep with configurable rate 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <[email protected]> * low hanging fruit * glex optimizations * further trims * add benchmark scripts + further optimizations * add frame callbacks * add per-monitor frame profiling * add separable blur and blur downscaling * add diagnostics * update becnhmark scripts to be configurable --------- Co-authored-by: sandwich <[email protected]> Co-authored-by: Claude <[email protected]>
* feat: mouse-parallax modes + renderer/Wayland hardening (clean rebase onto feature/refactor) * Add River/Niri support. Add smoke tests and reduce verbosity of debug log, add trace level. * last commit broke everything, commit stash * track down regression and fix (cause was mixture of enums and ints on log level) --------- Co-authored-by: sandwich <[email protected]>
* docs: restructure documentation to hierarchical layout - Create hierarchical directory structure for better organization - Split large documents into focused, manageable files - Add comprehensive reference documentation for CLI, IPC, and environment vars - Create dedicated sections for different audiences (users, developers) - Add new guides for cursor tracking and performance optimization - Improve configuration documentation with TOML reference and migration guide - Separate build, architecture, contributing, and testing documentation - Add quick-start guide and compatibility matrix for new users The new structure provides: - Easier navigation with clear categorization - Faster reference lookups with dedicated reference section - Better separation between user and developer documentation - More maintainable, focused documents - Progressive disclosure (simple -> detailed) * fix accuracy of docs --------- Co-authored-by: sandwich <[email protected]>
* docs: restructure documentation to hierarchical layout - Create hierarchical directory structure for better organization - Split large documents into focused, manageable files - Add comprehensive reference documentation for CLI, IPC, and environment vars - Create dedicated sections for different audiences (users, developers) - Add new guides for cursor tracking and performance optimization - Improve configuration documentation with TOML reference and migration guide - Separate build, architecture, contributing, and testing documentation - Add quick-start guide and compatibility matrix for new users The new structure provides: - Easier navigation with clear categorization - Faster reference lookups with dedicated reference section - Better separation between user and developer documentation - More maintainable, focused documents - Progressive disclosure (simple -> detailed) * fix accuracy of docs * complete phase 1 ipc refactor * IPC refactor continued * fix logging inconsistencies and auto assign z-index * refresh image data in layer * pre gpu fixes * found it --------- Co-authored-by: sandwich <[email protected]>
* add --only-image flag to py script * functional clock * add global json flag for json output of hyprlax ctl returns and fix time script --------- Co-authored-by: sandwich <[email protected]>
* feat(aur): add hyprlax-git PKGBUILD and AUR docs * docs(aur): add AUR install instructions; add Arch PKGBUILD for hyprlax-git * appease linter * ci(aur): add release-only AUR publish workflow; add stable PKGBUILD template --------- Co-authored-by: sandwich <[email protected]>
* add --only-image flag to py script * functional clock * add global json flag for json output of hyprlax ctl returns and fix time script * First pass on canonical config keys * map ENV keys and update documentation * improve usability with better outputs, help menus and documentation. * improve usability with better outputs, help menus and documentation. * update cherry-blossom example with new keys --------- Co-authored-by: sandwich <[email protected]> Co-authored-by: Claude <[email protected]>
Co-authored-by: sandwich <[email protected]>
|
🤖 Build Artifact Available A build artifact for 📦 Download from Actions Run #63 This artifact will be available for 14 days. The build includes:
Installation instructions# Download and extract the artifact
tar -xzf hyprlax-*.tar.gz
# Make executable and run
chmod +x hyprlax
./hyprlax --helpBuilt from PR #59 • Run #63 • View Workflow |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
Type of Change
Related Issue
Fixes #(issue number)
Changes Made
Testing
make testpasses all testsmake memcheckshows no memory leaksmake lintpasses without errorsChecklist
Code Quality
Testing
Documentation
Focus
Screenshots
Additional Notes