- Extract cursor application logic into apply_cursor_by_index() helper
- Extract cleanup logic into perform_app_cleanup() helper
- Update select_cursor(), next_cursor(), and system tray handlers to use helpers
- Reduce ~55 lines of duplicated code while maintaining functionality
- Mark step 1 of code cleanup TODO as completed
Key improvements:
1. Add image caching to CursorInfo struct to avoid repeated disk reads and decoding
2. Implement Windows cursor handle caching to minimize GDI resource allocation
3. Update all code paths to use cached resources for better performance
4. Remove deprecated/unused functions for cleaner codebase
This change significantly reduces CPU usage and improves cursor switching performance.
- Implemented UpdateLayeredWindow for efficient cursor rendering
- Created HBITMAP once per cursor instead of recreating every frame
- Used premultiplied alpha for better performance
- Added proper resource cleanup
- Reduced CPU usage from one hot core to virtually zero
- Maintained low latency (≤1ms) for cursor updates
- Temporarily increased polling rate for smoother cursor movement (will be replaced with event-based updates)