*** empty log message ***
authorpcg <pcg>
Sat, 21 Feb 2004 20:33:39 +0000 (20:33 +0000)
committerpcg <pcg>
Sat, 21 Feb 2004 20:33:39 +0000 (20:33 +0000)
Changes
src/command.C
src/defaultfont.C
src/init.C
src/main.C
src/rxvt.h
src/rxvtcolor.C

diff --git a/Changes b/Changes
index 54c1ac441d2a2a54a036aa2da5ff58a684ede331..7e48e3383eb4926f52c43e5c337212cc50e47c01 100644 (file)
--- a/Changes
+++ b/Changes
@@ -5,10 +5,10 @@
         - implemented caching of input methods. This immensely shortens
           startup time for new terms in rxvtd. At least xfree86 4.3 is
           rather broken with respect to input methods, though, so expect
-          crashes when you kill your input method (xterm crashes, too).
+          crashes when you kill your input method (xterm et al. also crash).
         - fix bugs in x flushing, causing an empty screen after startup
-          the first until the first event arives.
         - fix various memleaks in rxvtd.
+        - countless minor bugfixes.
 
 1.8  Mon Feb  2 20:09:18 CET 2004
        - almost total conversion to C++. Except for introducing
index 54c1e1a8609f1356809d4ea3e15f2a749e82856c..0e0a69563cb7ab9cb7027c0179924a0f8f4b6b0f 100644 (file)
@@ -949,7 +949,7 @@ rxvt_term::next_char ()
         return *cmdbuf_ptr++;
 
       wchar_t wc;
-      size_t len = mbrtowc (&wc, (char *)cmdbuf_ptr, cmdbuf_endp - cmdbuf_ptr, &mbstate.mbs);
+      size_t len = mbrtowc (&wc, (char *)cmdbuf_ptr, cmdbuf_endp - cmdbuf_ptr, mbstate);
 
       if (len == (size_t)-2)
         return NOCHAR;
index 0c0dc24bfdb32022f27e8ef9eec3a1366722c7da..864a757d32d200eb44e63c896b89858f123de7ed 100644 (file)
@@ -878,10 +878,6 @@ rxvt_font_xft::load (const rxvt_fontprop &prop)
 
   XftUnlockFace (f);
 
-  d = XftDrawCreate (DISPLAY, DRAWABLE, r->display->visual, r->display->cmap);
-  if (!d)
-    return false;
-
   return true;
 }
 
@@ -896,6 +892,8 @@ rxvt_font_xft::draw (int x, int y,
                      const text_t *text, int len,
                      int fg, int bg)
 {
+  d = XftDrawCreate (DISPLAY, DRAWABLE, r->display->visual, r->display->cmap);
+
   if (bg >= 0 && bg != Color_bg)
     XftDrawRect (d, &r->PixColors[bg].c, x, y, r->TermWin.fwidth * len, r->TermWin.fheight);
   else
index 42617590dc14b4b9d4bf1140025fa3b40c4a93aa..20d4490dc68e1d396084d92bbc5bfa26222855d6 100644 (file)
@@ -808,6 +808,8 @@ rxvt_term::set_locale (const char *locale)
 #if HAVE_XSETLOCALE || HAVE_SETLOCALE
   free (this->locale);
   this->locale = rxvt_strdup (setlocale (LC_CTYPE, ""));
+  rxvt_set_locale (this->locale);
+  mbstate.reset ();
 #endif
 #if HAVE_NL_LANGINFO
   free (codeset);
index 79a8d0e9c4d0031bcf2e489660ebfb062c74e6b6..09df4b5d0fa23282a9e41072169119db1d0dfb51 100644 (file)
@@ -1,4 +1,4 @@
-/*--------------------------------*-C-*---------------------------------*
+/*--------------------------------*-C-*---------------------------------*;
  * File:        main.c
  *----------------------------------------------------------------------*
  *
@@ -267,7 +267,7 @@ rxvt_term::init (int argc, const char *const *argv)
   Gr_reset ();          /* reset graphics */
 #endif
 
-#if 1
+#if 0
   XSynchronize (display->display, True);
 #endif
 
@@ -1316,7 +1316,7 @@ rxvt_term::im_cb ()
 
 #if defined(HAVE_XSETLOCALE) || defined(HAVE_SETLOCALE)
   if (rs[Rs_imLocale])
-    setlocale (LC_CTYPE, rs[Rs_imLocale]);
+    rxvt_set_locale (rs[Rs_imLocale]);
 #endif
 
   p = rs[Rs_inputMethod];
@@ -1357,7 +1357,7 @@ rxvt_term::im_cb ()
 done:
 #if defined(HAVE_XSETLOCALE) || defined(HAVE_SETLOCALE)
   if (rs[Rs_imLocale])
-    setlocale (LC_CTYPE, locale);
+    rxvt_set_locale (locale);
 #endif
 }
 
index 51a4e745bab9426176f39f30063967de2173fe07..67356dac67de8f7b382a952f262e0c7a13695579 100644 (file)
@@ -821,10 +821,9 @@ enum {
 struct mbstate {
   mbstate_t mbs;
 
-  mbstate ()
-  {
-    MEMSET (&mbs, 0, sizeof (mbs));
-  }
+  operator mbstate_t *() { return &mbs; }
+  void reset () { MEMSET (&mbs, 0, sizeof (mbs)); }
+  mbstate () { reset (); }
 };
 
 struct rxvt_term : rxvt_vars {
index edd381ecb1318d2e6aa6b83e77b3206e3ec6d1b9..f02b1c0a89c80309fcefa02dd84abde29021e183 100644 (file)
@@ -341,7 +341,7 @@ rxvt_color::free (rxvt_display *display)
 #if XFT
   XftColorFree (display->display, display->visual, display->cmap, &c);
 #else
-  XFreeColors (display->display, display->cmap, &c, 1, AllPlanes);
+  XFreeColors (display->display, display->cmap, &p, 1, AllPlanes);
 #endif
 }