Skip to content
GitLab
Projects Groups Snippets
  • /
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in / Register
  • libX11 libX11
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 77
    • Issues 77
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 9
    • Merge requests 9
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
  • Deployments
    • Deployments
    • Environments
    • Releases
  • Packages and registries
    • Packages and registries
    • Container Registry
  • Monitor
    • Monitor
    • Incidents
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Repository
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • xorgxorg
  • lib
  • libX11libX11
  • Merge requests
  • !78

Fix off-by-one error in XKeycodeToKeysym

  • Review changes

  • Download
  • Email patches
  • Plain diff
Merged Adam Sampson requested to merge atsampson/libx11:keycodefix into master Jul 04, 2021
  • Overview 1
  • Commits 1
  • Pipelines 3
  • Changes 1

The code in XKeycodeToKeysym that made indexes greater than 3 refer to XKB symbol groups had an off-by-one error, so it would always leave out the symbol that should have been at index 4. Rewrite the code to fix this and simplify the logic a bit.

This was originally diagnosed by firk in bugs.freedesktop.org 5349, which was migrated to GitLab as #97 (closed).

Using the XKeycodeToKeysym.c testcase from that bug, with a French keymap (setxkbmap fr), here's the original output:

0 22 
1 33 
2 0 
3 0 
4 A3 
5 0 
6 0 
7 0 
8 0 

And here's the output with this patch applied (note 23 is now included in the right place):

0 22 
1 33 
2 0 
3 0 
4 23 
5 A3 
6 0 
7 0 
8 0 

Fixes #97 (closed).

Edited Dec 10, 2021 by Adam Sampson
Assignee
Assign to
Reviewers
Request review from
Time tracking
Source branch: keycodefix