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
This commit is contained in:
parent
cde622b8e1
commit
4547c6e9f3
@ -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;
|
||||
}
|
||||
|
@ -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 */
|
||||
|
Loading…
Reference in New Issue
Block a user