~ubuntu-branches/ubuntu/oneiric/gnome-panel/oneiric

« back to all changes in this revision

Viewing changes to debian/patches/86_signal_curtain.patch

  • Committer: Bazaar Package Importer
  • Author(s): Sebastien Bacher
  • Date: 2009-09-21 23:08:42 UTC
  • Revision ID: james.westby@ubuntu.com-20090921230842-m2m2qi8aw3m3s5t4
Tags: 1:2.28.0-0ubuntu1
* New upstream version
* debian/patches/86_signal_curtain.patch:
  - updated version by Cody Russell (lp: #430060)

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
diff --git a/gnome-panel/applet.c b/gnome-panel/applet.c
2
 
index c2932ee..c3bd534 100644
 
2
index c2932ee..88ea9c5 100644
3
3
--- a/gnome-panel/applet.c
4
4
+++ b/gnome-panel/applet.c
5
 
@@ -842,6 +842,13 @@ panel_applet_queue_initial_unhide_toplevels (gpointer user_data)
 
5
@@ -16,6 +16,9 @@
 
6
 
 
7
 #include <libpanel-util/panel-show.h>
 
8
 
 
9
+#include <dbus/dbus-glib.h>
 
10
+#include <dbus/dbus-glib-bindings.h>
 
11
+
 
12
 #include "button-widget.h"
 
13
 #include "drawer.h"
 
14
 #include "launcher.h"
 
15
@@ -828,6 +831,43 @@ panel_applet_on_load_queue (const char *id)
 
16
        return FALSE;
 
17
 }
 
18
 
 
19
+static void
 
20
+signal_boot_curtain (void)
 
21
+{
 
22
+  DBusGConnection *connection;
 
23
+  DBusGProxy      *proxy;
 
24
+  GError          *error = NULL;
 
25
+
 
26
+  connection = dbus_g_bus_get (DBUS_BUS_SYSTEM, &error);
 
27
+
 
28
+  if (error)
 
29
+    {
 
30
+      g_warning ("%s", error->message);
 
31
+      g_error_free(error);
 
32
+      return;
 
33
+    }
 
34
+
 
35
+  /* Get the current session object */
 
36
+  proxy = dbus_g_proxy_new_for_name (connection,
 
37
+                                     "com.ubuntu.BootCurtain",
 
38
+                                     "/com/ubuntu/BootCurtain",
 
39
+                                     "com.ubuntu.BootCurtain");
 
40
+
 
41
+  if (!proxy)
 
42
+    {
 
43
+      g_warning ("Unable to connect to BootCurtain");
 
44
+      dbus_g_connection_unref (connection);
 
45
+      return;
 
46
+    }
 
47
+
 
48
+  dbus_g_proxy_call_no_reply (proxy,
 
49
+                              "SignalLoaded",
 
50
+                              G_TYPE_STRING, "gnome-panel",
 
51
+                              G_TYPE_INVALID);
 
52
+
 
53
+  g_object_unref (proxy);
 
54
+}
 
55
+
 
56
 /* This doesn't do anything if the initial unhide already happened */
 
57
 static gboolean
 
58
 panel_applet_queue_initial_unhide_toplevels (gpointer user_data)
 
59
@@ -842,6 +882,8 @@ panel_applet_queue_initial_unhide_toplevels (gpointer user_data)
6
60
        for (l = panel_toplevel_list_toplevels (); l != NULL; l = l->next)
7
61
                panel_toplevel_queue_initial_unhide ((PanelToplevel *) l->data);
8
62
 
9
 
+        g_spawn_command_line_async("dbus-send "
10
 
+                                   "--system --type=method_call "
11
 
+                                   "--dest=com.ubuntu.BootCurtain "
12
 
+                                   "/com/ubuntu/BootCurtain "
13
 
+                                   "com.ubuntu.BootCurtain.SignalLoaded string:gnome-panel",
14
 
+                                   NULL);
 
63
+        signal_boot_curtain ();
15
64
+
16
65
        return FALSE;
17
66
 }
18
67
 
 
68
diff --git a/gnome-panel/main.c b/gnome-panel/main.c
 
69
index 16b4163..4405b13 100644
 
70
--- a/gnome-panel/main.c
 
71
+++ b/gnome-panel/main.c
 
72
@@ -18,6 +18,9 @@
 
73
 
 
74
 #include <libpanel-util/panel-cleanup.h>
 
75
 
 
76
+#include <dbus/dbus-glib.h>
 
77
+#include <dbus/dbus-glib-bindings.h>
 
78
+
 
79
 #include "panel-gconf.h"
 
80
 #include "panel-profile.h"
 
81
 #include "panel-config-global.h"
 
82
@@ -46,6 +49,8 @@ static const GOptionEntry options[] = {
 
83
   { NULL }
 
84
 };
 
85
 
 
86
+static void setup_boot_curtain (void);
 
87
+
 
88
 int
 
89
 main (int argc, char **argv)
 
90
 {
 
91
@@ -77,6 +82,8 @@ main (int argc, char **argv)
 
92
                return -1;
 
93
        }
 
94
 
 
95
+        setup_boot_curtain ();
 
96
+
 
97
        panel_action_protocol_init ();
 
98
        panel_multiscreen_init ();
 
99
        panel_init_stock_icons_and_items ();
 
100
@@ -117,3 +124,40 @@ main (int argc, char **argv)
 
101
 
 
102
        return 0;
 
103
 }
 
104
+
 
105
+static void
 
106
+setup_boot_curtain (void)
 
107
+{
 
108
+  DBusGConnection *connection;
 
109
+  DBusGProxy      *proxy;
 
110
+  GError          *error = NULL;
 
111
+
 
112
+  connection = dbus_g_bus_get (DBUS_BUS_SYSTEM, &error);
 
113
+
 
114
+  if (error)
 
115
+    {
 
116
+      g_warning ("%s", error->message);
 
117
+      g_error_free(error);
 
118
+      return;
 
119
+    }
 
120
+
 
121
+  /* Get the current session object */
 
122
+  proxy = dbus_g_proxy_new_for_name (connection,
 
123
+                                     "com.ubuntu.BootCurtain",
 
124
+                                     "/com/ubuntu/BootCurtain",
 
125
+                                     "com.ubuntu.BootCurtain");
 
126
+
 
127
+  if (!proxy)
 
128
+    {
 
129
+      g_warning ("Unable to connect to BootCurtain");
 
130
+      dbus_g_connection_unref (connection);
 
131
+      return;
 
132
+    }
 
133
+
 
134
+  dbus_g_proxy_call_no_reply (proxy,
 
135
+                              "AddWaitSignal",
 
136
+                              G_TYPE_STRING, "gnome-panel",
 
137
+                              G_TYPE_INVALID);
 
138
+
 
139
+  g_object_unref (proxy);
 
140
+}