Comment 2 for bug 1309706

Revision history for this message
Weston Bustraan (wbustraan) wrote :

I was able to fix it without commenting out the code.

In Docky.Services/Docky.Services/SystemService.cs, I changed:

[Interface(UPowerName)]
interface IUPower : org.freedesktop.DBus.Properties

to

[Interface("org.freedesktop.DBus.Properties")]
interface IUPower : org.freedesktop.DBus.Properties

I'm not a .NET programmer (Java), but I would hazard a guess that the proxy object that dbus-sharp is generating will only respond to the interface described by the Interface attribute. The 'Get' method is a part of org.freedesktop.DBus.Properties D-Bus interface, not org.freedesktop.UPower.

The other thing I did was to add a try/catch block around the code in HandleUPowerChanged() similar to the one in InitializeBattery(), so that even if the the D-Bus call fails, it doesn't crash all of Docky.