forked from drath/libratbag
ratbagd: fix property update notifications
Don't send property updates for props that don't exist anymore. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
This commit is contained in:
committed by
Benjamin Tissoires
parent
4d00a815a4
commit
836922b133
@@ -87,17 +87,10 @@ static int ratbagd_button_set_button(sd_bus *bus,
|
||||
r = ratbag_button_set_button(button->lib_button, map);
|
||||
|
||||
if (r == 0) {
|
||||
sd_bus *bus = sd_bus_message_get_bus(m);
|
||||
sd_bus_emit_properties_changed(bus,
|
||||
button->path,
|
||||
RATBAGD_NAME_ROOT ".Button",
|
||||
"ButtonMapping",
|
||||
NULL);
|
||||
|
||||
sd_bus_emit_properties_changed(bus,
|
||||
button->path,
|
||||
RATBAGD_NAME_ROOT ".Button",
|
||||
"ActionType",
|
||||
"Mapping",
|
||||
NULL);
|
||||
}
|
||||
|
||||
@@ -146,17 +139,10 @@ static int ratbagd_button_set_special(sd_bus *bus,
|
||||
r = ratbag_button_set_special(button->lib_button, special);
|
||||
|
||||
if (r == 0) {
|
||||
sd_bus *bus = sd_bus_message_get_bus(m);
|
||||
sd_bus_emit_properties_changed(bus,
|
||||
button->path,
|
||||
RATBAGD_NAME_ROOT ".Button",
|
||||
"SpecialMapping",
|
||||
NULL);
|
||||
|
||||
sd_bus_emit_properties_changed(bus,
|
||||
button->path,
|
||||
RATBAGD_NAME_ROOT ".Button",
|
||||
"ActionType",
|
||||
"Mapping",
|
||||
NULL);
|
||||
}
|
||||
|
||||
@@ -261,17 +247,10 @@ static int ratbagd_button_set_macro(sd_bus *bus,
|
||||
}
|
||||
|
||||
if (r == 0) {
|
||||
sd_bus *bus = sd_bus_message_get_bus(m);
|
||||
sd_bus_emit_properties_changed(bus,
|
||||
button->path,
|
||||
RATBAGD_NAME_ROOT ".Button",
|
||||
"Macro",
|
||||
NULL);
|
||||
|
||||
sd_bus_emit_properties_changed(bus,
|
||||
button->path,
|
||||
RATBAGD_NAME_ROOT ".Button",
|
||||
"ActionType",
|
||||
"Mapping",
|
||||
NULL);
|
||||
}
|
||||
|
||||
|
||||
@@ -663,7 +663,7 @@ class RatbagdButton(_RatbagdDBus):
|
||||
_RatbagdDBus.__init__(self, "Button", object_path)
|
||||
|
||||
def _on_properties_changed(self, proxy, changed_props, invalidated_props):
|
||||
if "ActionType" in changed_props.keys():
|
||||
if "Mapping" in changed_props.keys():
|
||||
self.notify("action-type")
|
||||
|
||||
def _mapping(self):
|
||||
|
||||
Reference in New Issue
Block a user