-- Leo's gemini proxy

-- Connecting to git.thebackupbox.net:1965...

-- Connected

-- Sending request

-- Meta line: 20 text/gemini

repo: rxvt-unicode-sixel
action: commit
revision:
path_from:
revision_from: 75e454d2a592d3b166e21f39478dc79a21101577:
path_to:
revision_to:

git.thebackupbox.net

rxvt-unicode-sixel

git://git.thebackupbox.net/rxvt-unicode-sixel

commit 75e454d2a592d3b166e21f39478dc79a21101577
Author: Marc Lehmann <schmorp@schmorp.de>
Date:   Mon Dec 24 06:51:37 2007 +0000

    *** empty log message ***

diff --git a/Changes b/Changes

index 07118911735fd54c4ee4468fbaaf7335b11ebdbe..

index ..97372c897bcf262f8f54484ba6cbaa6a88d43be6 100644

--- a/Changes
+++ b/Changes
@@ -17,17 +17,13 @@ WISH: load system-wide config file even if we don't have one
 WISH: look into XAddConnectionWatch, does anybody need that?
 DUMB: support tex fonts

-TODO: weird flicker after changing backgorund pixmap
-   Esetroot some image
-   rxvt -ip -sh 50 -tint blue
-   Esetroot some image again
-   resizing the window now shows flashes of untinted pixmap (metacity)
-
 	- fix the issue where urxvtd would not immediately close a window
           when the command exited but only on the next X event.
         - fix the issue where making a selection in one urxvtd window
           would not clear it visually in another.
         - changed terminfo file not to use application keypad mode.
+        - fix an issue of urxvt not getting background pixmap updates
+          and flickering after bg pixmap changes.
 	- fix redraw bug in xterm scrollbar with -sr (reported by Mikachu).
         - correctly provide dependencies for libev (µikachu).
         - minor code reorganisations and cleanups.
diff --git a/src/background.C b/src/background.C

index e4396ca322bd7758172b03928a6864caac5e025d..

index ..d3dd0b92544ce6bb54a400660d50e4604ce8b674 100644

--- a/src/background.C
+++ b/src/background.C
@@ -781,6 +781,7 @@ bgPixmap_t::set_tint (rxvt_color &new_tint)
       flags = (flags & ~tintFlags) | new_flags | tintSet;
       return true;
     }
+
   return false;
 }

@@ -794,6 +795,7 @@ bgPixmap_t::unset_tint ()
      flags = (flags&~tintFlags)|new_flags;
      return true;
     }
+
   return false;
 }

@@ -803,7 +805,7 @@ bgPixmap_t::set_shade (const char *shade_str)
   int new_shade = (shade_str) ? atoi (shade_str) : 0;

   if (new_shade < 0 && new_shade > -100)
-		new_shade = 200 - (100 + new_shade);
+    new_shade = 200 - (100 + new_shade);
   else if (new_shade == 100)
     new_shade = 0;

@@ -814,6 +816,7 @@ bgPixmap_t::set_shade (const char *shade_str)
       flags = (flags & (~tintFlags | tintSet)) | new_flags;
       return true;
     }
+
   return false;
 }

@@ -913,6 +916,7 @@ bgPixmap_t::make_transparency_pixmap ()
                   success = true;
                 }
             }
+
           XDestroyWindow (dpy, src);
           XUngrabServer (dpy);
           //fprintf (stderr, "%s:%d: ev_count = %d\n", __FUNCTION__, __LINE__, ev_count);
@@ -1042,6 +1046,7 @@ bgPixmap_t::make_transparency_pixmap ()
                       XRenderComposite (dpy, PictOpOver, overlay_pic, mask_pic, back_pic, 0, 0, 0, 0, 0, 0, window_width, window_height);
                       result |= transpPmapTinted;
                     }
+
                   XRenderFreePicture (dpy, mask_pic);
                   XRenderFreePicture (dpy, overlay_pic);
                   XRenderFreePicture (dpy, back_pic);
