[mutter/wip/login1: 136/139] meta-weston-launch: Remove the "VT-switched lock"
- From: Jasper St. Pierre <jstpierre src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [mutter/wip/login1: 136/139] meta-weston-launch: Remove the "VT-switched lock"
- Date: Tue, 11 Mar 2014 21:39:39 +0000 (UTC)
commit 9e8064514d27f58587c878d6a6125b788e454871
Author: Jasper St. Pierre <jstpierre mecheye net>
Date: Tue Mar 11 17:33:14 2014 -0400
meta-weston-launch: Remove the "VT-switched lock"
We'll replace it by pausing the Clutter master clock.
src/wayland/meta-weston-launch.c | 45 ++++++-------------------------------
1 files changed, 8 insertions(+), 37 deletions(-)
---
diff --git a/src/wayland/meta-weston-launch.c b/src/wayland/meta-weston-launch.c
index 4ae3288..b83ab99 100644
--- a/src/wayland/meta-weston-launch.c
+++ b/src/wayland/meta-weston-launch.c
@@ -47,14 +47,9 @@
struct _MetaLauncher
{
GSocket *weston_launch;
+ GSource *weston_launch_source;
gboolean vt_switched;
-
- GMainContext *nested_context;
- GMainLoop *nested_loop;
-
- GSource *inner_source;
- GSource *outer_source;
};
static void handle_request_vt_switch (MetaLauncher *self);
@@ -249,8 +244,9 @@ static void
handle_vt_enter (MetaLauncher *launcher)
{
g_assert (launcher->vt_switched);
+ launcher->vt_switched = FALSE;
- g_main_loop_quit (launcher->nested_loop);
+ meta_launcher_enter (launcher);
}
static void
@@ -269,22 +265,11 @@ handle_request_vt_switch (MetaLauncher *launcher)
if (!ok) {
g_warning ("Failed to acknowledge VT switch: %s", error->message);
g_error_free (error);
-
return;
}
g_assert (!launcher->vt_switched);
launcher->vt_switched = TRUE;
-
- /* We can't do anything at this point, because we don't
- have input devices and we don't have the DRM master,
- so let's run a nested busy loop until the VT is reentered */
- g_main_loop_run (launcher->nested_loop);
-
- g_assert (launcher->vt_switched);
- launcher->vt_switched = FALSE;
-
- meta_launcher_enter (launcher);
}
static gboolean
@@ -348,18 +333,10 @@ meta_launcher_new (void)
self->weston_launch = g_socket_new_from_fd (launch_fd, NULL);
- self->nested_context = g_main_context_new ();
- self->nested_loop = g_main_loop_new (self->nested_context, FALSE);
-
- self->outer_source = g_socket_create_source (self->weston_launch, G_IO_IN, NULL);
- g_source_set_callback (self->outer_source, (GSourceFunc)on_socket_readable, self, NULL);
- g_source_attach (self->outer_source, NULL);
- g_source_unref (self->outer_source);
-
- self->inner_source = g_socket_create_source (self->weston_launch, G_IO_IN, NULL);
- g_source_set_callback (self->inner_source, (GSourceFunc)on_socket_readable, self, NULL);
- g_source_attach (self->inner_source, self->nested_context);
- g_source_unref (self->inner_source);
+ self->weston_launch_source = g_socket_create_source (self->weston_launch, G_IO_IN, NULL);
+ g_source_set_callback (self->weston_launch_source, (GSourceFunc)on_socket_readable, self, NULL);
+ g_source_attach (self->weston_launch_source, NULL);
+ g_source_unref (self->weston_launch_source);
clutter_evdev_set_open_callback (on_evdev_device_open,
on_evdev_device_close,
@@ -383,14 +360,8 @@ meta_launcher_new (void)
void
meta_launcher_free (MetaLauncher *launcher)
{
- g_source_destroy (launcher->outer_source);
- g_source_destroy (launcher->inner_source);
-
- g_main_loop_unref (launcher->nested_loop);
- g_main_context_unref (launcher->nested_context);
-
+ g_source_destroy (launcher->weston_launch_source);
g_object_unref (launcher->weston_launch);
-
g_slice_free (MetaLauncher, launcher);
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]