mirror of
https://gitlab.gnome.org/GNOME/nautilus
synced 2024-11-05 16:04:31 +00:00
Check the return value of XOpenDisplay and handle failures.
2002-04-21 Alexander Larsson <alla@lysator.liu.se> * libnautilus-private/nautilus-directory-background.c (image_loading_done_callback), (make_root_pixmap): Check the return value of XOpenDisplay and handle failures.
This commit is contained in:
parent
84b62cbdd1
commit
d854458030
2 changed files with 20 additions and 1 deletions
|
@ -1,3 +1,10 @@
|
|||
2002-04-21 Alexander Larsson <alla@lysator.liu.se>
|
||||
|
||||
* libnautilus-private/nautilus-directory-background.c
|
||||
(image_loading_done_callback), (make_root_pixmap):
|
||||
Check the return value of XOpenDisplay and handle
|
||||
failures.
|
||||
|
||||
2002-04-21 Alexander Larsson <alla@lysator.liu.se>
|
||||
|
||||
* src/nautilus-desktop-window.c (nautilus_desktop_window_class_init):
|
||||
|
|
|
@ -475,11 +475,19 @@ static GdkPixmap *
|
|||
make_root_pixmap (gint width, gint height)
|
||||
{
|
||||
Display *display;
|
||||
char *display_name;
|
||||
Pixmap result;
|
||||
|
||||
gdk_flush ();
|
||||
|
||||
display = XOpenDisplay (DisplayString (GDK_DISPLAY ()));
|
||||
display_name = DisplayString (GDK_DISPLAY ());
|
||||
display = XOpenDisplay (display_name);
|
||||
|
||||
if (display == NULL) {
|
||||
g_warning ("Unable to open display '%s' when setting background pixmap\n",
|
||||
(display_name) ? display_name : "NULL");
|
||||
return NULL;
|
||||
}
|
||||
|
||||
XSetCloseDownMode (display, RetainPermanent);
|
||||
|
||||
|
@ -570,6 +578,10 @@ image_loading_done_callback (EelBackground *background, gboolean successful_load
|
|||
height = gdk_screen_height ();
|
||||
|
||||
pixmap = make_root_pixmap (width, height);
|
||||
if (pixmap == NULL) {
|
||||
return;
|
||||
}
|
||||
|
||||
gc = gdk_gc_new (pixmap);
|
||||
eel_background_draw_to_drawable (background, pixmap, gc, 0, 0, width, height, width, height);
|
||||
g_object_unref (gc);
|
||||
|
|
Loading…
Reference in a new issue