ecore-x - ensure we fully look at all xkb events and refresh all binds

this ensures for sure that we rebind known key/mouse grabs too for xkb
mapping changes and force a get of the keymaps too

@fix
This commit is contained in:
Carsten Haitzler 2020-05-19 18:41:29 +01:00
parent a030859f67
commit 323eb9fcff
2 changed files with 11 additions and 3 deletions

View File

@ -2540,8 +2540,10 @@ ecore_x_xkb_track_state(void)
{
Eina_Bool ret = EINA_FALSE;
#ifdef ECORE_XKB
unsigned mask = XkbNewKeyboardNotifyMask | XkbMapNotifyMask |
XkbStateNotifyMask | XkbCompatMapNotifyMask;
EINA_SAFETY_ON_NULL_RETURN_VAL(_ecore_x_disp, EINA_FALSE);
ret = XkbSelectEvents(_ecore_x_disp, XkbUseCoreKbd, XkbStateNotifyMask, XkbStateNotifyMask);
ret = XkbSelectEvents(_ecore_x_disp, XkbUseCoreKbd, mask, mask);
if (_ecore_xlib_sync) ecore_x_sync();
#endif
return ret;

View File

@ -2511,10 +2511,16 @@ _ecore_x_event_handle_xkb(XEvent *xevent)
if (xkbev->any.xkb_type == XkbMapNotify)
{
XkbMapNotifyEvent *xkbmapping;
XkbMapNotifyEvent *xkbmapping = (XkbMapNotifyEvent *)xkbev;
xkbmapping = (XkbMapNotifyEvent *)xkbev;
_ecore_x_window_grab_suspend();
_ecore_x_key_grab_suspend();
XkbGetMap(_ecore_x_disp, XkbAllMapComponentsMask,
xkbmapping->device);
XkbRefreshKeyboardMapping(xkbmapping);
_ecore_x_modifiers_get();
_ecore_x_window_grab_resume();
_ecore_x_key_grab_resume();
}
else
{