use set_keymap and get_keymap to proper handle keymap#1903
use set_keymap and get_keymap to proper handle keymap#1903Bot-wxt1221 wants to merge 2 commits intoSmithay:masterfrom
Conversation
3d6c503 to
a9a6e0a
Compare
a9a6e0a to
a659a34
Compare
67f4c7e to
b114ff2
Compare
b114ff2 to
3bd3c18
Compare
05bd7d2 to
fd505bc
Compare
|
Seems this PR is necessary to unbreak wtype that broke after the last virtual keyboard PR. @Bot-wxt1221 with this PR, wtype works for clients, but for compositor binds it still uses the wrong keymap. I'm actually not sure what's happening. In winit backend, inside the If I do |
721e9ca to
13e102c
Compare
43ef44c to
e18b18b
Compare
6cb3229 to
f785d4d
Compare
|
@YaLTeR Fixed. |
f785d4d to
f4847ab
Compare
YaLTeR
left a comment
There was a problem hiding this comment.
- wvkbd no longer gets key stuck
- but wtype is now unable to invoke compositor actions with modifiers. Here's WAYLAND_DEBUG for
wtype -M alt -k r -m alt:
[1616354.165] {Default Queue} -> zwp_virtual_keyboard_manager_v1#3.create_virtual_keyboard(wl_seat#4, new id zwp_virtual_keyboard_v1#5)
[1616354.231] {Default Queue} -> zwp_virtual_keyboard_v1#5.keymap(1, fd 5, 229)
[1616354.238] {Default Queue} -> wl_display#1.sync(new id wl_callback#6)
[1616359.209] {Display Queue} wl_display#1.delete_id(6)
[1616359.219] {Default Queue} wl_callback#6.done(0)
[1616359.242] {Default Queue} -> zwp_virtual_keyboard_v1#5.modifiers(8, 0, 0, 0)
[1616359.252] {Default Queue} -> wl_display#1.sync(new id wl_callback#6)
[1616365.517] {Display Queue} wl_display#1.delete_id(6)
[1616365.527] {Default Queue} wl_callback#6.done(0)
[1616365.533] {Default Queue} -> zwp_virtual_keyboard_v1#5.key(0, 1, 1)
[1616365.538] {Default Queue} -> wl_display#1.sync(new id wl_callback#6)
[1616369.365] {Display Queue} wl_display#1.delete_id(6)
[1616369.375] {Default Queue} wl_callback#6.done(0)
[1616371.443] {Default Queue} -> zwp_virtual_keyboard_v1#5.key(0, 1, 0)
[1616371.453] {Default Queue} -> wl_display#1.sync(new id wl_callback#6)
[1616375.324] {Display Queue} wl_display#1.delete_id(6)
[1616375.335] {Default Queue} wl_callback#6.done(0)
[1616377.618] {Default Queue} -> zwp_virtual_keyboard_v1#5.modifiers(0, 0, 0, 0)
[1616377.633] {Default Queue} -> wl_display#1.sync(new id wl_callback#6)
[1616381.680] {Display Queue} wl_display#1.delete_id(6)
[1616381.701] {Default Queue} wl_callback#6.done(0)
[1616381.709] {Default Queue} -> zwp_virtual_keyboard_v1#5.destroy()
This just types "r" instead of resizing the window with Alt-r
1c40760 to
0cd467a
Compare
|
@YaLTeR Fixed again. |
f9db7f4 to
c63b655
Compare
|
On the latest push, I checked wtype and wvkbd and I couldn't break it. |
|
@PolyMeilex could you review this? |
|
Are there any work to do? |
|
So 2 solutions here. 1. Revert previous one(It is just ok) and focus on rewriting(I would help with dorotac) 2. Finding a balance to fix most of problems. |
This allows setting a pre-compiled keymap while ensuring the keymap was created under the same keyboard handle, and more importantly, the same xkbcommon context within the same thread.
c63b655 to
cbc22d7
Compare
cbc22d7 to
f1e43ae
Compare
|
I'll be totally honest, I have no idea what's going on in this code. It was foolish of me to assume that I do, during #1803 review 😄 It all seems to be disproportionately complex for what it does, which might suggest a deeper design flaw unrelated to the bug at hand. So I would be leaning towards just reverting the first PR ( Sorry that I don't have time currently to properly research this stuff. |
f1e43ae to
6ed90bd
Compare
6ed90bd to
f1e43ae
Compare
|
@PolyMeilex But I have to say that no compositer impl this properly. And you can verify it solve all exist problem. Yet we're in a big hole, but at least It seems that we can stop at here. |
WM need keymap to process input. So change_keymap is neccessary.Follow by #1803.
Fix #1926
Applied #1907 (I changed it a little bit as I was overflowded by the complie error. I wonder if it's the best practice.)
Problem mainly on niri-wm/niri#2314
Current impl is stupid. The correct way should be simulate a virtual keyboard handler like libinput backend.But I have no interest in it. So let's just make it possible to solve all issue.I believe it will solve all the problem.
By the way, I'm not familiar with rust so maybe a rust expert should review my code.
UPD: modifiers is much more natural and effective in my opinion.