linuxmint / cinnamon-spices-applets

Applets for the Cinnamon desktop
http://cinnamon-spices.linuxmint.com
GNU General Public License v2.0
611 stars 515 forks source link

redshift@marvel4u: Backlight not updated #1597

Open sphh opened 6 years ago

sphh commented 6 years ago
 * Applet version/Build date: 2017-12-05 20:55 UTC
 * Cinnamon version: Cinnamon 3.6.7
 * Distribution: Linux Mint 18.3 Cinnamon 64-bit
 * Snippet or attachment of ~/.cinnamon/glass.log: `info t=2018-01-09T21:26:43.142Z Error getting Cinnamon backlight power settings true,,Error: GDBus.Error:org.freedesktop.DBus.Error.ServiceUnknown:`

Notify author of applet @Marvel4U

Issue When adjusting the backlight with the slider provider, the backlight does not change.

Steps to reproduce

  1. Open the menu of redshift with the primary mouse button.
  2. Adjust the brightness slider to - say - 50%.

Expected behaviour I would expect that the brightness of the screen is adjusted.

Other information If I adjust the brightness level with the stock Power Manager applet (power@cinnamon.org), the backlight does get updated.

Bug #1598 might be related.

icarter09 commented 6 years ago

Cinnamon 3.8.8 Linux Mint 19 64bit Applet version: 2018-07-15 20:03 UTC

Confirmed that this issue still exists.

@sphh I'll start looking into this issue. Pretty sure it is closely related to issue #1598.

icarter09 commented 6 years ago

@sphh The PR containing this fix was merged. Can you verify if this fixed the problem?

sphh commented 6 years ago

Thanks @icarter09!

What is working:

What is not working:

Is it possible to syncronize the brightness value both ways?

icarter09 commented 6 years ago

@sphh I noticed the "what is not working" issue as well when I was debugging the PR for the initial problem. One issue I was running into with trying to apply that fix is that the system brightness would keep changing the value, regardless of what I initial set the redshift applet slider value. Best guess is that it had to be related to the hardware. Which in turn would keep readjusting the redshift slider and not remembering the value I had set it to.

I'll start looking into this again on another laptop and see if I can apply a fix for the "what is not working" issue. Thanks for the heads up!

sphh commented 4 years ago

I had a quick look and managed to synchronize the brightness levels between the power applet and the redshift applet's menu and configuration window, but unfortunately not in the tooltip. To get this working, I would have to call getSystemBrightness() repeatedly. But since this calls GLib.spawn_command_line_sync('gdbus ...'), I am afraid this would slow down the system.

Possible solutions:

  1. Find a function which is called before the tooltip is displayed (I do not know if this exists at all – I am not a Linux Mint programmer …).
  2. Remove the brightness level from the tooltip.
  3. Maybe use watcher on dbus?? (way above my abilities …).

What do you think? I have 2. working and can make a PR and I can implement 1., if I am told how this magic function is called.