davidhi7 / ddcci-plasmoid

KDE Plasma widget to adjust the brightness of multiple external monitors
MIT License
390 stars 11 forks source link

Refactor slider code, fix mouse wheel for kf5. #72

Open CatEricka opened 4 months ago

CatEricka commented 4 months ago

Alternative to #63 .

  1. Use signal onValueChanged instead of onMoved to simplify the code.
  2. Implement the scroll handling ourselves. This is a backport of https://invent.kde.org/plasma/libplasma/-/commit/aea3d4b131070d8388edf84c9c2a32f7b4203617

As for KDE Plasma 6, it needs to be tested. I don't have any machine with KDE Plasma 6 for now.

Related bug: https://bugreports.qt.io/browse/QTBUG-93081

CatEricka commented 4 months ago

Sorry for the late reply, I will modify the code you mentioned as soon as possible and test it.

CatEricka commented 4 months ago

I'm not convinced this is no longer needed. IIRC the main reason to implement it was that if you drag the slider and new polling data is received, the slider is reset to its original value.

After thinking about it for a weekend, I thought of a way to fix this issue: let the backend return messages with timestamps, and let plasmoid ignore the old dirty data.

Edited:

This may be too complex.