aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorRobert Tari <robert@tari.in>2022-11-13 05:57:00 +0100
committerRobert Tari <robert@tari.in>2022-11-13 16:39:23 +0100
commit8452a9e54f63ef797f04e2030afc12ac6e553965 (patch)
treefaedfa51b42dfd56a054ab5f5e10d52504b9d5d2 /src
parent10505c6b870a03b4b9cbd3e719838280a20fc9da (diff)
downloadayatana-indicator-datetime-8452a9e54f63ef797f04e2030afc12ac6e553965.tar.gz
ayatana-indicator-datetime-8452a9e54f63ef797f04e2030afc12ac6e553965.tar.bz2
ayatana-indicator-datetime-8452a9e54f63ef797f04e2030afc12ac6e553965.zip
src/haptic.cpp: Fix data type sent to hfd-service
fixes https://github.com/AyatanaIndicators/ayatana-indicator-datetime/issues/96
Diffstat (limited to 'src')
-rw-r--r--src/haptic.cpp14
1 files changed, 4 insertions, 10 deletions
diff --git a/src/haptic.cpp b/src/haptic.cpp
index 370f0f9..2b0af4c 100644
--- a/src/haptic.cpp
+++ b/src/haptic.cpp
@@ -1,6 +1,6 @@
/*
* Copyright 2014 Canonical Ltd.
- * Copyright 2021 Robert Tari
+ * Copyright 2021-2022 Robert Tari
*
* This program is free software: you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 3, as published
@@ -43,7 +43,7 @@ public:
m_cancellable(g_cancellable_new()),
m_repeat(repeat)
{
- g_bus_get (G_BUS_TYPE_SESSION, m_cancellable, on_bus_ready, this);
+ g_bus_get (G_BUS_TYPE_SYSTEM, m_cancellable, on_bus_ready, this);
}
~Impl()
@@ -105,20 +105,14 @@ private:
void call_vibrate()
{
- GVariantBuilder builder;
- auto duration = g_variant_new_int32 (1000);
-
- g_variant_builder_init (&builder, G_VARIANT_TYPE_INT32);
- g_variant_builder_add_value (&builder, duration);
-
- auto vibrate_arg = g_variant_builder_end (&builder);
+ auto duration = g_variant_new ("(i)", 1000);
g_dbus_connection_call (m_bus,
BUS_HAPTIC_NAME,
BUS_HAPTIC_PATH,
BUS_HAPTIC_INTERFACE,
"vibrate",
- vibrate_arg,
+ duration,
nullptr,
G_DBUS_CALL_FLAGS_NONE,
-1,