*** empty log message ***
authorpcg <pcg>
Tue, 24 Feb 2004 11:48:38 +0000 (11:48 +0000)
committerpcg <pcg>
Tue, 24 Feb 2004 11:48:38 +0000 (11:48 +0000)
Changes
src/screen.C

diff --git a/Changes b/Changes
index 59a857956a564c91268ec83a62457c4d1ce889b3..087d3b3dbd28d1b61315c189598de70867bea6b8 100644 (file)
--- a/Changes
+++ b/Changes
         - fix a bug that kept escape codes to be generated for some
           keysyms that also have string translations, when not --enable-xim.
           reported by joel reed.
-        - countless minor bugfixes.
         - re-enabled esc-seq. for font-switching (\033 ] 50 ; <fontset> \007).
         - fix bug in locale-handling that kept the correct locale from
           being selected.
         - implemented esc-seq. to switch locales (\033 ] 9 ; <locale> \007).
         - removed greek support.
         - allow NUL bytes (ctrl-@) to be entered even with XIM enabled.
+        - correct cursor width if !focus.
+        - many other minor bugfixes.
 
 1.8  Mon Feb  2 20:09:18 CET 2004
        - almost total conversion to C++. Except for introducing
index b64b106bd600d3afe02a4066e5b240b7005959c2..e13b47e9664dd370515350e12563cc7bb0772d41 100644 (file)
@@ -1837,21 +1837,20 @@ rxvt_term::scr_printscreen (int fullhist)
 void
 rxvt_term::scr_refresh (unsigned char refresh_type)
 {
-  unsigned char   clearfirst, /* first character writes before cell        */
-  clearlast,  /* last character writes beyond cell         */
-  must_clear, /* use draw_string not draw_image_string     */
-  rvid,       /* reverse video this position               */
-  showcursor; /* show the cursor                           */
-  int16_t         col, row,   /* column/row we're processing               */
-  ocrow;      /* old cursor row                            */
-  int             cursorwidth;
-  int             i,          /* tmp                                       */
-  row_offset; /* basic offset in screen structure          */
+  unsigned char clearfirst, /* first character writes before cell        */
+                clearlast,  /* last character writes beyond cell         */
+                must_clear, /* use draw_string not draw_image_string     */
+                rvid,       /* reverse video this position               */
+                showcursor; /* show the cursor                           */
+  int16_t col, row,   /* column/row we're processing               */
+          ocrow;      /* old cursor row                            */
+  int i,              /* tmp                                       */
+  row_offset;         /* basic offset in screen structure          */
 #ifndef NO_CURSORCOLOR
-  rend_t          cc1;        /* store colours at cursor position (s)       */
+  rend_t cc1;         /* store colours at cursor position (s)      */
 #endif
-  rend_t         *drp, *srp;  /* drawn-rend-pointer, screen-rend-pointer   */
-  text_t         *dtp, *stp;  /* drawn-text-pointer, screen-text-pointer   */
+  rend_t *drp, *srp;  /* drawn-rend-pointer, screen-rend-pointer   */
+  text_t *dtp, *stp;  /* drawn-text-pointer, screen-text-pointer   */
 
   if (refresh_type == NO_REFRESH || !TermWin.mapped)
     return;
@@ -1893,18 +1892,13 @@ rxvt_term::scr_refresh (unsigned char refresh_type)
     ccol2;  /* Cursor colour2      */
 
     showcursor = (screen.flags & Screen_VisibleCursor);
-    cursorwidth = 0;
 #ifdef CURSOR_BLINK
     if (hidden_cursor)
       showcursor = 0;
 #endif
 
-    cursorwidth = 0;
-
     if (showcursor)
       {
-        cursorwidth++;
-
         srp = & (screen.rend[screen.cur.row + TermWin.saveLines]
                 [screen.cur.col]);
 
@@ -1932,7 +1926,6 @@ rxvt_term::scr_refresh (unsigned char refresh_type)
             *srp = SET_FGCOLOR (*srp, ccol1);
             *srp = SET_BGCOLOR (*srp, ccol2);
 #endif
-
           }
       }
 
@@ -2213,7 +2206,6 @@ rxvt_term::scr_refresh (unsigned char refresh_type)
 #ifndef NO_CURSORCOLOR
           *srp = (*srp & ~ (RS_fgMask | RS_bgMask)) | cc1;
 #endif
-
         }
       else if (oldcursor.row >= 0)
         {
@@ -2221,6 +2213,11 @@ rxvt_term::scr_refresh (unsigned char refresh_type)
           if (ISSET_PIXCOLOR (Color_cursor))
             XSetForeground (display->display, TermWin.gc, PixColors[Color_cursor]);
 #endif
+          int cursorwidth = 1;
+          while (oldcursor.col + cursorwidth < TermWin.ncol
+                 && drawn_text[oldcursor.row][oldcursor.col + cursorwidth] == NOCHAR)
+            cursorwidth++;
+
           XDrawRectangle (display->display, drawBuffer, TermWin.gc,
                          Col2Pixel (oldcursor.col),
                          Row2Pixel (oldcursor.row),