repo: rxvt-unicode-sixel
action: commit
revision: 
path_from: 
revision_from: b1fdc35efa4afff8331b4f155c0bb64990f53d16:
path_to: 
revision_to: 
git.thebackupbox.net
rxvt-unicode-sixel
git clone git://git.thebackupbox.net/rxvt-unicode-sixel
commit b1fdc35efa4afff8331b4f155c0bb64990f53d16
Author: Sasha Vasko 
Date:   Wed Aug 15 22:41:52 2007 +0000

    fixed segfault on resize by getting rid of touch() in apply(). rearranged redraw calls on configure notify to be sane

diff --git a/src/command.C b/src/command.C
index b06a27fc6149f8963111465f9f18a3899bd1b00e..
index ..70ac4e2251b7e8f27d64e69e47c476d8aa97b820 100644
--- a/src/command.C
+++ b/src/command.C
@@ -1485,22 +1485,16 @@ rxvt_term::x_cb (XEvent &ev)
               {
                 seen_resize = 1;
                 resize_all_windows (ev.xconfigure.width, ev.xconfigure.height, 1);
-#ifdef XPM_BACKGROUND
-                /* TODO: replace with update_pixmap() that should unify transparency and bg image handling ! */
-                if (!option (Opt_transparent) && bgPixmap.window_size_sensitive ())
-                  {
-                    bgPixmap.render ();
-                    scr_touch (true);
-                  }
-#endif
               }
-
-            HOOK_INVOKE ((this, HOOK_CONFIGURE_NOTIFY, DT_XEVENT, &ev, DT_END));
-
+            else
+              {
 #ifdef ENABLE_TRANSPARENCY
-            if (option (Opt_transparent))
-              bgPixmap.render ();
+                if (option (Opt_transparent))
+                  if (bgPixmap.render ())
+                    scr_touch (false);
 #endif
+              }
+            HOOK_INVOKE ((this, HOOK_CONFIGURE_NOTIFY, DT_XEVENT, &ev, DT_END));
           }
         break;

diff --git a/src/main.C b/src/main.C
index c80c7ef3dbe74e5ea2d9d609664f1cf5c15848b5..
index ..5ff6f8b85a415106e8c127b0c8290145bbece869 100644
--- a/src/main.C
+++ b/src/main.C
@@ -1151,11 +1151,13 @@ rxvt_term::resize_all_windows (unsigned int newwidth, unsigned int newheight, in
                          window_vt_x, window_vt_y,
                          width, height);

-      scr_clear ();
 #ifdef XPM_BACKGROUND
-      /* TODO: should that really be here ? */
-      bgPixmap.render ();
+                /* TODO: replace with update_pixmap() that should unify transparency and bg image handling ! */
+      if (bgPixmap.window_size_sensitive ())
+          bgPixmap.render ();
 #endif
+
+      scr_clear ();
     }

   if (fix_screen || old_height == 0)
@@ -1165,8 +1167,9 @@ rxvt_term::resize_all_windows (unsigned int newwidth, unsigned int newheight, in
   //scr_touch (false);

 #ifdef HAVE_BG_PIXMAP
-  if (bgPixmap.pixmap)
-    scr_touch (false);
+//  TODO: this don't seem to have any effect - do we still need it ? If so - in which case exactly ?
+//  if (bgPixmap.pixmap)
+//    scr_touch (false);
 #endif

 #ifdef USE_XIM
diff --git a/src/screen.C b/src/screen.C
index e52b8d16da44eb7d2c50caf542121ee3a0308ac7..
index ..c30d74997f27d36b1ecd59f15a85c6a0cbdda6c8 100644
--- a/src/screen.C
+++ b/src/screen.C
@@ -1803,7 +1803,7 @@ rxvt_term::scr_expose (int x, int y, int ewidth, int eheight, bool refresh) NOTH
       min_it (rc[i].col, ncol - 1);
       min_it (rc[i].row, nrow - 1);
     }
-
+// TODO: this line somehow causes segfault if scr_expose() is called just after resize
   for (i = rc[PART_BEG].row; i <= rc[PART_END].row; i++)
     fill_text (&drawn_buf[i].t[rc[PART_BEG].col], 0, rc[PART_END].col - rc[PART_BEG].col + 1);

diff --git a/src/xpm.C b/src/xpm.C
index 2d4bdee7b9117f752ce47e397a63973a60a8de0b..
index ..6e58ec9622bacddea3a3893f4b0eb93102f582b0 100644
--- a/src/xpm.C
+++ b/src/xpm.C
@@ -1031,8 +1031,10 @@ bgPixmap_t::apply()
           target->scrollbar_show (0);
         }
 #endif
+      /* Is that really neccessary? we did a XClearArea to generate Expose events alreday ! */
       target->want_refresh = target->want_full_refresh = 1;
-      target->flush ();
+      /* TODO: why do we need a flush here ??? It causes segfault on resize ! */
+//      target->flush ();
     }
 }
 #endif				/* HAVE_BG_PIXMAP */

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