Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Using unmapped keysyms causes "X Error of failed request: BadValue" #393

Closed
matthijskooijman opened this issue Nov 23, 2020 · 5 comments
Closed
Assignees
Milestone

Comments

@matthijskooijman
Copy link
Contributor

Describe the bug

When using the following gesture, I get "X Error of failed request: BadValue"

    <gesture type="PINCH" fingers="3" direction="OUT">
      <action type="SEND_KEYS">
        <repeat>true</repeat>
        <keys>XF86ZoomIn</keys>
      </action>
    </gesture>

The output is:

Gesture begin detected
        Gesture information:
                Fingers: 3
                Type: PINCH
                Direction: OUT
        Gesture performed on app: UXTerm
        Action configured for this gesture
        Starting action
Gesture update detected (7%)
Gesture update detected (9%)
Gesture update detected (12%)
Gesture update detected (16%)
Gesture update detected (19%)
Gesture update detected (20%)
X Error of failed request:  BadValue (integer parameter out of range for operation)
  Major opcode of failed request:  132 (XTEST)
  Minor opcode of failed request:  2 (X_XTestFakeInput)
  Value in failed request:  0x0
  Serial number of failed request:  24
  Current serial number in output stream:  26

Cause

The problem does not seem to be that the keysym is unknown or unsupported, since that causes different behaviour (See #392). Instead, the problem seems to be that touchegg uses the XTestFakeInput request, which can fake keycodes, not keysyms. In this case, the keysym I'm using is not mapped (xmodmap -pk|grep ZoomIn), so I guess there's no way for touchegg to fake that keysym.

This is confirmed by running xmodmap -e 'keycode any=XF86ZoomIn' to map the symbol, after which the gesture works as expected.

Expected behavior

Rather than crashing, touchegg should probably show an error message (similar to #392). In this case, the error message should probably not be given at startup (or maybe only a warning), since the user might have some custom xmodmap in their startup script that could run after touchegg is started.

It might be even more friendly if touchegg would just take care of mapping any keys that have not been mapped to a free keycode, like the xmodmap command above.

Your environment

  • Version of Touchégg: 2.0.3
  • Operating System: Ubuntu
  • Desktop Environment: Gnome
@matthijskooijman
Copy link
Contributor Author

Note PR #394, which documents the limitation of only being able to use mapped keysyms (but this issue stays relevant for actually handling unmapped keysyms more elegantly, or even removing this limitation entirely).

@JoseExposito
Copy link
Owner

Thanks for the report!

@JoseExposito JoseExposito added this to the 2.0.5 milestone Jan 4, 2021
@JoseExposito JoseExposito self-assigned this Jan 4, 2021
@matthijskooijman
Copy link
Contributor Author

Looks good, thanks!

@matthijskooijman
Copy link
Contributor Author

Hm, looking again: Maybe it would be better to say "Unknown or unmapped key" to make it more explicit that the mapping might be problematic? Or even better, show a different message in both situations so people know they might have made a typo (or did not make a typo when the key is known but unmapped)?

@JoseExposito
Copy link
Owner

I'd rather prefer to keep the message simple and understandable for not advanced users. Everyone knows what's a shortcut, but keysyms and keycodes are a little bit more advanced topics.
The natural step is to double check for typos or go to the docs, where you added detailed instructions of how to solve this problems 😄

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants