diff --git a/src/controlCenter/widgets/backlight/backlight.vala b/src/controlCenter/widgets/backlight/backlight.vala index e25109e6..78301be1 100644 --- a/src/controlCenter/widgets/backlight/backlight.vala +++ b/src/controlCenter/widgets/backlight/backlight.vala @@ -52,7 +52,7 @@ namespace SwayNotificationCenter.Widgets { slider.set_draw_value (false); slider.set_round_digits (0); slider.value_changed.connect (() => { - this.client.set_brightness ((float) slider.get_value ()); + this.client.set_brightness.begin ((float) slider.get_value ()); slider.tooltip_text = ((int) slider.get_value ()).to_string (); }); diff --git a/src/controlCenter/widgets/backlight/backlightUtil.vala b/src/controlCenter/widgets/backlight/backlightUtil.vala index 1c1a84c4..f6fe7e47 100644 --- a/src/controlCenter/widgets/backlight/backlightUtil.vala +++ b/src/controlCenter/widgets/backlight/backlightUtil.vala @@ -3,7 +3,7 @@ namespace SwayNotificationCenter.Widgets { [DBus (name = "org.freedesktop.login1.Session")] interface Login1 : Object { - public abstract void set_brightness (string subsystem, + public abstract async void set_brightness (string subsystem, string name, uint32 brightness) throws GLib.Error; } @@ -77,14 +77,14 @@ namespace SwayNotificationCenter.Widgets { if (monitor != null) monitor.cancel (); } - public void set_brightness (float percent) { + public async void set_brightness (float percent) { this.close (); try { if (subsystem == "backlight") { int actual = calc_actual (percent); - login1.set_brightness (subsystem, device, actual); + login1.set_brightness.begin (subsystem, device, actual); } else { - login1.set_brightness (subsystem, device, (uint32) percent); + login1.set_brightness.begin (subsystem, device, (uint32) percent); } } catch (Error e) { error ("Error %s\n", e.message);