@@ -1073,9 +1078,7 @@ bgPixmap_t::make_transparency_pixmap ()
 bool
 bgPixmap_t::set_root_pixmap ()
 {
-  Pixmap new_root_pixmap = None;
-
-  new_root_pixmap = target->get_pixmap_property (XA_XROOTPMAP_ID);
+  Pixmap new_root_pixmap = target->get_pixmap_property (XA_XROOTPMAP_ID);
   if (new_root_pixmap == None)
     new_root_pixmap = target->get_pixmap_property (XA_ESETROOT_PMAP_ID);

@@ -1084,6 +1087,7 @@ bgPixmap_t::set_root_pixmap ()
       root_pixmap = new_root_pixmap;
       return true;
     }
+
   return false;
 }
 # endif /* ENABLE_TRANSPARENCY */
@@ -1092,7 +1096,6 @@ bgPixmap_t::set_root_pixmap ()
 static void ShadeXImage(rxvt_term *term, XImage* srcImage, int shade, int rm, int gm, int bm);
 # endif

-
 bool
 bgPixmap_t::render ()
 {
@@ -1183,9 +1186,10 @@ bgPixmap_t::render ()
     }
 # endif /* HAVE_AFTERIMAGE */

-  if (result != NULL)
+  if (result)
     {
       GC gc = XCreateGC (target->dpy, target->vt, 0UL, NULL);
+
       if (gc)
         {
           if (/*pmap_depth != target->depth &&*/ pixmap != None)
@@ -1193,13 +1197,15 @@ bgPixmap_t::render ()
               XFreePixmap (target->dpy, pixmap);
               pixmap = None;
             }
+
           if (pixmap == None)
             {
               pixmap = XCreatePixmap (target->dpy, target->vt, result->width, result->height, target->depth);
-              pmap_width = result->width;
+              pmap_width  = result->width;
               pmap_height = result->height;
-              pmap_depth = target->depth;
+              pmap_depth  = target->depth;
             }
+
           if (pmap_depth != result->depth)
             {
               /* Bad Match error will ensue ! stupid X !!!! */
@@ -1212,11 +1218,14 @@ bgPixmap_t::render ()
                   /* TODO: implement image recoding */
                 }
             }
+
           if (pmap_depth == result->depth)
             XPutImage (target->dpy, pixmap, gc, result, 0, 0, 0, 0, result->width, result->height);
+
           XFreeGC (target->dpy, gc);
           flags = flags & ~isInvalid;
         }
+
         XDestroyImage (result);
     }

@@ -1252,7 +1261,7 @@ bgPixmap_t::set_target (rxvt_term *new_target)
 }

 void
-bgPixmap_t::apply()
+bgPixmap_t::apply ()
 {
   if (target)
     {
diff --git a/src/command.C b/src/command.C

index cc77b36683b2845e201ae11e726366de0cb05dda..

index ..dbfe9877aa51691849fe10d89f301eaa37edc861 100644

--- a/src/command.C
+++ b/src/command.C
@@ -1459,6 +1459,7 @@ rxvt_term::x_cb (XEvent &ev)
                   update_background ();
 #endif
               }
+
             HOOK_INVOKE ((this, HOOK_CONFIGURE_NOTIFY, DT_XEVENT, &ev, DT_END));
           }
         break;
@@ -1796,6 +1797,7 @@ rxvt_term::rootwin_cb (XEvent &ev)
             bgPixmap.set_root_pixmap ();
             update_background ();
           }
+
         break;
     }
 # endif
@@ -3391,10 +3393,12 @@ rxvt_term::process_xterm_seq (int op, const char *str, char resp)
         process_color_seq (op, Color_tint, str, resp);
         {
           bool changed = false;
+
           if (ISSET_PIXCOLOR (Color_tint))
             changed = bgPixmap.set_tint (pix_colors_focused [Color_tint]);
           else
             changed = bgPixmap.unset_tint ();
+
           if (changed)
             update_background ();
         }
@@ -3427,6 +3431,7 @@ rxvt_term::process_xterm_seq (int op, const char *str, char resp)
                 if (str == NULL)
                   bgPixmap.set_defaultGeometry ();
               }
+
             while (str)
               {
                 str++;
@@ -3434,8 +3439,9 @@ rxvt_term::process_xterm_seq (int op, const char *str, char resp)
                   changed++;
                 str = strchr (str, ';');
               }
+
             if (changed)
-                update_background ();
+              update_background ();
           }
         break;
 #endif
diff --git a/src/main.C b/src/main.C

index 9d86315cb4483311c7562f841431e69ca1422242..

