Skip to content
This repository has been archived by the owner on Sep 22, 2024. It is now read-only.

X11: use xkb x11 to get xkb_state #10

Closed
wants to merge 1 commit into from

Conversation

Pangoraw
Copy link

@Pangoraw Pangoraw commented Feb 3, 2023

This uses XKBXH.xkb_x11_state_new_from_device to get the keyboard state. This solves a problem on X11 where I would have multiple layouts (say us,fr) but the second one (fr) would be selected in Gnome. The previous way to get the keyboard state (xkb_state_new) would return us instead.

  • Tested on all platforms changed
  • Compilation warnings were addressed
  • cargo fmt has been run on this branch
  • cargo doc builds successfully
  • Added an entry to CHANGELOG.md if knowledge of this change could be valuable to users
  • Updated documentation to reflect any user-facing changes, including notes of platform-specific behavior
  • Created or updated an example program if it would help users understand this functionality
  • Updated feature matrix, if new features were added or implemented

@fredizzimo
Copy link
Member

Is this patch included upstream already? If not, perhaps you could open a new PR targeting this branch on winit rust-windowing#2789

@Pangoraw
Copy link
Author

Seems like the PR you linked already uses xkb_x11_state_new_from_device:

let state = (XKBXH.xkb_x11_state_new_from_device)(
keymap,
self.xcb_connection,
self.core_keyboard_id,
);

Is there any effort to sync neovide with upstream winit?

@fredizzimo
Copy link
Member

Yes, we will merge this soon neovide/neovide#1789, which I think already includes the changes you need.

After that I think I will create a special branch that tracks the upstream Keyboard V2 winit branch instead of our fork. The changes there are meant to be included in the next winit release, probably in the end of the summer, so it would be good if we have people testing against that, to make sure it works once the release is out.

@Pangoraw Pangoraw closed this Oct 10, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants