Re: Ion3 wishlist / a note about Ion4

Tuomo Valkonen <[email protected]>
Newsgroups gmane.comp.window-managers.ion.general
Message-ID <[email protected]>
On 2008-04-30 21:34 +0400, Evgeny Kurbatov wrote:
> Yes.  Such a behaviour I observed since first release if ion3 I used, it
> was far ago (I was too lasy to report this bug).  The bug looks like
> this.  The workspace list binded on Win+W combination and this list
> raised when I press Win+W or Win+Tse (Tse is russian symbol mapped onto
> W key in russian layout).  After list raised I can select something with
> mouse or cursor keys.  The mouse selection works independently on
> current keyboard layout but keyboard selection (i.e. when I press enter
> on needed item) works for default layout only, so if the russian layout
> set, pressing Enter do not lead to any action until I switch keyboard
> layout to default.  This is the bug.

Keys that are not available in the russian layout, clearly can not
be bound then, because the binding mechanism is symbol-based instead
of positional (standard X not offering positional information; that
would demand the piece of crap known as XKb). You should use
Mode_Switch for multiple keymaps (which can be either locking or
or not). However, there also appears to be a bug in keymap refresh
when the keymaps are changed: if I did 'setxkbmap -layout ru' and
then returned to 'fi', some of the keys were gone for good in already
existing frames. The attached patch should fix that.

-- 
Tuomo
refresh.patch (text/plain, 2.2 KB)
Fri May  2 12:45:18 EEST 2008  Tuomo Valkonen <[email protected]>
  * Binding refresh fixes on keymap change
diff -rN -u old-ion-3-work1.1/ioncore/binding.c new-ion-3-work1.1/ioncore/binding.c
--- old-ion-3-work1.1/ioncore/binding.c	2008-05-02 12:45:58.828442190 +0300
+++ new-ion-3-work1.1/ioncore/binding.c	2008-05-02 12:45:58.836440838 +0300
@@ -95,18 +95,13 @@
 }
 
 /* This is only used for searching AnyKey etc. */
-static int compare_bindings_ksb(const WBinding *a, const WBinding *b)
+static int compare_bindings_any(const WBinding *a, const WBinding *b)
 {
-    int r=CVAL(a, b, act);
-    if(r==0){
+    int r=compare_bindings(a, b);
+    
+    if(r==0)
         r=CVAL(a, b, ksb);
-        if(r==0){
-            r=CVAL(a, b, state);
-            if(r==0){
-                r=CVAL(a, b, area);
-            }
-        }
-    }
+    
     return r;
 }
                     
@@ -398,7 +393,7 @@
 
 void binding_ungrab_on(const WBinding *binding, Window win)
 {
-    if(binding->act==BINDING_KEYPRESS){
+    if(binding->act==BINDING_KEYPRESS && binding->kcb!=0){
 #ifndef CF_HACK_IGNORE_EVIL_LOCKS
         XUngrabKey(ioncore_g.dpy, binding->kcb, binding->state, win);
 #else
@@ -444,7 +439,7 @@
 }
 
 
-static WBinding *search_binding_ksb(WBindmap *bindmap, WBinding *binding)
+static WBinding *search_binding_any(WBindmap *bindmap, WBinding *binding)
 {
     Rb_node node;
     int found=0;
@@ -453,7 +448,7 @@
         return NULL;
     
     node=rb_find_gkey_n(bindmap->bindings, binding,
-                        (Rb_compfn*)compare_bindings_ksb, &found);
+                        (Rb_compfn*)compare_bindings_any, &found);
     
     if(found==0)
         return NULL;
@@ -494,13 +489,14 @@
 
         if(binding==NULL){
             tmp.state=state;
+            tmp.kcb=0;
             tmp.ksb=(act==BINDING_KEYPRESS ? AnyKey : AnyButton);
             
-            binding=search_binding_ksb(bindmap, &tmp);
+            binding=search_binding_any(bindmap, &tmp);
 
             if(binding==NULL){
                 tmp.state=AnyModifier;
-                binding=search_binding_ksb(bindmap, &tmp);
+                binding=search_binding_any(bindmap, &tmp);
             }
         }
     }
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.