_ecore_x_event_handle_mapping_notify(XEvent *xevent)
{
Ecore_X_Event_Mapping_Change *e;
+ static unsigned long last_serial;
+ int type;
_ecore_x_last_event_mouse_move = 0;
- _ecore_x_window_grab_suspend();
- _ecore_x_key_grab_suspend();
-
- XRefreshKeyboardMapping((XMappingEvent *)xevent);
- _ecore_x_modifiers_get();
-
- _ecore_x_window_grab_resume();
- _ecore_x_key_grab_resume();
- e = calloc(1, sizeof(Ecore_X_Event_Mapping_Change));
- if (!e) return;
switch (xevent->xmapping.request)
{
case MappingModifier:
- e->type = ECORE_X_MAPPING_MODIFIER;
+ type = ECORE_X_MAPPING_MODIFIER;
break;
case MappingKeyboard:
- e->type = ECORE_X_MAPPING_KEYBOARD;
+ if ((last_serial && (xevent->xmapping.serial == last_serial))) return;
+ type = ECORE_X_MAPPING_KEYBOARD;
+ last_serial = xevent->xmapping.serial;
break;
case MappingPointer:
default:
- e->type = ECORE_X_MAPPING_MOUSE;
+ type = ECORE_X_MAPPING_MOUSE;
break;
}
+
+ _ecore_x_window_grab_suspend();
+ _ecore_x_key_grab_suspend();
+
+ XRefreshKeyboardMapping((XMappingEvent *)xevent);
+ _ecore_x_modifiers_get();
+
+ _ecore_x_window_grab_resume();
+ _ecore_x_key_grab_resume();
+ e = calloc(1, sizeof(Ecore_X_Event_Mapping_Change));
+ if (!e) return;
+ e->type = type;
e->keycode = xevent->xmapping.first_keycode;
e->num = xevent->xmapping.count;
ecore_event_add(ECORE_X_EVENT_MAPPING_CHANGE, e, NULL, NULL);
if (gl) gl = strdup(gl);
setenv("ELM_ACCEL", "gl", 1);
}
- exe = ecore_exe_run(cmd, c);
+ exe = ecore_exe_pipe_run(cmd, ECORE_EXE_TERM_WITH_PARENT, c);
if (disp) setenv("DISPLAY", disp, 1);
if (env) setenv("WAYLAND_DISPLAY", env, 1);
else unsetenv("WAYLAND_DISPLAY");