<div dir="auto">Forgot to paste the MR.<div dir="auto"><br><div dir="auto"><a href="https://gitlab.freedesktop.org/wayland/weston/merge_requests/257">https://gitlab.freedesktop.org/wayland/weston/merge_requests/257</a><br></div><div dir="auto"><br></div><div dir="auto">Thanks,</div><div dir="auto">Sichem</div><div dir="auto"><br></div></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">Le ven. 30 août 2019 22 h 01, Sichem Zhou <<a href="mailto:sichem.zh@gmail.com">sichem.zh@gmail.com</a>> a écrit :<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="auto">Hi,<div dir="auto"><br></div><div dir="auto">I hope to make a follow up to this thread. I made a change and submitted to MR but it seemed to gain little interest so I am trying my luck here. </div><div dir="auto"><br></div><div dir="auto">My problem is that I need to change `xkb_keymap` in the Weston run time, though it is certainly do able though weston_seat_update_keymap, but I found it is cleaner to do it through the exposed API `weston_compositor_set_xkb_rule_names`. So I modified it a little bit to call `weston_seat_update_keymap` internally. My test indicates it seemed to work well so I hope it's a valid change to be merged. Or if there is any problems I hope to have some feedbacks.</div><div dir="auto"><br></div><div dir="auto">Thanks,</div><div dir="auto">Sichem</div><br><br><div class="gmail_quote" dir="auto"><div dir="ltr" class="gmail_attr">Le lun. 26 août 2019 20 h 41, Sichem Zhou <<a href="mailto:sichem.zh@gmail.com" target="_blank" rel="noreferrer">sichem.zh@gmail.com</a>> a écrit :<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="auto"><div><br><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">Le lun. 26 août 2019 12 h 06, Daniel Stone <<a href="mailto:daniel@fooishbar.org" rel="noreferrer noreferrer noreferrer" target="_blank">daniel@fooishbar.org</a>> a écrit :<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hi Sichem,<br>
<br>
On Mon, 26 Aug 2019 at 16:31, Sichem Zhou <<a href="mailto:sichem.zh@gmail.com" rel="noreferrer noreferrer noreferrer noreferrer" target="_blank">sichem.zh@gmail.com</a>> wrote:<br>
> Le lun. 26 août 2019 07 h 30, Daniel Stone <<a href="mailto:daniel@fooishbar.org" rel="noreferrer noreferrer noreferrer noreferrer" target="_blank">daniel@fooishbar.org</a>> a écrit :<br>
>> On Mon, 26 Aug 2019 at 02:38, Sichem Zhou <<a href="mailto:sichem.zh@gmail.com" rel="noreferrer noreferrer noreferrer noreferrer" target="_blank">sichem.zh@gmail.com</a>> wrote:<br>
>> > I found that currently there is no way to change `xkb_keymap` after Weston is running.<br>
>> ><br>
>> > By different backends, xkb_info in wayland works differently, for example, the wayland and x11 backend, weston_keyboard is initialized with whatever the xkb_rules initialized in current environment and they do not use global xkb_info. While in DRM backend, all weston_keyboards seem to use the global keymap. It can be changed by setting up `weston_compositor_set_xkb_rules` before `weston_compositor_wake`. After that, there is nothing I can do. It is used to be possible to call `weston_seat_update_keymap`, but It is now an internal API. Even by that I think it would be a nasty way to change keymap.<br>
>> ><br>
>> > I am wondering why in weston_compositor_set_xkb_rules, there is only updates for rules itself rather than updating `compositor->xkb_info`. If possible, I think it should be a quick fix, I can submit a MR for it.<br>
>><br>
>> Sure. But why do you say that `weston_seat_update_keymap` is a 'nasty'<br>
>> way to change it?<br>
><br>
> Sorry for the language, yesterday when I was quite confused when I was reading the keyboard handling in weston. If I am getting this right, In the beginning keyboard is using global xkb_info, but once we called `weston_seat_update_keymap`. Keyboards will create their own xkb_info. Leaves the global xkb_info useless. I guess that is why `weston_seat_update_keymap` was never called directly from a compositor.<br>
<br>
No problem. And yes, you're right - at the moment you'd be the only<br>
person changing the keymap at runtime. `weston_seat_update_keymap` is<br>
definitely something we could re-export, as that's the correct way to<br>
do it.<br></blockquote></div></div><div dir="auto"><br></div><div dir="auto">Thanks for your reply, I just submitted a new MR for this, I found that the `compositor->xkb_info` is kind of redundant since most of backend is not using it and </div><div dir="auto">weston_compositor_building_global_keymap is creating new keymap anyway, so keyboards are not sharing global xkb_info. We should actually get rid of this field and have every keyboard take control of its xkb_info.<br></div><div dir="auto"><br></div><div dir="auto"><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Cheers,<br>
Daniel<br></blockquote></div></div><div dir="auto">Regards,</div><div dir="auto">Sichem</div><div dir="auto"><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
</blockquote></div></div></div>
</blockquote></div></div>
</blockquote></div>