-- 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: 47f66fb90f6d2bd7e491ff34f188db8cb2554552:
path_to:
revision_to:

git.thebackupbox.net

rxvt-unicode-sixel

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

commit 47f66fb90f6d2bd7e491ff34f188db8cb2554552
Author: Marc Lehmann <schmorp@schmorp.de>
Date:   Thu Dec 18 00:29:29 2003 +0000

    *** empty log message ***

diff --git a/src/command.C b/src/command.C

index 2bf0d6be00791d48d6c2acc70a9948b1b33530d4..

index ..a6dc5be9150d64c09b7f278ebc82f8f5f9c0a39a 100644

--- a/src/command.C
+++ b/src/command.C
@@ -1,7 +1,7 @@
 /*--------------------------------*-C-*---------------------------------*
  * File:	command.c
  *----------------------------------------------------------------------*
- * $Id: command.C,v 1.16 2003/12/17 09:00:35 pcg Exp $
+ * $Id: command.C,v 1.17 2003/12/18 00:29:29 pcg Exp $
  *
  * All portions of code are copyright by their respective author/s.
  * Copyright (c) 1992      John Bovey, University of Kent at Canterbury <jdb@ukc.ac.uk>
@@ -90,19 +90,31 @@ rxvt_lookup_key(pR_ XKeyEvent *ev)
 	Status status_return;

 #ifdef X_HAVE_UTF8_STRING
-	len = Xutf8LookupString(R->Input_Context, ev, (char *)kbuf,
-			      KBUFSZ, &keysym, &status_return);
+	len = Xutf8LookupString (R->Input_Context, ev, (char *)kbuf,
+			         KBUFSZ, &keysym, &status_return);
 #else
-	len = XmbLookupString(R->Input_Context, ev, (char *)kbuf,
-			      KBUFSZ, &keysym, &status_return);
+        wchar_t wkbuf[KBUFSZ + 1];
+
+        // assume wchar_t == unicode or better
+	len = XwcLookupString (R->Input_Context, ev, wkbuf,
+			       KBUFSZ, &keysym, &status_return);
+
+        if (status_return == XLookupChars
+            || status_return == XLookupBoth)
+          {
+            wkbuf[len] = 0;
+            len = wcstombs ((char *)kbuf, wkbuf, KBUFSZ);
+          }
+        else
+          len = 0;
 #endif
-	valid_keysym = ((status_return == XLookupKeySym)
-			|| (status_return == XLookupBoth));
+	valid_keysym = status_return == XLookupKeySym
+		       || status_return == XLookupBoth;
       }
     else
 #endif
       {
-	len = XLookupString(ev, (char *)kbuf, KBUFSZ, &keysym, &R->compose);
+	len = XLookupString (ev, (char *)kbuf, KBUFSZ, &keysym, &R->compose);
 	valid_keysym = !len;
       }

diff --git a/src/init.C b/src/init.C

index 9f47e0df5c93b0e27417ac338720d39e2e84e892..

index ..41a66130548b19c527d739385ba08b792d49cf97 100644

--- a/src/init.C
+++ b/src/init.C
@@ -1,7 +1,7 @@
 /*--------------------------------*-C-*---------------------------------*
  * File:        init.c
  *----------------------------------------------------------------------*
- * $Id: init.C,v 1.11 2003/12/17 09:00:35 pcg Exp $
+ * $Id: init.C,v 1.12 2003/12/18 00:29:29 pcg Exp $
  *
  * All portions of code are copyright by their respective author/s.
  * Copyright (c) 1992      John Bovey, University of Kent at Canterbury <jdb@ukc.ac.uk>
@@ -457,7 +457,7 @@ rxvt_init_secondary (pR)
     }

 #if defined(HAVE_XSETLOCALE) || defined(HAVE_SETLOCALE)
-  R->locale = setlocale (LC_CTYPE, "");
+  R->locale = strdup (setlocale (LC_CTYPE, ""));
 #endif

   /*
diff --git a/src/main.C b/src/main.C

index 9bd56ac677fb6181be1fae29e303c7dd97ed9ae3..

index ..ac61d519886ae43bc8895be6921f39912fdabe63 100644

--- a/src/main.C
+++ b/src/main.C
@@ -1,7 +1,7 @@
 /*--------------------------------*-C-*---------------------------------*
  * File:        main.c
  *----------------------------------------------------------------------*
- * $Id: main.C,v 1.13 2003/12/17 09:00:35 pcg Exp $
+ * $Id: main.C,v 1.14 2003/12/18 00:29:29 pcg Exp $
  *
  * All portions of code are copyright by their respective author/s.
  * Copyright (c) 1992      John Bovey, University of Kent at Canterbury <jdb@ukc.ac.uk>
@@ -79,6 +79,9 @@ rxvt_term::~rxvt_term ()
 {
   scr_release ();

+#if defined(HAVE_XSETLOCALE) || defined(HAVE_SETLOCALE)
+  free (locale);
+#endif
 #ifndef NO_SETOWNER_TTYDEV
   rxvt_privileged_ttydev (this, RESTORE);
 #endif
@@ -1133,6 +1136,11 @@ rxvt_IMInstantiateCallback(Display * unused
   if (R->Input_Context)
     return;

+#if defined(HAVE_XSETLOCALE) || defined(HAVE_SETLOCALE)
+  if (R->rs[Rs_imLocale])
+    setlocale (LC_CTYPE, R->rs[Rs_imLocale]);
+#endif
+
   p = R->rs[Rs_inputMethod];
   if (p && *p)
     {
@@ -1158,18 +1166,24 @@ rxvt_IMInstantiateCallback(Display * unused
       free(s);

       if (found)
-        return;
+        goto done;
     }

 /* try with XMODIFIERS env. var. */
   if ((p = XSetLocaleModifiers ("")) && *p
       && rxvt_IM_get_IC (aR))
