swaywm / swayidle

Idle management daemon for Wayland
MIT License
550 stars 50 forks source link

Fix message handling for PropertiesChanged signal #96

Closed nikobockerman closed 3 years ago

nikobockerman commented 3 years ago

PropertiesChanged signal dbus message contains an array of elements that contain two fields:

Previously the logic in iterating through these properties and the fields in them wasn't working properly:

These caused the attempt to enter the second changed property with sd_bus_message_enter_container to fail with -6. And if multiple properties had been changed, only first of them was actually checked.

This commit fixes the property type for sd_bus_message_skip call and adds the missing sd_bus_message_exit_container call. And it also adds checks for the return value for those two calls and for the sd_bus_message_enter_container call in order to ensure that failures in the message parsing cause warning messages to be logged.