From 5493103f0bb193ce975305f48139b9666e0d83e7 Mon Sep 17 00:00:00 2001 From: Bradford Hovinen Date: Thu, 21 Dec 2000 20:43:13 +0000 Subject: [PATCH] Check if nitems is 1, not 4 (set_root_pixmap): Do a sanity check on the 2000-12-21 Bradford Hovinen * capplets/new-background-properties/applier.c (set_root_pixmap): Check if nitems is 1, not 4 (set_root_pixmap): Do a sanity check on the old pixmap before freeing it --- ChangeLog | 7 +++++++ capplets/background/applier.c | 15 ++++++++++----- 2 files changed, 17 insertions(+), 5 deletions(-) diff --git a/ChangeLog b/ChangeLog index efffe6e14..75fd631c5 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,10 @@ +2000-12-21 Bradford Hovinen + + * capplets/new-background-properties/applier.c (set_root_pixmap): + Check if nitems is 1, not 4 + (set_root_pixmap): Do a sanity check on the old pixmap before + freeing it + 2000-12-18 Bradford Hovinen * capplets/new-background-properties/applier.c diff --git a/capplets/background/applier.c b/capplets/background/applier.c index af304d86a..94c7a524d 100644 --- a/capplets/background/applier.c +++ b/capplets/background/applier.c @@ -1208,7 +1208,7 @@ set_root_pixmap (Pixmap pixmap) gint format; guchar *data_esetroot; - XGrabServer (GDK_DISPLAY ()); +/* XGrabServer (GDK_DISPLAY ()); */ XGetWindowProperty (GDK_DISPLAY (), GDK_ROOT_WINDOW (), gdk_atom_intern ("ESETROOT_PMAP_ID", FALSE), @@ -1217,9 +1217,14 @@ set_root_pixmap (Pixmap pixmap) &data_esetroot); if (type == XA_PIXMAP) { - if (format == 32 && nitems == 4) - XKillClient(GDK_DISPLAY (), - *((Pixmap *) data_esetroot)); + if (format == 32 && nitems == 1) { + Pixmap old_pixmap; + + old_pixmap = *((Pixmap *) data_esetroot); + + if (old_pixmap != pixmap) + XKillClient(GDK_DISPLAY (), old_pixmap); + } XFree (data_esetroot); } @@ -1244,7 +1249,7 @@ set_root_pixmap (Pixmap pixmap) } XClearWindow (GDK_DISPLAY (), GDK_ROOT_WINDOW ()); - XUngrabServer (GDK_DISPLAY ()); +/* XUngrabServer (GDK_DISPLAY ()); */ XFlush(GDK_DISPLAY ()); }