-    return;
+    goto done;

 /* try with no modifiers base IF the user didn't specify an IM */
   if ((p = XSetLocaleModifiers ("@im=none")) && *p
       && rxvt_IM_get_IC (aR) == True)
-    return;
+    goto done;
+
+done:
+#if defined(HAVE_XSETLOCALE) || defined(HAVE_SETLOCALE)
+  if (R->rs[Rs_imLocale])
+    setlocale (LC_CTYPE, R->locale);
+#endif
 }

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

index 4015ecb98411827575b6869c3f90d72f5ceffcf1..

index ..4de5ed515573a4ad5bf14c986c175aa1f9945a6d 100644

--- a/src/rxvt.h
+++ b/src/rxvt.h
@@ -1,5 +1,5 @@
 /*
- * $Id: rxvt.h,v 1.12 2003/12/17 09:00:35 pcg Exp $
+ * $Id: rxvt.h,v 1.13 2003/12/18 00:29:29 pcg Exp $
  */

 #ifndef _RXVT_H_                /* include once only */
@@ -554,6 +554,7 @@ enum {
   Rs_cursorBlink,
   Rs_pointerBlank,
   Rs_pointerBlankDelay,
+  Rs_imLocale,
   NUM_RESOURCES
 };

diff --git a/src/xdefaults.C b/src/xdefaults.C

index 6e4fb2e42cf086513292fd4ac6b7d4a2903cfda6..

index ..4abb2c5a5e987cb661537300abc25f9a3c1c73a2 100644

--- a/src/xdefaults.C
+++ b/src/xdefaults.C
@@ -1,7 +1,7 @@
 /*--------------------------------*-C-*---------------------------------*
  * File:	xdefaults.c
  *----------------------------------------------------------------------*
- * $Id: xdefaults.C,v 1.4 2003/12/17 09:00:35 pcg Exp $
+ * $Id: xdefaults.C,v 1.5 2003/12/18 00:29:29 pcg Exp $
  *
  * All portions of code are copyright by their respective author/s.
  * Copyright (c) 1994      Robert Nation <nation@rocket.sanders.lockheed.com>
@@ -200,6 +200,9 @@ static const struct {
     STRG(Rs_inputMethod, "inputMethod", "im", "name", "name of input method"),
     STRG(Rs_preeditType, "preeditType", "pt", "style",
 	 "input style: style = OverTheSpot|OffTheSpot|Root"),
+#if defined(HAVE_XSETLOCALE) || defined(HAVE_SETLOCALE)
+    STRG(Rs_imLocale, "imLocale", "imlocale", "string", "locale to use for input method"),
+#endif
 #endif				/* USE_XIM */
 #ifdef GREEK_SUPPORT
     STRG(Rs_greek_keyboard, "greek_keyboard", "grk", "mode",

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

-- Response ended

-- Page fetched on Sun Jun 2 09:31:44 2024