Skip to content

Conversation

@kkofler
Copy link

@kkofler kkofler commented Jul 12, 2025

src/qml/quicksettings/QuickSettings.qml
(rootitem.brightnessToggle.onUnchecked): Set displaySettings.brightness to 10 instead of 0, matching the minimum value in the asteroid-settings app. Setting this to 0 leads to an unusable completely black screen on some hardware, e.g., LG G Watch R (lenok).

Fixes #182.

src/qml/quicksettings/QuickSettings.qml
(rootitem.brightnessToggle.onUnchecked): Set displaySettings.brightness
to 10 instead of 0, matching the minimum value in the asteroid-settings
app. Setting this to 0 leads to an unusable completely black screen on
some hardware, e.g., LG G Watch R (lenok).

Fixes AsteroidOS#182.

Signed-off-by: Kevin Kofler <[email protected]>
@moWerk
Copy link
Member

moWerk commented Jul 27, 2025

Thanks a lot for spotting this and providing a fix!
The 0% Brightness does cause the described issues on watches that lack an ambient light sensor or have the feature switched off in settings. correct.
I will not merge this exact solution however, since the issue is going to be solved in the comprehensive rework of the QuickSettings and its renaming to QuickPanel ongoing and hopefully soon to be merged here:
#180

The brightness toggle will become rather sophisticated and exhibit a longpress function that increases and decreases the volume in 10% steps while keeping the toggle pressed. And its limited to a 10% to 100% range to wotk around the Ambient light sensor issue. The 10% minimum is also synced with the new cinemaMode toggle.
Its implemented in this commit:
174ed1a
Sorry for not making this more easily discoverable and getting back to your PR two weeks late.

@kkofler
Copy link
Author

kkofler commented Jul 27, 2025

I do not think the solution you merged is satisfying, unfortunately.

In the code you committed, a quick press of the brightness toggle still sets the brightness to 0:

onUnchecked: displaySettings.brightness = 0

leading to a completely dark screen where it is not obvious how to recover from it. So I think the change I propose here is still needed in the new code (and I can rebase it to it).

By the way, your onChecked method has some apparent leftover from earlier changes, because the if conditions are entirely redundant, it can be simplified to just onChecked: displaySettings.brightness = 100 as in the original code.

@FlorentRevest
Copy link
Member

It sounds to me like the solution to your problem is rather to change the mce config for your specific watch. Iirc, mce has some mapping between the 0-100 brightness setting and the actual number that gets written to the panel's sysfs entries and you could just remap what 0 means for your watch. On other watches, 0 doesn't turn it black.

@moWerk
Copy link
Member

moWerk commented Jul 27, 2025

@kkofler Thanks for pointing out my error! Great catch. As per commit message, my intention was to set all occurrences of minimum brightness to 10. And i missed the main one, nice.

My PR is not ready to merge yet since it needs some more reviews and eventual bugfix commits.
I would ask to correct that error in my own PR and add you as co-author if thats ok with you?

@FlorentRevest we are already working around the 0% brightness issue in the displayPage, but never touched the brightnessToggle for completeness. Afair, some watches have crashing MCE or the light sensor reporting wrong values. Anyway, afair its an issue we decided to work around proactively since the difference between 0 and 10 is barely noticable but the eventual issue of a fully black screen is a major problem.

@kkofler
Copy link
Author

kkofler commented Jul 27, 2025

See PR moWerk#1.

@MagneFire
Copy link
Member

@kkofler Thanks for pointing out my error! Great catch. As per commit message, my intention was to set all occurrences of minimum brightness to 10. And i missed the main one, nice.

My PR is not ready to merge yet since it needs some more reviews and eventual bugfix commits. I would ask to correct that error in my own PR and add you as co-author if thats ok with you?

@FlorentRevest we are already working around the 0% brightness issue in the displayPage, but never touched the brightnessToggle for completeness. Afair, some watches have crashing MCE or the light sensor reporting wrong values. Anyway, afair its an issue we decided to work around proactively since the difference between 0 and 10 is barely noticable but the eventual issue of a fully black screen is a major problem.

Have to agree with @FlorentRevest on this one. The solution to this issue is to provide a correct mce configuration for the watch that has this issue. Imo we should try to avoid hacks to Qt code that are really hardware related.
For some watches (most notably sturgeon and smelt) we provide a custom mce configuration that results in correct mapping of 0-100% brightness levels.

Given that these issues have been here for some time now I propose we could do the following:

  • Provide a new default mce configuration that just raises the minimum brightness for all watches.
    • Has the advantage that we don't have to test this on all watches. Obvious disadvantage is that the minimum brightness on properly functioning watches has also increased.
  • Provide a per watch bases solution
    • Not as trivial as it might seem, more time consuming to test per device (but definitely ideal)
  • Solve in Qt/QML code
    • Solves hardware/low-level issues in high-level application code, which is generally not a good idea.

In my opinion the best solution is the combination between the first two: Provide a new mce default and anyone can provide an ideal configuration for their watch.

Another idea would be to apply the Qt/QML solution for now. And solve it differently in the future. But the issue with this approach is that it probably will never be fixed.

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.

Turning off "sunny" (brightness) quick setting makes screen completely black on lenok

4 participants