summaryrefslogtreecommitdiff
path: root/community/gnome-settings-daemon-compat/draw-background-unconditionally.patch
blob: c279420de6a9bd02eda17883a4b3af620f12f11a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
diff -Naur gnome-settings-daemon-3.6.4.orig/plugins/background/gsd-background-manager.c gnome-settings-daemon-3.6.4/plugins/background/gsd-background-manager.c
--- gnome-settings-daemon-3.6.4.orig/plugins/background/gsd-background-manager.c	2013-01-10 14:37:58.000000000 +0100
+++ gnome-settings-daemon-3.6.4/plugins/background/gsd-background-manager.c	2013-04-10 16:33:15.858860586 +0200
@@ -69,110 +69,6 @@
 
 static gpointer manager_object = NULL;
 
-static gboolean
-dont_draw_background (GsdBackgroundManager *manager)
-{
-        return !g_settings_get_boolean (manager->priv->settings,
-                                        "draw-background");
-}
-
-static gboolean
-nautilus_is_drawing_background (GsdBackgroundManager *manager)
-{
-       Atom           window_id_atom;
-       Window         nautilus_xid;
-       Atom           actual_type;
-       int            actual_format;
-       unsigned long  nitems;
-       unsigned long  bytes_after;
-       unsigned char *data;
-       Atom           wmclass_atom;
-       gboolean       running;
-       gint           error;
-       gboolean       show_desktop_icons;
-
-       show_desktop_icons = g_settings_get_boolean (manager->priv->settings,
-                                                     "show-desktop-icons");
-       if (! show_desktop_icons) {
-               return FALSE;
-       }
-
-       window_id_atom = XInternAtom (GDK_DISPLAY_XDISPLAY (gdk_display_get_default ()),
-                                     "NAUTILUS_DESKTOP_WINDOW_ID", True);
-
-       if (window_id_atom == None) {
-               return FALSE;
-       }
-
-       XGetWindowProperty (GDK_DISPLAY_XDISPLAY (gdk_display_get_default ()),
-                           GDK_ROOT_WINDOW (),
-                           window_id_atom,
-                           0,
-                           1,
-                           False,
-                           XA_WINDOW,
-                           &actual_type,
-                           &actual_format,
-                           &nitems,
-                           &bytes_after,
-                           &data);
-
-       if (data != NULL) {
-               nautilus_xid = *(Window *) data;
-               XFree (data);
-       } else {
-               return FALSE;
-       }
-
-       if (actual_type != XA_WINDOW) {
-               return FALSE;
-       }
-       if (actual_format != 32) {
-               return FALSE;
-       }
-
-       wmclass_atom = XInternAtom (GDK_DISPLAY_XDISPLAY (gdk_display_get_default ()), "WM_CLASS", False);
-
-       gdk_error_trap_push ();
-
-       XGetWindowProperty (GDK_DISPLAY_XDISPLAY (gdk_display_get_default ()),
-                           nautilus_xid,
-                           wmclass_atom,
-                           0,
-                           24,
-                           False,
-                           XA_STRING,
-                           &actual_type,
-                           &actual_format,
-                           &nitems,
-                           &bytes_after,
-                           &data);
-
-       error = gdk_error_trap_pop ();
-
-       if (error == BadWindow) {
-               return FALSE;
-       }
-
-       if (actual_type == XA_STRING &&
-           nitems == 24 &&
-           bytes_after == 0 &&
-           actual_format == 8 &&
-           data != NULL &&
-           !strcmp ((char *)data, "desktop_window") &&
-           !strcmp ((char *)data + strlen ((char *)data) + 1, "Nautilus")) {
-               running = TRUE;
-       } else {
-               running = FALSE;
-       }
-
-       if (data != NULL) {
-               XFree (data);
-       }
-
-       return running;
-}
-
 static void
 on_crossfade_finished (GsdBackgroundManager *manager)
 {
@@ -189,11 +85,6 @@
         int         i;
 
 
-        if (nautilus_is_drawing_background (manager) ||
-            dont_draw_background (manager)) {
-                return;
-        }
-
         gnome_settings_profile_start (NULL);
 
         display = gdk_display_get_default ();
@@ -408,8 +299,7 @@
                          const char           *key,
                          GsdBackgroundManager *manager)
 {
-        if (dont_draw_background (manager) == FALSE)
-                setup_bg_and_draw_background (manager);
+        setup_bg_and_draw_background (manager);
 }
 
 gboolean
@@ -422,24 +312,8 @@
         gnome_settings_profile_start (NULL);
 
         manager->priv->settings = g_settings_new ("org.gnome.desktop.background");
-        g_signal_connect (manager->priv->settings, "changed::draw-background",
-                          G_CALLBACK (draw_background_changed), manager);
 
-        /* If this is set, nautilus will draw the background and is
-	 * almost definitely in our session.  however, it may not be
-	 * running yet (so is_nautilus_running() will fail).  so, on
-	 * startup, just don't do anything if this key is set so we
-	 * don't waste time setting the background only to have
-	 * nautilus overwrite it.
-	 */
-        show_desktop_icons = g_settings_get_boolean (manager->priv->settings,
-                                                     "show-desktop-icons");
-
-        if (!show_desktop_icons) {
-                setup_bg (manager);
-        } else {
-                draw_background_after_session_loads (manager);
-        }
+        setup_bg (manager);
 
         gnome_settings_profile_end (NULL);