Skip to content

Upgrade to Avalonia 12 and fix keyboard/fan control state handling#195

Open
RezaT4795 wants to merge 3 commits into
PXDiv:mainfrom
RezaT4795:main
Open

Upgrade to Avalonia 12 and fix keyboard/fan control state handling#195
RezaT4795 wants to merge 3 commits into
PXDiv:mainfrom
RezaT4795:main

Conversation

@RezaT4795
Copy link
Copy Markdown

Summary

This PR upgrades the GUI project to Avalonia 12 and fixes several state-handling issues in the Linux GUI.

The main focus is making the Keyboard Lighting and Power & Performance sections behave consistently across app relaunches, while also hardening daemon communication against rapid repeated UI actions.

Changes

Keyboard Lighting

  • Fixed Zone Color Control resetting to the default blue/orange/green/yellow colors on every launch.
  • Added GUI-side persistence for the user's last selected four-zone keyboard color preset.
  • Fixed Static Mode applying the four Zone Color Control colors instead of the selected single effect color.
  • Preserved the user's Zone Color Control colors when Static Mode is applied.
  • Added separate GUI-side persistence for Lighting Effect settings.
  • Fixed Static Mode color being reset after relaunch.
  • Fixed Left-to-right / Right-to-left direction selection not being restored after relaunch.
  • Explicitly sync both direction radio buttons instead of relying on one radio button to imply the other.

Power & Performance

  • Fixed Max Fan Speed being restored as Manual mode with CPU/GPU set to 100% after relaunch.
  • The GUI now distinguishes fan modes correctly:
    • 0 / 0 = Auto
    • 100 / 100 = Max
    • anything else = Manual

Daemon communication

  • Fixed a crash that could happen when rapidly sending fan-speed commands.
  • Serialized daemon socket commands so multiple JSON responses cannot be mixed together and parsed as one invalid JSON document.
  • Added UI-side protection against rapid duplicate manual fan-speed submissions.
  • Added safer exception handling so daemon communication errors do not crash the Avalonia UI.

Refactoring / cleanup

  • Cleaned up the affected UI state synchronization code.
  • Reduced duplicated preset read/write logic.
  • Centralized keyboard color, direction, and preset handling helpers.
  • Kept the existing behavior and project structure intact.

Testing

Tested manually on a PHN16-72 with Linux/Slackware-current.

Verified:

  • Custom four-zone keyboard colors persist across DAMX-GUI relaunches.
  • Static Mode applies one selected color correctly.
  • Static Mode no longer overwrites the saved Zone Color Control preset.
  • Static Mode color persists across relaunches.
  • Lighting direction selection persists across relaunches.
  • Max Fan Speed is restored as Max after relaunch, not Manual.
  • Rapid manual fan-speed changes no longer crash the GUI.

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.

1 participant