From 4547c6e9f36891967fc125b7a9f86f3dbdf02f5d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jonas=20=C3=85dahl?= Date: Thu, 18 Aug 2016 10:57:01 +0800 Subject: [PATCH] MetaLauncher: Remember the KMS file path Not only keep the KMS fd around, also remember the file path used. This will later be used when initializing a EGLDevice based renderer. https://bugzilla.gnome.org/show_bug.cgi?id=773629 --- src/backends/native/meta-launcher.c | 14 +++++++++++++- src/backends/native/meta-launcher.h | 2 ++ 2 files changed, 15 insertions(+), 1 deletion(-) diff --git a/src/backends/native/meta-launcher.c b/src/backends/native/meta-launcher.c index ddb7080ba..abba17e4f 100644 --- a/src/backends/native/meta-launcher.c +++ b/src/backends/native/meta-launcher.c @@ -61,6 +61,7 @@ struct _MetaLauncher gboolean session_active; int kms_fd; + char *kms_file_path; }; static Login1Session * @@ -435,6 +436,7 @@ static gboolean get_kms_fd (Login1Session *session_proxy, const gchar *seat_id, int *fd_out, + char **kms_file_path_out, GError **error) { int major, minor; @@ -466,6 +468,7 @@ get_kms_fd (Login1Session *session_proxy, } *fd_out = fd; + *kms_file_path_out = g_steal_pointer (&path); return TRUE; } @@ -509,6 +512,7 @@ meta_launcher_new (GError **error) g_autofree char *seat_id = NULL; gboolean have_control = FALSE; int kms_fd; + char *kms_file_path; session_proxy = get_session_proxy (NULL, error); if (!session_proxy) @@ -530,7 +534,7 @@ meta_launcher_new (GError **error) if (!seat_proxy) goto fail; - if (!get_kms_fd (session_proxy, seat_id, &kms_fd, error)) + if (!get_kms_fd (session_proxy, seat_id, &kms_fd, &kms_file_path, error)) goto fail; self = g_slice_new0 (MetaLauncher); @@ -539,6 +543,7 @@ meta_launcher_new (GError **error) self->session_active = TRUE; self->kms_fd = kms_fd; + self->kms_file_path = kms_file_path; clutter_evdev_set_device_callbacks (on_evdev_device_open, on_evdev_device_close, @@ -558,6 +563,7 @@ meta_launcher_free (MetaLauncher *self) { g_object_unref (self->seat_proxy); g_object_unref (self->session_proxy); + g_free (self->kms_file_path); g_slice_free (MetaLauncher, self); } @@ -585,3 +591,9 @@ meta_launcher_get_kms_fd (MetaLauncher *self) { return self->kms_fd; } + +const char * +meta_launcher_get_kms_file_path (MetaLauncher *self) +{ + return self->kms_file_path; +} diff --git a/src/backends/native/meta-launcher.h b/src/backends/native/meta-launcher.h index df4b0da6b..4b16e351c 100644 --- a/src/backends/native/meta-launcher.h +++ b/src/backends/native/meta-launcher.h @@ -36,4 +36,6 @@ gboolean meta_launcher_activate_vt (MetaLauncher *self, int meta_launcher_get_kms_fd (MetaLauncher *self); +const char * meta_launcher_get_kms_file_path (MetaLauncher *self); + #endif /* META_LAUNCHER_H */