X-Git-Url: https://git.decadent.org.uk/gitweb/?a=blobdiff_plain;f=mod_query%2Fquery.c;fp=mod_query%2Fquery.c;h=9318c897144d91e510d75734a15b8fbb1940b7f4;hb=803afbc1cd633f6c025bcd9537e9b7e9aedadd0d;hp=b56c087a4b24bc5d8e108af305927c71bbca053b;hpb=8366314611bf30a0f31d25bf5f5023186fa87692;p=ion3.git diff --git a/mod_query/query.c b/mod_query/query.c index b56c087..9318c89 100644 --- a/mod_query/query.c +++ b/mod_query/query.c @@ -1,7 +1,7 @@ /* * ion/mod_query/query.c * - * Copyright (c) Tuomo Valkonen 1999-2006. + * Copyright (c) Tuomo Valkonen 1999-2007. * * Ion is free software; you can redistribute it and/or modify it under * the terms of the GNU Lesser General Public License as published by @@ -20,7 +20,7 @@ #include "wedln.h" -static void create_cycle_binding(WEdln *wedln, XKeyEvent *ev, ExtlFn cycle) +static void create_cycle_binding(WEdln *wedln, uint kcb, uint state, ExtlFn cycle) { WBindmap *bindmap=create_bindmap(); WBinding b; @@ -28,9 +28,9 @@ static void create_cycle_binding(WEdln *wedln, XKeyEvent *ev, ExtlFn cycle) if(bindmap==NULL) return; - b.ksb=XKeycodeToKeysym(ioncore_g.dpy, ev->keycode, 0); - b.kcb=ev->keycode; - b.state=ev->state; + b.ksb=XKeycodeToKeysym(ioncore_g.dpy, kcb, 0); + b.kcb=kcb; + b.state=state; b.act=BINDING_KEYPRESS; b.area=0; b.wait=FALSE; @@ -67,7 +67,6 @@ WEdln *mod_query_do_query(WMPlex *mplex, const char *prompt, const char *dflt, WRectangle geom; WEdlnCreateParams fnp; WMPlexAttachParams par; - XKeyEvent *ev=ioncore_current_key_event(); WEdln *wedln; fnp.prompt=prompt; @@ -85,9 +84,13 @@ WEdln *mod_query_do_query(WMPlex *mplex, const char *prompt, const char *dflt, (WRegionCreateFn*)create_wedln, (void*)&fnp); - if(wedln!=NULL && ev!=NULL && cycle!=extl_fn_none()) - create_cycle_binding(wedln, ev, cycle); + if(wedln!=NULL && cycle!=extl_fn_none()){ + uint kcb, state; + bool sub; + if(ioncore_current_key(&kcb, &state, &sub) && !sub) + create_cycle_binding(wedln, kcb, state, cycle); + } return wedln; }