Merge lp:~a-j-buxton/lightdm-gtk-greeter/background-fixes into lp:~lightdm-gtk-greeter-team/lightdm-gtk-greeter/trunk
- background-fixes
- Merge into trunk
Proposed by
Alistair Buxton
Status: | Merged | ||||||||
---|---|---|---|---|---|---|---|---|---|
Merged at revision: | 151 | ||||||||
Proposed branch: | lp:~a-j-buxton/lightdm-gtk-greeter/background-fixes | ||||||||
Merge into: | lp:~lightdm-gtk-greeter-team/lightdm-gtk-greeter/trunk | ||||||||
Diff against target: |
326 lines (+141/-37) 1 file modified
src/lightdm-gtk-greeter.c (+141/-37) |
||||||||
To merge this branch: | bzr merge lp:~a-j-buxton/lightdm-gtk-greeter/background-fixes | ||||||||
Related bugs: |
|
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
LightDM Gtk+ Greeter Development Team | Pending | ||
Review via email:
|
Commit message
This series of patches fixes various problems in the background handling code, including client connection leaks and pixmap leaks arising from misuse of RetainPermanent and the root atom conventions for setting the display background.
Description of the change
This series of patches fixes various problems in the background handling code, including client connection leaks and pixmap leaks arising from misuse of RetainPermanent and the root atom conventions for setting the display background.
Some of the fixes are taken from Gnome/MATE (which is where this code originated, but has since been improved.)
To post a comment you must log in.
Preview Diff
[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1 | === modified file 'src/lightdm-gtk-greeter.c' | |||
2 | --- src/lightdm-gtk-greeter.c 2013-11-29 16:15:05 +0000 | |||
3 | +++ src/lightdm-gtk-greeter.c 2013-11-29 16:16:51 +0000 | |||
4 | @@ -21,6 +21,8 @@ | |||
5 | 21 | #include <gtk/gtk.h> | 21 | #include <gtk/gtk.h> |
6 | 22 | #include <glib/gi18n.h> | 22 | #include <glib/gi18n.h> |
7 | 23 | #include <cairo-xlib.h> | 23 | #include <cairo-xlib.h> |
8 | 24 | #include <X11/Xlib.h> | ||
9 | 25 | #include <X11/Xatom.h> | ||
10 | 24 | #include <gdk-pixbuf/gdk-pixbuf.h> | 26 | #include <gdk-pixbuf/gdk-pixbuf.h> |
11 | 25 | #include <gdk/gdkx.h> | 27 | #include <gdk/gdkx.h> |
12 | 26 | #include <glib.h> | 28 | #include <glib.h> |
13 | @@ -438,10 +440,10 @@ | |||
14 | 438 | gtk_widget_set_sensitive (GTK_WIDGET (language_menu), !logged_in); | 440 | gtk_widget_set_sensitive (GTK_WIDGET (language_menu), !logged_in); |
15 | 439 | } | 441 | } |
16 | 440 | 442 | ||
18 | 441 | static void set_background (GdkPixbuf *new_bg, gboolean is_locked); | 443 | static void set_background (GdkPixbuf *new_bg); |
19 | 442 | 444 | ||
20 | 443 | static void | 445 | static void |
22 | 444 | set_user_background (const gchar *username, gboolean is_locked) | 446 | set_user_background (const gchar *username) |
23 | 445 | { | 447 | { |
24 | 446 | LightDMUser *user; | 448 | LightDMUser *user; |
25 | 447 | const gchar *path; | 449 | const gchar *path; |
26 | @@ -463,7 +465,7 @@ | |||
27 | 463 | } | 465 | } |
28 | 464 | } | 466 | } |
29 | 465 | 467 | ||
31 | 466 | set_background (bg, is_locked); | 468 | set_background (bg); |
32 | 467 | if (bg) | 469 | if (bg) |
33 | 468 | g_object_unref (bg); | 470 | g_object_unref (bg); |
34 | 469 | } | 471 | } |
35 | @@ -873,7 +875,6 @@ | |||
36 | 873 | { | 875 | { |
37 | 874 | GtkTreeModel *model; | 876 | GtkTreeModel *model; |
38 | 875 | GtkTreeIter iter; | 877 | GtkTreeIter iter; |
39 | 876 | gboolean is_locked; | ||
40 | 877 | 878 | ||
41 | 878 | model = gtk_combo_box_get_model (user_combo); | 879 | model = gtk_combo_box_get_model (user_combo); |
42 | 879 | 880 | ||
43 | @@ -895,8 +896,7 @@ | |||
44 | 895 | } | 896 | } |
45 | 896 | 897 | ||
46 | 897 | set_login_button_label (greeter, user); | 898 | set_login_button_label (greeter, user); |
49 | 898 | is_locked = lightdm_greeter_get_lock_hint (greeter); | 899 | set_user_background (user); |
48 | 899 | set_user_background (user, is_locked); | ||
50 | 900 | set_user_image (user); | 900 | set_user_image (user); |
51 | 901 | gtk_widget_set_tooltip_text (GTK_WIDGET (user_combo), user); | 901 | gtk_widget_set_tooltip_text (GTK_WIDGET (user_combo), user); |
52 | 902 | start_authentication (user); | 902 | start_authentication (user); |
53 | @@ -1329,12 +1329,10 @@ | |||
54 | 1329 | gchar *last_user; | 1329 | gchar *last_user; |
55 | 1330 | const gchar *selected_user; | 1330 | const gchar *selected_user; |
56 | 1331 | gboolean logged_in = FALSE; | 1331 | gboolean logged_in = FALSE; |
57 | 1332 | gboolean is_locked = FALSE; | ||
58 | 1333 | 1332 | ||
59 | 1334 | g_signal_connect (lightdm_user_list_get_instance (), "user-added", G_CALLBACK (user_added_cb), greeter); | 1333 | g_signal_connect (lightdm_user_list_get_instance (), "user-added", G_CALLBACK (user_added_cb), greeter); |
60 | 1335 | g_signal_connect (lightdm_user_list_get_instance (), "user-changed", G_CALLBACK (user_changed_cb), greeter); | 1334 | g_signal_connect (lightdm_user_list_get_instance (), "user-changed", G_CALLBACK (user_changed_cb), greeter); |
61 | 1336 | g_signal_connect (lightdm_user_list_get_instance (), "user-removed", G_CALLBACK (user_removed_cb), NULL); | 1335 | g_signal_connect (lightdm_user_list_get_instance (), "user-removed", G_CALLBACK (user_removed_cb), NULL); |
62 | 1337 | is_locked = lightdm_greeter_get_lock_hint (greeter); | ||
63 | 1338 | model = gtk_combo_box_get_model (user_combo); | 1336 | model = gtk_combo_box_get_model (user_combo); |
64 | 1339 | items = lightdm_user_list_get_users (lightdm_user_list_get_instance ()); | 1337 | items = lightdm_user_list_get_users (lightdm_user_list_get_instance ()); |
65 | 1340 | for (item = items; item; item = item->next) | 1338 | for (item = items; item; item = item->next) |
66 | @@ -1394,7 +1392,7 @@ | |||
67 | 1394 | { | 1392 | { |
68 | 1395 | gtk_combo_box_set_active_iter (user_combo, &iter); | 1393 | gtk_combo_box_set_active_iter (user_combo, &iter); |
69 | 1396 | set_login_button_label (greeter, selected_user); | 1394 | set_login_button_label (greeter, selected_user); |
71 | 1397 | set_user_background (selected_user, is_locked); | 1395 | set_user_background (selected_user); |
72 | 1398 | set_user_image (selected_user); | 1396 | set_user_image (selected_user); |
73 | 1399 | gtk_widget_set_tooltip_text (GTK_WIDGET (user_combo), selected_user); | 1397 | gtk_widget_set_tooltip_text (GTK_WIDGET (user_combo), selected_user); |
74 | 1400 | start_authentication (selected_user); | 1398 | start_authentication (selected_user); |
75 | @@ -1408,7 +1406,7 @@ | |||
76 | 1408 | gtk_tree_model_get (model, &iter, 0, &name, -1); | 1406 | gtk_tree_model_get (model, &iter, 0, &name, -1); |
77 | 1409 | gtk_combo_box_set_active_iter (user_combo, &iter); | 1407 | gtk_combo_box_set_active_iter (user_combo, &iter); |
78 | 1410 | set_login_button_label (greeter, name); | 1408 | set_login_button_label (greeter, name); |
80 | 1411 | set_user_background (name, is_locked); | 1409 | set_user_background (name); |
81 | 1412 | set_user_image (name); | 1410 | set_user_image (name); |
82 | 1413 | gtk_widget_set_tooltip_text (GTK_WIDGET (user_combo), name); | 1411 | gtk_widget_set_tooltip_text (GTK_WIDGET (user_combo), name); |
83 | 1414 | start_authentication (name); | 1412 | start_authentication (name); |
84 | @@ -1420,8 +1418,11 @@ | |||
85 | 1420 | g_free (last_user); | 1418 | g_free (last_user); |
86 | 1421 | } | 1419 | } |
87 | 1422 | 1420 | ||
88 | 1421 | /* The following code for setting a RetainPermanent background pixmap was taken | ||
89 | 1422 | originally from Gnome, with some fixes from MATE. see: | ||
90 | 1423 | https://github.com/mate-desktop/mate-desktop/blob/master/libmate-desktop/mate-bg.c */ | ||
91 | 1423 | static cairo_surface_t * | 1424 | static cairo_surface_t * |
93 | 1424 | create_root_surface (GdkScreen *screen, gboolean is_locked) | 1425 | create_root_surface (GdkScreen *screen) |
94 | 1425 | { | 1426 | { |
95 | 1426 | gint number, width, height; | 1427 | gint number, width, height; |
96 | 1427 | Display *display; | 1428 | Display *display; |
97 | @@ -1441,10 +1442,6 @@ | |||
98 | 1441 | return NULL; | 1442 | return NULL; |
99 | 1442 | } | 1443 | } |
100 | 1443 | 1444 | ||
101 | 1444 | /* Force the screen to remain blank in case the session was just locked to reduce VT-switching flickering and to make the greeter behave a bit more like a screensaver than a mere unlock-dialog */ | ||
102 | 1445 | if (is_locked) | ||
103 | 1446 | XForceScreenSaver(display,ScreenSaverActive); | ||
104 | 1447 | |||
105 | 1448 | XSetCloseDownMode (display, RetainPermanent); | 1445 | XSetCloseDownMode (display, RetainPermanent); |
106 | 1449 | pixmap = XCreatePixmap (display, RootWindow (display, number), width, height, DefaultDepth (display, number)); | 1446 | pixmap = XCreatePixmap (display, RootWindow (display, number), width, height, DefaultDepth (display, number)); |
107 | 1450 | XCloseDisplay (display); | 1447 | XCloseDisplay (display); |
108 | @@ -1455,17 +1452,114 @@ | |||
109 | 1455 | GDK_VISUAL_XVISUAL (gdk_screen_get_system_visual (screen)), | 1452 | GDK_VISUAL_XVISUAL (gdk_screen_get_system_visual (screen)), |
110 | 1456 | width, height); | 1453 | width, height); |
111 | 1457 | 1454 | ||
112 | 1458 | /* Use this pixmap for the background */ | ||
113 | 1459 | XSetWindowBackgroundPixmap (GDK_SCREEN_XDISPLAY (screen), | ||
114 | 1460 | RootWindow (GDK_SCREEN_XDISPLAY (screen), number), | ||
115 | 1461 | cairo_xlib_surface_get_drawable (surface)); | ||
116 | 1462 | |||
117 | 1463 | |||
118 | 1464 | return surface; | 1455 | return surface; |
119 | 1465 | } | 1456 | } |
120 | 1466 | 1457 | ||
123 | 1467 | static void | 1458 | /* Sets the "ESETROOT_PMAP_ID" property to later be used to free the pixmap, |
124 | 1468 | set_background (GdkPixbuf *new_bg, gboolean is_locked) | 1459 | */ |
125 | 1460 | static void | ||
126 | 1461 | set_root_pixmap_id (GdkScreen *screen, | ||
127 | 1462 | Display *display, | ||
128 | 1463 | Pixmap xpixmap) | ||
129 | 1464 | { | ||
130 | 1465 | Window xroot = RootWindow (display, gdk_screen_get_number (screen)); | ||
131 | 1466 | char *atom_names[] = {"_XROOTPMAP_ID", "ESETROOT_PMAP_ID"}; | ||
132 | 1467 | Atom atoms[G_N_ELEMENTS(atom_names)] = {0}; | ||
133 | 1468 | |||
134 | 1469 | Atom type; | ||
135 | 1470 | int format; | ||
136 | 1471 | unsigned long nitems, after; | ||
137 | 1472 | unsigned char *data_root, *data_esetroot; | ||
138 | 1473 | |||
139 | 1474 | /* Get atoms for both properties in an array, only if they exist. | ||
140 | 1475 | * This method is to avoid multiple round-trips to Xserver | ||
141 | 1476 | */ | ||
142 | 1477 | if (XInternAtoms (display, atom_names, G_N_ELEMENTS(atom_names), True, atoms) && | ||
143 | 1478 | atoms[0] != None && atoms[1] != None) | ||
144 | 1479 | { | ||
145 | 1480 | |||
146 | 1481 | XGetWindowProperty (display, xroot, atoms[0], 0L, 1L, False, AnyPropertyType, | ||
147 | 1482 | &type, &format, &nitems, &after, &data_root); | ||
148 | 1483 | if (data_root && type == XA_PIXMAP && format == 32 && nitems == 1) | ||
149 | 1484 | { | ||
150 | 1485 | XGetWindowProperty (display, xroot, atoms[1], 0L, 1L, False, AnyPropertyType, | ||
151 | 1486 | &type, &format, &nitems, &after, &data_esetroot); | ||
152 | 1487 | if (data_esetroot && type == XA_PIXMAP && format == 32 && nitems == 1) | ||
153 | 1488 | { | ||
154 | 1489 | Pixmap xrootpmap = *((Pixmap *) data_root); | ||
155 | 1490 | Pixmap esetrootpmap = *((Pixmap *) data_esetroot); | ||
156 | 1491 | XFree (data_root); | ||
157 | 1492 | XFree (data_esetroot); | ||
158 | 1493 | |||
159 | 1494 | gdk_error_trap_push (); | ||
160 | 1495 | if (xrootpmap && xrootpmap == esetrootpmap) { | ||
161 | 1496 | XKillClient (display, xrootpmap); | ||
162 | 1497 | } | ||
163 | 1498 | if (esetrootpmap && esetrootpmap != xrootpmap) { | ||
164 | 1499 | XKillClient (display, esetrootpmap); | ||
165 | 1500 | } | ||
166 | 1501 | |||
167 | 1502 | XSync (display, False); | ||
168 | 1503 | |||
169 | 1504 | gdk_error_trap_pop_ignored (); | ||
170 | 1505 | } | ||
171 | 1506 | } | ||
172 | 1507 | } | ||
173 | 1508 | |||
174 | 1509 | /* Get atoms for both properties in an array, create them if needed. | ||
175 | 1510 | * This method is to avoid multiple round-trips to Xserver | ||
176 | 1511 | */ | ||
177 | 1512 | if (!XInternAtoms (display, atom_names, G_N_ELEMENTS(atom_names), False, atoms) || | ||
178 | 1513 | atoms[0] == None || atoms[1] == None) { | ||
179 | 1514 | g_warning("Could not create atoms needed to set root pixmap id/properties.\n"); | ||
180 | 1515 | return; | ||
181 | 1516 | } | ||
182 | 1517 | |||
183 | 1518 | /* Set new _XROOTMAP_ID and ESETROOT_PMAP_ID properties */ | ||
184 | 1519 | XChangeProperty (display, xroot, atoms[0], XA_PIXMAP, 32, | ||
185 | 1520 | PropModeReplace, (unsigned char *) &xpixmap, 1); | ||
186 | 1521 | |||
187 | 1522 | XChangeProperty (display, xroot, atoms[1], XA_PIXMAP, 32, | ||
188 | 1523 | PropModeReplace, (unsigned char *) &xpixmap, 1); | ||
189 | 1524 | } | ||
190 | 1525 | |||
191 | 1526 | /** | ||
192 | 1527 | * set_surface_as_root: | ||
193 | 1528 | * @screen: the #GdkScreen to change root background on | ||
194 | 1529 | * @surface: the #cairo_surface_t to set root background from. | ||
195 | 1530 | * Must be an xlib surface backing a pixmap. | ||
196 | 1531 | * | ||
197 | 1532 | * Set the root pixmap, and properties pointing to it. We | ||
198 | 1533 | * do this atomically with a server grab to make sure that | ||
199 | 1534 | * we won't leak the pixmap if somebody else it setting | ||
200 | 1535 | * it at the same time. (This assumes that they follow the | ||
201 | 1536 | * same conventions we do). @surface should come from a call | ||
202 | 1537 | * to create_root_surface(). | ||
203 | 1538 | **/ | ||
204 | 1539 | static void | ||
205 | 1540 | set_surface_as_root (GdkScreen *screen, cairo_surface_t *surface) | ||
206 | 1541 | { | ||
207 | 1542 | g_return_if_fail (cairo_surface_get_type (surface) == CAIRO_SURFACE_TYPE_XLIB); | ||
208 | 1543 | |||
209 | 1544 | /* Desktop background pixmap should be created from dummy X client since most | ||
210 | 1545 | * applications will try to kill it with XKillClient later when changing pixmap | ||
211 | 1546 | */ | ||
212 | 1547 | Display *display = GDK_DISPLAY_XDISPLAY (gdk_screen_get_display (screen)); | ||
213 | 1548 | Pixmap pixmap_id = cairo_xlib_surface_get_drawable (surface); | ||
214 | 1549 | Window xroot = RootWindow (display, gdk_screen_get_number (screen)); | ||
215 | 1550 | |||
216 | 1551 | XGrabServer (display); | ||
217 | 1552 | |||
218 | 1553 | XSetWindowBackgroundPixmap (display, xroot, pixmap_id); | ||
219 | 1554 | set_root_pixmap_id (screen, display, pixmap_id); | ||
220 | 1555 | XClearWindow (display, xroot); | ||
221 | 1556 | |||
222 | 1557 | XFlush (display); | ||
223 | 1558 | XUngrabServer (display); | ||
224 | 1559 | } | ||
225 | 1560 | |||
226 | 1561 | static void | ||
227 | 1562 | set_background (GdkPixbuf *new_bg) | ||
228 | 1469 | { | 1563 | { |
229 | 1470 | GdkRectangle monitor_geometry; | 1564 | GdkRectangle monitor_geometry; |
230 | 1471 | GdkPixbuf *bg = NULL; | 1565 | GdkPixbuf *bg = NULL; |
231 | @@ -1486,7 +1580,7 @@ | |||
232 | 1486 | int monitor; | 1580 | int monitor; |
233 | 1487 | 1581 | ||
234 | 1488 | screen = gdk_display_get_screen (gdk_display_get_default (), i); | 1582 | screen = gdk_display_get_screen (gdk_display_get_default (), i); |
236 | 1489 | surface = create_root_surface (screen, is_locked); | 1583 | surface = create_root_surface (screen); |
237 | 1490 | c = cairo_create (surface); | 1584 | c = cairo_create (surface); |
238 | 1491 | 1585 | ||
239 | 1492 | for (monitor = 0; monitor < gdk_screen_get_n_monitors (screen); monitor++) | 1586 | for (monitor = 0; monitor < gdk_screen_get_n_monitors (screen); monitor++) |
240 | @@ -1497,27 +1591,32 @@ | |||
241 | 1497 | { | 1591 | { |
242 | 1498 | p_width = gdk_pixbuf_get_width(bg); | 1592 | p_width = gdk_pixbuf_get_width(bg); |
243 | 1499 | p_height = gdk_pixbuf_get_height(bg); | 1593 | p_height = gdk_pixbuf_get_height(bg); |
245 | 1500 | 1594 | ||
246 | 1501 | scale = (double)monitor_geometry.width/p_width; | 1595 | scale = (double)monitor_geometry.width/p_width; |
247 | 1502 | height = p_height * scale; | 1596 | height = p_height * scale; |
248 | 1503 | width = monitor_geometry.width; | 1597 | width = monitor_geometry.width; |
250 | 1504 | 1598 | ||
251 | 1505 | if (height < monitor_geometry.height) | 1599 | if (height < monitor_geometry.height) |
252 | 1506 | { | 1600 | { |
253 | 1507 | scale = (double)monitor_geometry.height/p_height; | 1601 | scale = (double)monitor_geometry.height/p_height; |
254 | 1508 | height = monitor_geometry.height; | 1602 | height = monitor_geometry.height; |
255 | 1509 | width = p_width * scale; | 1603 | width = p_width * scale; |
256 | 1510 | } | 1604 | } |
259 | 1511 | 1605 | ||
258 | 1512 | |||
260 | 1513 | GdkPixbuf *p = gdk_pixbuf_scale_simple (bg, width, | 1606 | GdkPixbuf *p = gdk_pixbuf_scale_simple (bg, width, |
261 | 1514 | height, GDK_INTERP_BILINEAR); | 1607 | height, GDK_INTERP_BILINEAR); |
262 | 1515 | if (width > monitor_geometry.width) | 1608 | if (width > monitor_geometry.width) |
263 | 1516 | { | 1609 | { |
268 | 1517 | p = gdk_pixbuf_new_subpixbuf(p, (width-monitor_geometry.width)/2, 0, monitor_geometry.width, monitor_geometry.height); | 1610 | GdkPixbuf *tmp = gdk_pixbuf_new_subpixbuf(p, (width-monitor_geometry.width)/2, 0, monitor_geometry.width, monitor_geometry.height); |
269 | 1518 | } | 1611 | g_object_unref (p); |
270 | 1519 | if (!gdk_pixbuf_get_has_alpha (p)) | 1612 | p = tmp; |
271 | 1520 | p = gdk_pixbuf_add_alpha (p, FALSE, 255, 255, 255); | 1613 | } |
272 | 1614 | if (!gdk_pixbuf_get_has_alpha (p)) | ||
273 | 1615 | { | ||
274 | 1616 | GdkPixbuf *tmp = gdk_pixbuf_add_alpha (p, FALSE, 255, 255, 255); | ||
275 | 1617 | g_object_unref (p); | ||
276 | 1618 | p = tmp; | ||
277 | 1619 | } | ||
278 | 1521 | gdk_cairo_set_source_pixbuf (c, p, monitor_geometry.x, monitor_geometry.y); | 1620 | gdk_cairo_set_source_pixbuf (c, p, monitor_geometry.x, monitor_geometry.y); |
279 | 1522 | g_object_unref (p); | 1621 | g_object_unref (p); |
280 | 1523 | } | 1622 | } |
281 | @@ -1534,7 +1633,8 @@ | |||
282 | 1534 | 1633 | ||
283 | 1535 | /* Refresh background */ | 1634 | /* Refresh background */ |
284 | 1536 | gdk_flush (); | 1635 | gdk_flush (); |
286 | 1537 | XClearWindow (GDK_SCREEN_XDISPLAY (screen), RootWindow (GDK_SCREEN_XDISPLAY (screen), i)); | 1636 | set_surface_as_root(screen, surface); |
287 | 1637 | cairo_surface_destroy(surface); | ||
288 | 1538 | } | 1638 | } |
289 | 1539 | } | 1639 | } |
290 | 1540 | 1640 | ||
291 | @@ -1600,7 +1700,6 @@ | |||
292 | 1600 | GdkColor background_color; | 1700 | GdkColor background_color; |
293 | 1601 | #endif | 1701 | #endif |
294 | 1602 | GError *error = NULL; | 1702 | GError *error = NULL; |
295 | 1603 | gboolean is_locked = FALSE; | ||
296 | 1604 | #ifdef HAVE_LIBINDICATOR | 1703 | #ifdef HAVE_LIBINDICATOR |
297 | 1605 | gchar **whitelist; | 1704 | gchar **whitelist; |
298 | 1606 | GDir *dir; | 1705 | GDir *dir; |
299 | @@ -1692,9 +1791,9 @@ | |||
300 | 1692 | } | 1791 | } |
301 | 1693 | g_free (value); | 1792 | g_free (value); |
302 | 1694 | 1793 | ||
306 | 1695 | /* Set the background */ | 1794 | /* Force the screen to remain blank in case the session was just locked to reduce VT-switching flickering and to make the greeter behave a bit more like a screensaver than a mere unlock-dialog */ |
307 | 1696 | is_locked = lightdm_greeter_get_lock_hint (greeter); | 1795 | if (lightdm_greeter_get_lock_hint (greeter)) |
308 | 1697 | set_background (NULL, is_locked); | 1796 | XForceScreenSaver(gdk_x11_display_get_xdisplay(gdk_display_get_default ()),ScreenSaverActive); |
309 | 1698 | 1797 | ||
310 | 1699 | /* Set GTK+ settings */ | 1798 | /* Set GTK+ settings */ |
311 | 1700 | value = g_key_file_get_value (config, "greeter", "theme-name", NULL); | 1799 | value = g_key_file_get_value (config, "greeter", "theme-name", NULL); |
312 | @@ -1985,9 +2084,14 @@ | |||
313 | 1985 | gtk_cell_layout_add_attribute (GTK_CELL_LAYOUT (user_combo), renderer, "weight", 2); | 2084 | gtk_cell_layout_add_attribute (GTK_CELL_LAYOUT (user_combo), renderer, "weight", 2); |
314 | 1986 | 2085 | ||
315 | 1987 | if (lightdm_greeter_get_hide_users_hint (greeter)) | 2086 | if (lightdm_greeter_get_hide_users_hint (greeter)) |
316 | 2087 | { | ||
317 | 2088 | /* Set the background to default */ | ||
318 | 2089 | set_background (NULL); | ||
319 | 1988 | start_authentication ("*other"); | 2090 | start_authentication ("*other"); |
320 | 2091 | } | ||
321 | 1989 | else | 2092 | else |
322 | 1990 | { | 2093 | { |
323 | 2094 | /* This also sets the background to user's */ | ||
324 | 1991 | load_user_list (); | 2095 | load_user_list (); |
325 | 1992 | gtk_widget_hide (GTK_WIDGET (cancel_button)); | 2096 | gtk_widget_hide (GTK_WIDGET (cancel_button)); |
326 | 1993 | gtk_widget_show (GTK_WIDGET (user_combo)); | 2097 | gtk_widget_show (GTK_WIDGET (user_combo)); |