index ..88c87beceb49bbd3bb31d6fb32e6234e27dbe5c7 100644

--- a/src/main.C
+++ b/src/main.C
@@ -172,7 +172,7 @@ rxvt_term::rxvt_term ()
   slip_wheel_ev.set       <rxvt_term, &rxvt_term::slip_wheel_cb>   (this);
 #endif
 #if ENABLE_TRANSPARENCY || ENABLE_PERL
-  rootwin_ev.set          <rxvt_term, &rxvt_term::x_cb>       (this),
+  rootwin_ev.set          <rxvt_term, &rxvt_term::rootwin_cb> (this),
 #endif
 #ifdef HAVE_SCROLLBARS
   scrollbar_ev.set        <rxvt_term, &rxvt_term::x_cb>       (this),
@@ -523,12 +523,14 @@ rxvt_term::init (int argc, const char *const *argv, stringvec *envv)
     if (option (Opt_transparent))
       {
         bgPixmap.set_transparent ();
+
 #ifdef HAVE_AFTERIMAGE
         if (rs [Rs_blurradius])
           bgPixmap.set_blur_radius (rs [Rs_blurradius]);
 #endif
         if (ISSET_PIXCOLOR (Color_tint))
           bgPixmap.set_tint (pix_colors_focused [Color_tint]);
+
         if (rs [Rs_shade])
           bgPixmap.set_shade (rs [Rs_shade]);

@@ -539,11 +541,11 @@ rxvt_term::init (int argc, const char *const *argv, stringvec *envv)
 #endif

 #ifdef BG_IMAGE_FROM_FILE
-    if (rs[Rs_backgroundPixmap] != NULL)
+    if (rs[Rs_backgroundPixmap])
       {
         const char *p = rs[Rs_backgroundPixmap];

-        if ((p = strchr (p, ';')) != NULL)
+        if ((p = strchr (p, ';')) != 0)
           {
             p++;
             bgPixmap.set_geometry (p);
@@ -1706,25 +1708,29 @@ rxvt_term::get_pixmap_property (int prop_id)
 #ifdef HAVE_BG_PIXMAP
 # if TRACE_PIXMAPS
 #  undef update_background
-int rxvt_term::trace_update_background (const char *file, int line)
+void
+rxvt_term::trace_update_background (const char *file, int line)
 {
   fprintf (stderr, "%s:%d:update_background()\n", file, line);
   update_background ();
 }
 # endif

-int
+void
 rxvt_term::update_background ()
 {
   bgPixmap.invalidate ();

   /* no chance of real time refresh if we are blurring! */
-  if (bgPixmap.invalid_since + 0.5 < ev::now () && !(bgPixmap.flags & bgPixmap_t::blurNeeded))
-    bgPixmap.render ();
+  if (bgPixmap.invalid_since + 0.50 < ev::now ()
+      && !(bgPixmap.flags & bgPixmap_t::blurNeeded))
+    {
+      update_background_ev.stop ();
+      bgPixmap.render ();
+    }
   else
     {
       ev_tstamp refresh;
-      update_background_ev.stop ();

       if (!bgPixmap.need_client_side_rendering ())
         refresh = .05;
@@ -1732,10 +1738,9 @@ rxvt_term::update_background ()
         refresh = .20; /* very slow !!! */
       else
         refresh = .07;
+
       update_background_ev.start (refresh);
     }
-
-  return 0;
 }

 void
diff --git a/src/rxvt.h b/src/rxvt.h

index fc154747ac3fe3a23b745e03ea1a378edcfa660e..

index ..010e31cba691a12986eb0c5a23b94bf4ce7f752f 100644

--- a/src/rxvt.h
+++ b/src/rxvt.h
@@ -1043,9 +1043,9 @@ struct rxvt_term : zero_initialized, rxvt_vars, rxvt_screen {
   xevent_watcher rootwin_ev;
 #endif
 #ifdef HAVE_BG_PIXMAP
-  int update_background ();
+  void update_background ();
 #if TRACE_PIXMAPS
-  int trace_update_background (const char *file, int line);
+  void trace_update_background (const char *file, int line);
 # define update_background() trace_update_background (__FILE__, __LINE__)
 #endif
   void update_background_cb (ev::timer &w, int revents);

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

-- Response ended

-- Page fetched on Sun Jun 2 13:39:12 2024