8396
|
1 |
diff -urN gnome-session-2.16.1/gnome-session/main.c gnome-session-2.16.1-hacked/gnome-session/main.c
|
|
2 |
--- gnome-session-2.16.1/gnome-session/main.c 2006-10-23 09:51:16.839150000 +1300
|
|
3 |
+++ gnome-session-2.16.1-hacked/gnome-session/main.c 2006-10-23 09:53:52.502604000 +1300
|
|
4 |
@@ -248,7 +248,68 @@
|
7950
|
5 |
RESPONSE_LOG_IN,
|
|
6 |
RESPONSE_TRY_AGAIN
|
|
7 |
};
|
|
8 |
-
|
|
9 |
+
|
|
10 |
+static gboolean
|
|
11 |
+postrun_progress_update (gpointer data)
|
|
12 |
+{
|
|
13 |
+ int status = 0;
|
|
14 |
+ static int count = 0;
|
|
15 |
+ GError *error = NULL;
|
|
16 |
+ gtk_progress_bar_pulse (GTK_PROGRESS_BAR (data));
|
|
17 |
+
|
|
18 |
+ if (count == 30) {
|
|
19 |
+ g_spawn_command_line_sync ("/usr/lib/postrun-query -c JDS_wait -e",
|
|
20 |
+ NULL, NULL, &status, &error);
|
|
21 |
+ count = 0;
|
|
22 |
+ }
|
|
23 |
+
|
|
24 |
+ if (status == 0) {
|
|
25 |
+ count++;
|
|
26 |
+ return TRUE;
|
|
27 |
+ }
|
|
28 |
+
|
|
29 |
+ gtk_main_quit ();
|
|
30 |
+ return FALSE;
|
|
31 |
+}
|
|
32 |
+
|
|
33 |
+static void
|
|
34 |
+gsm_wait_for_unfinished_postrun ()
|
|
35 |
+{
|
|
36 |
+ int status = 0;
|
|
37 |
+ GError *error = NULL;
|
|
38 |
+
|
|
39 |
+ if (!g_spawn_command_line_sync ("/usr/lib/postrun-query -c JDS_wait -e",
|
|
40 |
+ NULL, NULL, &status, &error)) {
|
|
41 |
+ /* no postrun-query? WTF? bail out and hope for the best :) */
|
|
42 |
+ return;
|
|
43 |
+ }
|
|
44 |
+
|
|
45 |
+ if (status == 0) {
|
|
46 |
+ GtkWidget *window = gtk_window_new (GTK_WINDOW_TOPLEVEL);
|
|
47 |
+ GtkWidget *vbox = gtk_vbox_new (TRUE, 10);
|
|
48 |
+ GtkWidget *progress = gtk_progress_bar_new ();
|
|
49 |
+ GtkWidget *label;
|
|
50 |
+ gint func_ref;
|
|
51 |
+
|
|
52 |
+ label = gtk_label_new (_("Completing post install setup..."));
|
|
53 |
+
|
|
54 |
+ gtk_container_add (GTK_CONTAINER (window), vbox);
|
|
55 |
+ gtk_container_set_border_width (GTK_CONTAINER (window), 10);
|
|
56 |
+ gtk_box_pack_start_defaults (GTK_BOX (vbox), label);
|
|
57 |
+ gtk_progress_bar_pulse (GTK_PROGRESS_BAR (progress));
|
|
58 |
+ func_ref = g_timeout_add (100, postrun_progress_update, progress);
|
|
59 |
+ gtk_box_pack_start_defaults (GTK_BOX (vbox), progress);
|
|
60 |
+
|
|
61 |
+ gtk_window_set_position (GTK_WINDOW (window), GTK_WIN_POS_CENTER);
|
|
62 |
+
|
|
63 |
+ gtk_widget_show_all (window);
|
|
64 |
+ gtk_main ();
|
|
65 |
+
|
|
66 |
+ gtk_widget_destroy (window);
|
|
67 |
+ g_source_remove (func_ref);
|
|
68 |
+ }
|
|
69 |
+}
|
|
70 |
+
|
|
71 |
static void
|
|
72 |
gnome_login_check (void)
|
|
73 |
{
|
8396
|
74 |
@@ -393,7 +454,9 @@
|
7950
|
75 |
|
|
76 |
/* We need to do this as early as possible */
|
|
77 |
gsm_set_display_properties ();
|
|
78 |
-
|
|
79 |
+
|
|
80 |
+ gsm_wait_for_unfinished_postrun ();
|
|
81 |
+
|
|
82 |
if (ORBit_proto_use ("IPv4") || ORBit_proto_use ("IPv6"))
|
|
83 |
gnome_login_check ();
|
|
84 |
|