ErikReider / SwayNotificationCenter

A simple GTK based notification daemon for SwayWM
GNU General Public License v3.0
1.16k stars 59 forks source link

[Bug] Backlight & KB brightness sliders dimmed each time open control center #245

Closed MrPenguin07 closed 1 year ago

MrPenguin07 commented 1 year ago

Describe the bug

With the backlight and KB brightness modules active, each time I open the control center (either with sway binding/in terminal with 'swaync-client -t -sw', or via waybar tray icon using the provided setup config), my KB / screen brightness is decreased by ~20% until the brightness levels are at 0%.

Actually if I have the backlight/KB modules ordered as;

  1. backlight, 2. KB, The bottom module (KB) will be reduced 20% each panel open until it's at zero, and only when it is at 0 will the next panel open reduce backlight brightness until it also is reduced to zero.

So effictively if I turn my KB and backlight to 100% brightness, then open/close the panel maybe 8-10 times in quick succession both my KB and backlight are off.

To Reproduce Steps to reproduce the behavior:

  1. Enable backlight/KB modules
  2. Open panel with keybinding or waybar icon
  3. Observe brightness sliders being turned down

Expected behavior Brightness levels to not be affected by panel being opened.

Screenshots First time opened panel: image

Immediately close it, then reopen: image

3rd open, notice the KB brightness became zero, so now it moves onto dimming the backlight... image

Desktop (please complete the following information):

config

"widgets": [ "label", "menubar", "buttons-grid", "backlight", "backlight#KB", "volume", "mpris", "title", "dnd", "notifications" ], "widget-config": { "title": { "text": "Notifications", "clear-all-button": true, "button-text": "Clear All" }, "backlight": { "label": "", "device": "acpi_video0", "min": 10 }, "backlight#KB": { "label": "", "device": "system76_acpi::kbd_backlight", "subsystem": "leds" }, "volume": { "label": "" },

ErikReider commented 1 year ago

Have you tried the latest changes in master?

MrPenguin07 commented 1 year ago

Have you tried the latest changes in master?

I haven't no, mostly due to there not being a -9999 gentoo ebuild. I see there's just 14 commits from 0.8.0 to master, any in particular you think address this? If so i'll just build it locally, or perhaps consider making a 9999.

Regards

ErikReider commented 1 year ago

I was thinking of #236

You can always just build and run it locally, not a lot of files to compile :)

MrPenguin07 commented 1 year ago

I was thinking of #236

You can always just build and run it locally, not a lot of files to compile :)

Update;

Have compiled master. The screen brightness is FIXED. The KB brightness however is not. Considering they both use the same widget, I can't see anything in the code to replicate #236 for so I can only report my findings here.

ErikReider commented 1 year ago

Strange... Could you send your KB brightness before and after opening the Control Center and the max value? Those values can be found here: /sys/class/leds/your_input_device/brightness and /sys/class/leds/your_input_device/max_brightness

MrPenguin07 commented 1 year ago

Strange... Could you send your KB brightness before and after opening the Control Center and the max value? Those values can be found here: /sys/class/leds/your_input_device/brightness and /sys/class/leds/your_input_device/max_brightness

Sure thing, as requested. 255 = max brightness.

brightness

JannisPetschenka commented 1 year ago

Just realized, that I have a similar strange behavior (never really used the KB brightness before) 😁 I can look into it over the weekend @ErikReider

JannisPetschenka commented 1 year ago

248 should fix it :)

MrPenguin07 commented 1 year ago

Confirming these 2 commits fix the issue.

Regards