13113
|
1 |
--- ../gnome-session-2.23.6/splash/gnome-session-splash.c 2008-08-13 14:45:57.078221713 +0200
|
|
2 |
+++ gnome-session-2.23.6/splash/gnome-session-splash.c 2008-08-13 14:47:57.199399805 +0200
|
|
3 |
@@ -271,6 +271,47 @@
|
|
4 |
gtk_main_quit ();
|
12752
|
5 |
}
|
|
6 |
|
|
7 |
+/* display a busy cursor in window if it exist and on
|
|
8 |
+ * the root window. This is done in plain X and opening a new
|
|
9 |
+ * connection each time to avoid keeping the default cursor size
|
|
10 |
+ * as it is modified by gnome-daemon-settings while gnome-session is running
|
|
11 |
+ * (hence the user set cursor size would be lost if only one connection
|
|
12 |
+ * was open)*/
|
|
13 |
+static void
|
|
14 |
+set_busy_cursor (GdkWindow *window, gboolean enable)
|
|
15 |
+{
|
|
16 |
+ static gboolean busy = FALSE;
|
|
17 |
+ Cursor cur;
|
|
18 |
+ Display *dpy;
|
|
19 |
+ int scr_num, i;
|
|
20 |
+
|
|
21 |
+ dpy = XOpenDisplay (NULL);
|
|
22 |
+
|
|
23 |
+ if (enable)
|
|
24 |
+ {
|
|
25 |
+ if (busy)
|
|
26 |
+ return;
|
|
27 |
+ cur = XCreateFontCursor (dpy, GDK_WATCH);
|
|
28 |
+ busy = TRUE;
|
|
29 |
+ }
|
|
30 |
+ else
|
|
31 |
+ {
|
|
32 |
+ cur = XCreateFontCursor (dpy, GDK_LEFT_PTR);
|
|
33 |
+ busy = FALSE;
|
|
34 |
+ }
|
|
35 |
+
|
|
36 |
+ scr_num = ScreenCount (dpy);
|
|
37 |
+
|
|
38 |
+ for (i = 0; i < scr_num; i++)
|
|
39 |
+ {
|
|
40 |
+ XDefineCursor (dpy, RootWindow (dpy, i), cur);
|
|
41 |
+ }
|
|
42 |
+
|
|
43 |
+ if (GDK_IS_WINDOW (window))
|
|
44 |
+ XDefineCursor (dpy, GDK_WINDOW_XID (window), cur);
|
|
45 |
+ XSync (dpy, FALSE);
|
|
46 |
+ XCloseDisplay (dpy);
|
|
47 |
+}
|
|
48 |
int
|
|
49 |
main (int argc, char *argv[])
|
|
50 |
{
|
13113
|
51 |
@@ -291,10 +332,14 @@
|
|
52 |
G_CALLBACK (quit),
|
|
53 |
NULL);
|
12752
|
54 |
|
13113
|
55 |
+ set_busy_cursor (NULL, TRUE);
|
12752
|
56 |
+
|
13113
|
57 |
set_session_running_handler ();
|
12752
|
58 |
|
13113
|
59 |
setup_splash_window ();
|
|
60 |
gtk_main ();
|
12752
|
61 |
|
13113
|
62 |
+ set_busy_cursor (NULL, FALSE);
|
12752
|
63 |
+
|
13113
|
64 |
return 0;
|
12752
|
65 |
}
|