-- 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: 5c92db3f314406ecbf2e359375eb4c7f153bb25a:
path_to:
revision_to:

git.thebackupbox.net

rxvt-unicode-sixel

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

commit 5c92db3f314406ecbf2e359375eb4c7f153bb25a
Author: Marc Lehmann <schmorp@schmorp.de>
Date:   Sun Dec 12 15:13:37 2004 +0000

    *** empty log message ***

diff --git a/Changes b/Changes

index 4873086f0f218326f2ea1e761586ed98d0bb0126..

index ..60d7d3c513488b2c378b5072b4e8c0331e6ced1a 100644

--- a/Changes
+++ b/Changes
@@ -2,16 +2,36 @@ Lines marked with "xterm:" indicate either xterm features ported to rxvt
 or changed rxvt behaviour to make it more compatible to xterm (usually
 xfree86's xterm).

-TODO: hotkey font resizing
+TODO: underline colour changes?
+TODO: read property sequence is broken with respect to utf-8 etc.
 TODO: +ssc -ssr seems to scroll at wrong time, scrolling up the empty sec. scr.
-TODO: multibyte support for setwmname et al.
-TODO: tabbed windows
-TODO: there are other todo items, but they are not in this file.
-TODO: OnTheSpot editing.
-TODO: searchable backlog
-TODO: meta-tagging of data by regex (my dream project)
-TODO: triple-click == select full output line
-TODO: double-click: more intelligent (urls etc.)
+FEAT: hotkey font resizing
+FEAT: searchable backlog
+FEAT: meta-tagging of data by regex (my dream project)
+FEAT: triple-click == select full output line
+FEAT: double-click: more intelligent (urls etc.)
+FEAT: OnTheSpot editing.
+FEAT: tabbed windows
+
+4.4
+	- rewrote handling of default-char width.
+        - implement _NET_WM_NAME et al., and also use UTF8_STRING
+          for the xterm property esc. sequence. Allows i18n window
+          titles etc.
+        - SMART_WINDOW_TITLE removed, pls. complain if you need this.
+        - added GBK encoding (formidable patch by WU Fengguang).
+        - fixed a bug in the transparency code.
+        - upgraded iom.[Ch].
+        - force slower (but more responsive) transparency update.
+        - fix off-by-one bug with wide characters at the end of a line,
+          which got partially overwritten by spaces.
+        - as xlib is completely broken with respect to utf-8 handling
+          and nobody is going to fix it, that part has been re-implemented.
+          should fix most paste problems between apps that use UTF8 encoding
+          and rxvt running in a lesser-supported locale (thanks to Robin Redeker
+          for writing utf8towcs). Only enabled with ENABLE_FRILLS.
+        - darwin compile fix by Ethan Blanton.
+        - fix the colour of the underline, which was rather random before.

 4.3  Sat Dec  4 04:58:37 CET 2004
         - unapply the "emulated graphical chars. respect wcwidth" patch.
@@ -23,8 +43,7 @@ TODO: double-click: more intelligent (urls etc.)
           now, too.

 4.2  Wed Dec  1 03:30:22 CET 2004
-	- make emulated graphical characters respect wcwidth
-          (forgot who reported this).
+	- make emulated graphical characters respect wcwidth (Kuang-che Wu).
         - remove debugging code that caused major slowdowns
           on high-latency networks.
         - wide characters shift the correct number of characters
diff --git a/src/screen.C b/src/screen.C

index 6aab6353c4aa76e13a9b848e75bc66ed5371cb82..

index ..f232beb858c2045c4314a26d37dc6e3cd88a7e51 100644

--- a/src/screen.C
+++ b/src/screen.C
@@ -975,11 +975,12 @@ rxvt_term::scr_add_lines (const unicode_t *str, int nlines, int len)
           while (--width > 0);

           // pad with spaces when overwriting wide character with smaller one
-          for (int c = screen.cur.col; c < last_col && stp[c] == NOCHAR; c++)
-            {
-              stp[c] = ' ';
-              srp[c] = rend;
-            }
+          if (!width)
+            for (int c = screen.cur.col; c < last_col && stp[c] == NOCHAR; c++)
+              {
+                stp[c] = ' ';
+                srp[c] = rend;
+              }
         }
       else if (width == 0)
         {
@@ -2400,9 +2401,12 @@ rxvt_term::scr_refresh (unsigned char refresh_type)
             font->draw (*TermWin.drawable, xpixel, ypixel, text, count, fore, back);

           if (rend & RS_Uline && font->descent > 1 && fore != back)
-            XDrawLine (display->display, drawBuffer, TermWin.gc,
-                       xpixel, ypixel + font->ascent + 1,
-                       xpixel + Width2Pixel (count) - 1, ypixel + font->ascent + 1);
+            {
+              XSetForeground (display->display, TermWin.gc, pix_colors[fore]);
+              XDrawLine (display->display, drawBuffer, TermWin.gc,
+                         xpixel, ypixel + font->ascent + 1,
+                         xpixel + Width2Pixel (count) - 1, ypixel + font->ascent + 1);
+            }
         }                     /* for (col....) */
     }                         /* for (row....) */

