mirror of
https://github.com/dguglielmi/sunny-overlay.git
synced 2025-12-06 11:42:40 +01:00
32 lines
1.2 KiB
Diff
32 lines
1.2 KiB
Diff
From a5d52ff49777676eab5e75ebd84990ff43922f86 Mon Sep 17 00:00:00 2001
|
|
From: Thomas Hindoe Paaboel Andersen <phomes@gmail.com>
|
|
Date: Tue, 19 Sep 2017 22:49:10 +0200
|
|
Subject: [PATCH 15/30] ResolutionsPage: fix bad toggles of report rate
|
|
|
|
The radiobuttons for changing the report rate fires the 'toggled'
|
|
signal both when being set and unset. This caused the report rate
|
|
to flip when chaning the active profile.
|
|
|
|
Follow the advice in the GTK documentation and check if the button
|
|
is active in the callback function.
|
|
---
|
|
piper/resolutionspage.py | 2 ++
|
|
1 file changed, 2 insertions(+)
|
|
|
|
diff --git a/piper/resolutionspage.py b/piper/resolutionspage.py
|
|
index 0c52c44..0e0d1f6 100644
|
|
--- a/piper/resolutionspage.py
|
|
+++ b/piper/resolutionspage.py
|
|
@@ -99,6 +99,8 @@ class ResolutionsPage(Gtk.Box):
|
|
# TODO: currently no devices expose CAP_INDIVIDUAL_REPORT_RATE, but if
|
|
# so then we should check for this here and set it only on the relevant
|
|
# resolution.
|
|
+ if not button.get_active():
|
|
+ return
|
|
profile = self._device.active_profile
|
|
for resolution in profile.resolutions:
|
|
resolution.report_rate = rate
|
|
--
|
|
2.16.1
|
|
|