aboutsummaryrefslogtreecommitdiff
path: root/src/awake.cpp
diff options
context:
space:
mode:
authorArthur Mello <arthur.mello@canonical.com>2016-07-05 16:42:21 -0300
committerRobert Tari <robert@tari.in>2021-07-08 03:08:15 +0200
commit2425f66e98b3b1d201c5d2388611edb37be0ee7e (patch)
tree56b74a4ffefe6b6f72de6922b2e677b932fefc8b /src/awake.cpp
parentb4654663d3973bcbfd3a75c33d78220e55852fc7 (diff)
downloadayatana-indicator-datetime-2425f66e98b3b1d201c5d2388611edb37be0ee7e.tar.gz
ayatana-indicator-datetime-2425f66e98b3b1d201c5d2388611edb37be0ee7e.tar.bz2
ayatana-indicator-datetime-2425f66e98b3b1d201c5d2388611edb37be0ee7e.zip
Remove call to keepDisplayOn since that now is handled by Unity during Notifications
Diffstat (limited to 'src/awake.cpp')
-rw-r--r--src/awake.cpp107
1 files changed, 0 insertions, 107 deletions
diff --git a/src/awake.cpp b/src/awake.cpp
index dd41c35..dc49436 100644
--- a/src/awake.cpp
+++ b/src/awake.cpp
@@ -48,16 +48,9 @@ public:
g_cancellable_cancel (m_cancellable);
g_object_unref (m_cancellable);
- if (m_display_on_timer)
- {
- g_source_remove (m_display_on_timer);
- m_display_on_timer = 0;
- }
-
if (m_system_bus != nullptr)
{
unforce_awake ();
- remove_display_on_request ();
g_object_unref (m_system_bus);
}
}
@@ -101,20 +94,6 @@ private:
on_force_awake_response,
self);
- // ask unity-system-compositor to turn on the screen
- g_dbus_connection_call (system_bus,
- BUS_SCREEN_NAME,
- BUS_SCREEN_PATH,
- BUS_SCREEN_INTERFACE,
- "keepDisplayOn",
- nullptr,
- G_VARIANT_TYPE("(i)"),
- G_DBUS_CALL_FLAGS_NONE,
- -1,
- self->m_cancellable,
- on_keep_display_on_response,
- self);
-
g_object_unref (system_bus);
}
}
@@ -152,54 +131,6 @@ private:
}
}
- static void on_keep_display_on_response (GObject * connection,
- GAsyncResult * res,
- gpointer gself)
- {
- GError * error;
- GVariant * args;
-
- error = nullptr;
- args = g_dbus_connection_call_finish (G_DBUS_CONNECTION(connection),
- res,
- &error);
- if (error != nullptr)
- {
- if (!g_error_matches (error, G_IO_ERROR, G_IO_ERROR_CANCELLED) &&
- !g_error_matches (error, G_DBUS_ERROR, G_DBUS_ERROR_SERVICE_UNKNOWN))
- {
- g_warning ("Unable to turn on the screen: %s", error->message);
- }
-
- g_error_free (error);
- }
- else
- {
- auto self = static_cast<Impl*>(gself);
-
- self->m_display_on_cookie = NO_DISPLAY_ON_COOKIE;
- g_variant_get (args, "(i)", &self->m_display_on_cookie);
- g_debug ("m_display_on_cookie is now '%d'", self->m_display_on_cookie);
-
- self->m_display_on_timer = g_timeout_add_seconds (self->m_display_on_seconds,
- on_display_on_timer,
- gself);
-
- g_variant_unref (args);
- }
- }
-
- static gboolean on_display_on_timer (gpointer gself)
- {
- auto self = static_cast<Impl*>(gself);
-
- self->m_display_on_timer = 0;
- self->remove_display_on_request();
-
- return G_SOURCE_REMOVE;
- }
-
-
void unforce_awake ()
{
g_return_if_fail (G_IS_DBUS_CONNECTION(m_system_bus));
@@ -223,48 +154,10 @@ private:
}
}
- void remove_display_on_request ()
- {
- g_return_if_fail (G_IS_DBUS_CONNECTION(m_system_bus));
-
- if (m_display_on_cookie != NO_DISPLAY_ON_COOKIE)
- {
- g_dbus_connection_call (m_system_bus,
- BUS_SCREEN_NAME,
- BUS_SCREEN_PATH,
- BUS_SCREEN_INTERFACE,
- "removeDisplayOnRequest",
- g_variant_new("(i)", m_display_on_cookie),
- nullptr,
- G_DBUS_CALL_FLAGS_NONE,
- -1,
- nullptr,
- nullptr,
- nullptr);
-
- m_display_on_cookie = NO_DISPLAY_ON_COOKIE;
- }
- }
-
const std::string m_app_name;
GCancellable * m_cancellable = nullptr;
GDBusConnection * m_system_bus = nullptr;
char * m_awake_cookie = nullptr;
-
- /**
- * As described by bug #1434637, alarms should have the display turn on,
- * dim, and turn off "just like it would if you'd woken it up yourself".
- * USC may be adding an intent-based bus API to handle this use case,
- * e.g. turnDisplayOnTemporarily(intent), but there's no timeframe for it.
- *
- * Until that's avaialble, we can get close to Design's specs by
- * requesting a display-on cookie and then releasing the cookie
- * a moment later. */
- const guint m_display_on_seconds = 1;
- guint m_display_on_timer = 0;
- int32_t m_display_on_cookie = NO_DISPLAY_ON_COOKIE;
-
- static constexpr int32_t NO_DISPLAY_ON_COOKIE { std::numeric_limits<int32_t>::min() };
};
/***