repo: rxvt-unicode-sixel
action: commit
revision: 
path_from: 
revision_from: e2b57885bbf48366fc4a74c77782f646f08a932d:
path_to: 
revision_to: 
git.thebackupbox.net
rxvt-unicode-sixel
git clone git://git.thebackupbox.net/rxvt-unicode-sixel
commit e2b57885bbf48366fc4a74c77782f646f08a932d
Author: Emanuele Giaquinta 
Date:   Thu Nov 11 10:42:45 2010 +0000

    Simplify.

diff --git a/src/background.C b/src/background.C
index ef9b4c5fb059956a990e51f18136f5cc7cbeb6bd..
index ..5af6f8f9ae1c04c4a0701f89ff52cdab49a4b1af 100644
--- a/src/background.C
+++ b/src/background.C
@@ -668,20 +668,14 @@ bgPixmap_t::render_image (unsigned long background_flags)
       XGCValues gcv;
       GC gc;

-      if (pixmap)
-        {
-          if (pmap_width != new_pmap_width
-              || pmap_height != new_pmap_height
-              || pmap_depth != target->depth)
-            {
-              XFreePixmap (target->dpy, pixmap);
-              pixmap = None;
-            }
-        }
-
       /* create Pixmap */
-      if (pixmap == None)
+      if (pixmap == None
+          || pmap_width != new_pmap_width
+          || pmap_height != new_pmap_height
+          || pmap_depth != target->depth)
         {
+          if (pixmap)
+            XFreePixmap (target->dpy, pixmap);
           pixmap = XCreatePixmap (target->dpy, target->vt, new_pmap_width, new_pmap_height, target->depth);
           pmap_width = new_pmap_width;
           pmap_height = new_pmap_height;
@@ -799,19 +793,13 @@ bgPixmap_t::render_image (unsigned long background_flags)
             }
         }

-      if (pixmap)
-        {
-          if (pmap_width != new_pmap_width
-              || pmap_height != new_pmap_height
-              || pmap_depth != target->depth)
-            {
-              XFreePixmap (target->dpy, pixmap);
-              pixmap = None;
-            }
-        }
-
-      if (pixmap == None)
+      if (pixmap == None
+          || pmap_width != new_pmap_width
+          || pmap_height != new_pmap_height
+          || pmap_depth != target->depth)
         {
+          if (pixmap)
+            XFreePixmap (target->dpy, pixmap);
           pixmap = XCreatePixmap (target->dpy, target->vt, new_pmap_width, new_pmap_height, target->depth);
           pmap_width = new_pmap_width;
           pmap_height = new_pmap_height;

-----END OF PAGE-----