@@ -2756,6 +2760,23 @@ rxvt_term::selection_paste (Window win, Atom prop, bool delete_prop)

       char **cl;
       int cr;
+
+#if ENABLE_FRILLS
+      // xlib is horribly broken with respect to UTF8_STRING, and nobody cares to fix it
+      // so recode it manually
+      if (ct.encoding == xa[XA_UTF8_STRING])
+        {
+          wchar_t *w = rxvt_utf8towcs ((const char *)ct.value, ct.nitems);
+          char *s = rxvt_wcstombs (w);
+
+          // TODO: strlen == only the first element will be converted. well...
+          paste ((unsigned char *)s, strlen (s));
+
+          free (s);
+          free (w);
+        }
+      else
+#endif
       if (XmbTextPropertyToTextList (display->display, &ct, &cl, &cr) >= 0 && cl)
         {
           for (int i = 0; i < cr; i++)
@@ -2848,7 +2869,6 @@ rxvt_term::selection_request (Time tm, int x, int y)
           if (selection_request_other (xa[XA_COMPOUND_TEXT], i))
             return;
 #endif
-
         }
     }

@@ -3019,8 +3039,7 @@ rxvt_term::selection_make (Time tm)

   if (XwcTextListToTextProperty (display->display, &selection.text, 1, XStringStyle, &ct) >= 0)
     {
-      XChangeProperty (display->display, display->root, XA_CUT_BUFFER0, XA_STRING, 8,
-                       PropModeReplace, ct.value, ct.nitems);
+      set_string_property (XA_CUT_BUFFER0, ct.value, ct.nitems);
       XFree (ct.value);
     }
 #endif
@@ -3485,9 +3504,6 @@ void
 rxvt_term::selection_send (const XSelectionRequestEvent &rq)
 {
   XSelectionEvent ev;
-  XTextProperty ct;
-  XICCEncodingStyle style;
-  Atom target;

   ev.type = SelectionNotify;
   ev.property = None;
@@ -3534,28 +3550,38 @@ rxvt_term::selection_send (const XSelectionRequestEvent &rq)
            || rq.target == xa[XA_UTF8_STRING]
           )
     {
+      XTextProperty ct;
+      Atom target = rq.target;
       short freect = 0;
       int selectlen;
       wchar_t *cl;
-
-      target = rq.target;
+      enum {
+        enc_string        = XStringStyle,
+        enc_text          = XStdICCTextStyle,
+        enc_compound_text = XCompoundTextStyle,
+#ifdef X_HAVE_UTF8_STRING
+        enc_utf8          = XUTF8StringStyle,
+#else
+        enc_utf8          = -1,
+#endif
+      } style;

       if (target == XA_STRING)
         // we actually don't do XA_STRING, but who cares, as i18n clients
         // will ask for another format anyways.
-        style = XStringStyle;
+        style = enc_string;
       else if (target == xa[XA_TEXT])
-        style = XStdICCTextStyle;
+        style = enc_text;
       else if (target == xa[XA_COMPOUND_TEXT])
-        style = XCompoundTextStyle;
-#if X_HAVE_UTF8_STRING
+        style = enc_compound_text;
+#if ENABLE_FRILLS
       else if (target == xa[XA_UTF8_STRING])
-        style = XUTF8StringStyle;
+        style = enc_utf8;
 #endif
       else
         {
           target = xa[XA_COMPOUND_TEXT];
-          style = XCompoundTextStyle;
+          style = enc_compound_text;
         }

       if (selection.text)
@@ -3569,19 +3595,31 @@ rxvt_term::selection_send (const XSelectionRequestEvent &rq)
           selectlen = 0;
         }

-      // Xwc doesn't handle iso-10646 in wchar_t gracefully, so maybe recode it
-      // manually for XUTF8StringStyle.
-      if (XwcTextListToTextProperty (display->display, &cl, 1, style, &ct) >= 0)
+#if ENABLE_FRILLS
+      // xlib is horribly broken with respect to UTF8_STRING, and nobody cares to fix it
+      // so recode it manually
+      if (style == enc_utf8)
+        {
+          freect = 1;
+          ct.encoding = target;
+          ct.format = 8;
+          ct.value = (unsigned char *)rxvt_wcstoutf8 (cl, selectlen);
+          ct.nitems = strlen ((char *)ct.value);
+        }
+      else
+#endif
+      if (XwcTextListToTextProperty (display->display, &cl, 1, (XICCEncodingStyle) style, &ct) >= 0)
         freect = 1;
       else
         {
           /* if we failed to convert then send it raw */
           ct.value = (unsigned char *)cl;
           ct.nitems = selectlen;
+          ct.encoding = target;
         }

       XChangeProperty (display->display, rq.requestor, rq.property,
-                       target, 8, PropModeReplace,
+                       ct.encoding, 8, PropModeReplace,
                        ct.value, (int)ct.nitems);
       ev.property = rq.property;

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

-- Response ended

-- Page fetched on Sun Jun 2 11:35:00 2024