From 28f79d458596213ea33dc68755c87f46a140591b Mon Sep 17 00:00:00 2001 From: Chris Michael Date: Mon, 13 Jun 2016 16:18:13 -0400 Subject: [PATCH] elput: Fix issue of VT-Switching not working This patch fixes an issue where you could not VT-switch away from a running Enlightenment session by simplifying the vt switch code and passing the proper arguments to the dbus message. @fix Signed-off-by: Chris Michael --- src/lib/elput/elput_logind.c | 46 ++++++++------------------------------------ 1 file changed, 8 insertions(+), 38 deletions(-) diff --git a/src/lib/elput/elput_logind.c b/src/lib/elput/elput_logind.c index 22cb1b0..fedb2b0 100644 --- a/src/lib/elput/elput_logind.c +++ b/src/lib/elput/elput_logind.c @@ -568,50 +568,20 @@ _logind_close(Elput_Manager *em, int fd) static Eina_Bool _logind_vt_set(Elput_Manager *em, int vt) { - Eldbus_Object *obj; - Eldbus_Proxy *proxy; Eldbus_Message *msg; - char self[PATH_MAX]; - - snprintf(self, sizeof(self), "/org/freedesktop/login1/seat/self"); - - obj = eldbus_object_get(em->dbus.conn, "org.freedesktop.login1", self); - if (!obj) - { - ERR("Could not get dbus object"); - goto obj_err; - } - - proxy = eldbus_proxy_get(obj, "org.freedesktop.login1.Seat"); - if (!proxy) - { - ERR("Could not get dbus proxy"); - goto proxy_err; - } - msg = eldbus_proxy_method_call_new(proxy, "SwitchTo"); - if (!msg) - { - ERR("Could not create method call for proxy"); - goto msg_err; - } + msg = + eldbus_message_method_call_new("org.freedesktop.login1", + "/org/freedesktop/login1/seat/self", + "org.freedesktop.login1.Seat", "SwitchTo"); + if (!msg) return EINA_FALSE; - eldbus_message_arguments_append(msg, "u", &vt); + if (!eldbus_message_arguments_append(msg, "u", vt)) + return EINA_FALSE; - eldbus_proxy_send(proxy, msg, NULL, NULL, -1); - - eldbus_message_unref(msg); - eldbus_proxy_unref(proxy); - eldbus_object_unref(obj); + eldbus_connection_send(em->dbus.conn, msg, NULL, NULL, -1); return EINA_TRUE; - -msg_err: - eldbus_proxy_unref(proxy); -proxy_err: - eldbus_object_unref(obj); -obj_err: - return EINA_FALSE; } Elput_Interface _logind_interface = -- 2.7.4