aboutsummaryrefslogtreecommitdiff
path: root/src/haptic.cpp
diff options
context:
space:
mode:
authorCharles Kerr <charles.kerr@canonical.com>2014-07-30 16:34:02 -0500
committerCharles Kerr <charles.kerr@canonical.com>2014-07-30 16:34:02 -0500
commite4b663ebd5be78bd9fb9802e54b050a7b2a984bf (patch)
tree10ed5ee7c580848a61a32cd9c8637a3ee6337cc3 /src/haptic.cpp
parent559d185dd7d51e56fbd8246970ef520d3edd18ae (diff)
downloadayatana-indicator-datetime-e4b663ebd5be78bd9fb9802e54b050a7b2a984bf.tar.gz
ayatana-indicator-datetime-e4b663ebd5be78bd9fb9802e54b050a7b2a984bf.tar.bz2
ayatana-indicator-datetime-e4b663ebd5be78bd9fb9802e54b050a7b2a984bf.zip
in haptic.cpp, make sure to enable the sensor by calling ua_sensors_haptic_enable()
Diffstat (limited to 'src/haptic.cpp')
-rw-r--r--src/haptic.cpp14
1 files changed, 11 insertions, 3 deletions
diff --git a/src/haptic.cpp b/src/haptic.cpp
index c5a20df..663e919 100644
--- a/src/haptic.cpp
+++ b/src/haptic.cpp
@@ -40,13 +40,21 @@ public:
m_sensor(ua_sensors_haptic_new())
{
if (m_sensor == nullptr)
+ {
g_warning ("Haptic device unavailable");
+ }
else
- m_tag = g_timeout_add_seconds (1, on_timeout, this);
+ {
+ ua_sensors_haptic_enable(m_sensor);
+ m_tag = g_timeout_add_seconds (2, on_timeout, this);
+ }
}
~Impl()
{
+ if (m_sensor != nullptr)
+ ua_sensors_haptic_enable(m_sensor);
+
if (m_tag)
g_source_remove(m_tag);
}
@@ -61,8 +69,8 @@ private:
void vibrate_now()
{
- const uint32_t msec = 1500;
- ua_sensors_haptic_vibrate_once (m_sensor, msec);
+ const uint32_t msec = 1000;
+ (void) ua_sensors_haptic_vibrate_once (m_sensor, msec);
}
const Mode m_mode;