Ви не можете вибрати більше 25 тем Теми мають розпочинатися з літери або цифри, можуть містити дефіси (-) і не повинні перевищувати 35 символів.

dont-forward-keycode-0.patch 1.7KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. --- libX11-1.0.3/modules/im/ximcp/imDefLkup.c.dont-forward-keycode-0 2006-06-22 17:22:22.000000000 -0400
  2. +++ libX11-1.0.3/modules/im/ximcp/imDefLkup.c 2006-09-20 17:57:49.000000000 -0400
  3. @@ -332,6 +332,17 @@
  4. XEvent *ev,
  5. Bool sync)
  6. {
  7. + /*
  8. + * Don't forward a key event which has keycode=0.
  9. + * keycode=0 is reserved for special purpose to let Xmb/wcLookupString()
  10. + * functions know that there is a commited string available from IM.
  11. + */
  12. + if (((ev->type == KeyPress) || (ev->type == KeyRelease))) {
  13. + if (((XKeyEvent *)ev)->keycode == 0) {
  14. + return True;
  15. + }
  16. + }
  17. +
  18. #ifdef EXT_FORWARD
  19. if (((ev->type == KeyPress) || (ev->type == KeyRelease)))
  20. if (_XimExtForwardKeyEvent(ic, (XKeyEvent *)ev, sync))
  21. @@ -605,6 +616,19 @@
  22. Xfree(info->keysym);
  23. ic->private.proto.commit_info = info->next;
  24. Xfree(info);
  25. +
  26. + /*
  27. + * "Commit" uses fabricated flag to process a commited string
  28. + * from IM engine.
  29. + * Turn off the fabricated flag here (unregister the commited
  30. + * information function). Otherwise, next regular key press
  31. + * event will be ignored at _XimProtoKeypressFilter() and it
  32. + * will not be passed to IM engine.
  33. + */
  34. + if (IS_FABLICATED(ic)) {
  35. + UNMARK_FABLICATED(ic);
  36. + }
  37. +
  38. return;
  39. }
  40. --- libX11-1.0.3/modules/im/ximcp/imDefFlt.c.dont-forward-keycode-0 2006-06-22 17:22:22.000000000 -0400
  41. +++ libX11-1.0.3/modules/im/ximcp/imDefFlt.c 2006-09-20 17:57:49.000000000 -0400
  42. @@ -147,7 +147,7 @@
  43. Xim im = (Xim)ic->core.im;
  44. #endif
  45. - if (IS_FABLICATED(ic)) {
  46. + if ((ev->keycode == 0) || IS_FABLICATED(ic)) {
  47. _XimPendingFilter(ic);
  48. UNMARK_FABLICATED(ic);
  49. return NOTFILTERD;