~ubuntu-branches/ubuntu/lucid/libx11/lucid

« back to all changes in this revision

Viewing changes to debian/patches/021_Thai_xim_num_caps.diff

  • Committer: Bazaar Package Importer
  • Author(s): Timo Aaltonen
  • Date: 2009-01-17 16:34:54 UTC
  • mfrom: (1.1.7 upstream)
  • Revision ID: james.westby@ubuntu.com-20090117163454-gaey3cd32xyavueo
Tags: 2:1.1.99.2-1build1
Fakesync with Debian, all previous Ubuntu changes are included
in the new upstream release.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
Index: libx11-1.1.4/modules/im/ximcp/imThaiFlt.c
2
 
===================================================================
3
 
--- libx11-1.1.4.orig/modules/im/ximcp/imThaiFlt.c      2008-07-14 18:13:20.000000000 +0700
4
 
+++ libx11-1.1.4/modules/im/ximcp/imThaiFlt.c   2008-07-14 19:00:10.000000000 +0700
5
 
@@ -1236,6 +1236,22 @@
6
 
     return True;
7
 
 }
8
 
 
9
 
+Private unsigned
10
 
+NumLockMask(Display *d)
11
 
+{
12
 
+    int i;
13
 
+    XModifierKeymap *map = XGetModifierMapping (d);
14
 
+    KeyCode numlock_keycode = XKeysymToKeycode (d, XK_Num_Lock);
15
 
+    if (numlock_keycode == NoSymbol)
16
 
+        return 0;
17
 
+
18
 
+    for (i = 0; i < 8; i++) {
19
 
+        if (map->modifiermap[map->max_keypermod * i] == numlock_keycode)
20
 
+            return 1 << i;
21
 
+    }
22
 
+    return 0;
23
 
+}
24
 
+
25
 
 /*
26
 
  * Filter function for TACTIS
27
 
  */
28
 
@@ -1271,7 +1287,7 @@
29
 
     XwcLookupString((XIC)ic, &ev->xkey, wbuf, sizeof(wbuf) / sizeof(wbuf[0]),
30
 
                    &symbol, NULL);
31
 
 
32
 
-    if ((ev->xkey.state & (AllMods & ~ShiftMask)) ||
33
 
+    if ((ev->xkey.state & (AllMods & ~(ShiftMask|LockMask|NumLockMask(d)))) ||
34
 
          ((symbol >> 8 == 0xFF) &&
35
 
          ((XK_BackSpace <= symbol && symbol <= XK_Clear) ||
36
 
            (symbol == XK_Return) ||