Bug 268453 - external brightness changes not caught by solid
Summary: external brightness changes not caught by solid
Status: RESOLVED DUPLICATE of bug 265357
Alias: None
Product: solid
Classification: Frameworks and Libraries
Component: powermanagement (show other bugs)
Version: unspecified
Platform: Unlisted Binaries Linux
: NOR normal
Target Milestone: ---
Assignee: Dario Freddi
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-03-14 12:33 UTC by Matěj Laitl
Modified: 2011-05-30 11:28 UTC (History)
2 users (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Matěj Laitl 2011-03-14 12:33:40 UTC
Version:           unspecified (using KDE 4.6.1) 
OS:                Linux

When I change display brightness using laptop buttons, the brightness level is not updated in Battery Monitor applet and no OSD is shown.

My hardware is able to report brightness - `xrandr --prop` and `xbacklight` report correct numbers. Setting brightness works okay. This worked in kde 4.5 with HAL, so this seems to be HAL removal regression.

Reproducible: Always

Steps to Reproduce:
1. Uninstall HAL
2. Change brigtness using hardware buttons

Actual Results:  
Brightness is changed, but gui (Battery Monitor applet) is not updated

Expected Results:  
Brightness in gui is updated and OSD is shown
Comment 1 Matěj Laitl 2011-03-14 12:58:36 UTC
Hmm, after studying it more, it turns out that
`qdbus org.kde.Solid.PowerManagement /org/kde/Solid/PowerManagement org.kde.Solid.PowerManagement.brightness` also reports correct numbers.

However, if I run dbus-monitor, no brightnessChanged(int) signal can be found. (not sure if I listen to it correctly though).

My system acts like this: upon brightness up/down button press, it changes brightness in hardware and also issues XF86MonBrightnessUp/Down key that can be mapped as kded global shortcut - with no effect.
Comment 2 Lamarque V. Souza 2011-03-15 00:05:42 UTC
Do you have upower installed?
Comment 3 Matěj Laitl 2011-03-15 14:53:59 UTC
Yes, I have working upower 0.9.8 (mounting etc. works). However, upower (in its current state) is not supposed to handle display brightness at all: http://lists.freedesktop.org/archives/devkit-devel/2011-January/001011.html (post by upower developer)
Comment 4 Matěj Laitl 2011-03-15 14:56:37 UTC
(Hmmm, the mount example was actually silly, but that doesn't really matter)
Comment 5 Lamarque V. Souza 2011-03-15 18:12:18 UTC
upower does not control mounting disks, that is udisks responsability. I asked about upower because it is the powerdevil's upower backend that launch the brightness slider. Though powerdevil's upower backend uses xorg's xrandr API to change brigthness instead of using upower itself, so the problem described in http://lists.freedesktop.org/archives/devkit-devel/2011-January/001011.html should not affect powerdevil. But without upower installed powerdevil's backend would not be loaded.

If you use the slider in powerdevil's plasmoid, does the screen brightness change?

Have you tried to change the brightness keys in systemsettings -> Shortcut and Gestures ->Global Keyboard shortcuts -> change the component to "KDE services" -> Increase brightness and Decrease brightness. Does changing the shortcut works?
Comment 6 Matěj Laitl 2011-03-16 15:19:08 UTC
(In reply to comment #5)
> upower does not control mounting disks, that is udisks responsability. I asked
> about upower because it is the powerdevil's upower backend that launch the
> brightness slider. Though powerdevil's upower backend uses xorg's xrandr API to
> change brigthness instead of using upower itself, so the problem described in
> http://lists.freedesktop.org/archives/devkit-devel/2011-January/001011.html
> should not affect powerdevil. But without upower installed powerdevil's backend
> would not be loaded.

It works - battery level is reported etc.

> If you use the slider in powerdevil's plasmoid, does the screen brightness
> change?

Yes, it changes and even emits the brightnessChanged signal on DBUS.

> Have you tried to change the brightness keys in systemsettings -> Shortcut and
> Gestures ->Global Keyboard shortcuts -> change the component to "KDE services"
> -> Increase brightness and Decrease brightness. Does changing the shortcut
> works?

I do only have "KDE Daemon" component that has "Increase/Decrease Screen Brightness". Changing the shotcut works - if I try to assign custom shortcut for that action, my hardware/x11 emits the "Monitor Brightness Up/Down" key that happens to be the default one.

How does powerdevil detect external brightness changes - is xrandr able to notify it or it has to listen to input events?
Comment 7 Lamarque V. Souza 2011-03-16 17:27:01 UTC
(In reply to comment #6)
> I do only have "KDE Daemon" component that has "Increase/Decrease Screen
> Brightness". Changing the shotcut works - if I try to assign custom shortcut
> for that action, my hardware/x11 emits the "Monitor Brightness Up/Down" key
> that happens to be the default one.
> 
> How does powerdevil detect external brightness changes - is xrandr able to
> notify it or it has to listen to input events?

I am not sure how exactly it works. I think firstly powerdevil registers some global actions, key presses on the increase/decrease brightness keys are among them. Then kded (KDE Daemon) listen to those actions and triggers Qt's signals, powerdevil receives the signals and use xrandr API to do the job.

In your case it seems kded is not recognising the default keys as increase/decrease keys.
Comment 8 Matěj Laitl 2011-03-16 18:21:59 UTC
> In your case it seems kded is not recognising the default keys as
> increase/decrease keys.

I think this is not the case. If I monitor dbus session bus with `dbus-monitor type=signal` I get the following when I press brightness down button:

signal sender=:1.12 -> dest=(null destination) serial=2032 path=/component/kded; interface=org.kde.kglobalaccel.Component; member=globalShortcutPressed
   string "kded"
   string "Decrease Screen Brightness"
   int64 15544841
Comment 9 FabioLima 2011-05-11 19:41:05 UTC
I am having exactly the same problem. Using eeepc, gentoo. but if I press randomly the BrignessUp and BrignessDown keys, sometimes the OSD dialog appears, and while it is on, the brightness bar correctly display current brightness.
Comment 10 Matěj Laitl 2011-05-29 22:24:21 UTC
Oh, this bug is already here, so just resolve this as duplicate. Fabio, you may what to track bug 265357 instead.

*** This bug has been marked as a duplicate of bug 265357 ***
Comment 11 FabioLima 2011-05-30 11:28:11 UTC
Thanks, Matěj