_ecore_window_grabs[_ecore_window_grabs_num - 1].any_mod = any_mod;
}
-void
-_ecore_x_sync_magic_send(int val,
- Ecore_X_Window swin)
+static void
+_ecore_x_sync_magic_send(int val, Ecore_X_Window swin, int b, int mod, int anymod)
{
XEvent xev;
xev.xclient.format = 32;
xev.xclient.message_type = 27777;
xev.xclient.data.l[0] = 0x7162534;
- xev.xclient.data.l[1] = 0x10000000 + val;
+ xev.xclient.data.l[1] = val | (anymod << 8);
xev.xclient.data.l[2] = swin;
- xev.xclient.data.l[3] = 0;
- xev.xclient.data.l[4] = 0;
+ xev.xclient.data.l[3] = b;
+ xev.xclient.data.l[4] = mod;
XSendEvent(_ecore_x_disp, _ecore_x_private_win, False, NoEventMask, &xev);
}
int any_mod)
{
_ecore_x_window_button_ungrab_internal(win, button, mod, any_mod);
- _ecore_x_sync_magic_send(1, win);
- _ecore_x_window_grab_remove(win, button, mod, any_mod);
+ _ecore_x_sync_magic_send(1, win, button, mod, any_mod);
+// _ecore_x_window_grab_remove(win, button, mod, any_mod);
}
void _ecore_x_window_grab_suspend(void)
int any_mod)
{
_ecore_x_window_key_ungrab_internal(win, key, mod, any_mod);
- _ecore_x_sync_magic_send(2, win);
- _ecore_x_key_grab_remove(win, key, mod, any_mod);
+ _ecore_x_sync_magic_send(2, win, XStringToKeysym(key), mod, any_mod);
+// _ecore_x_key_grab_remove(win, key, mod, any_mod);
}
void
&& (xevent->xclient.format == 32)
&& (xevent->xclient.window == _ecore_x_private_win))
{
+ int val = xevent->xclient.data.l[1] & 0xff;
+ int anymod = (xevent->xclient.data.l[1] >> 8) & 0xff;
+ int mod = xevent->xclient.data.l[4];
+ int b = xevent->xclient.data.l[3];
+ Ecore_X_Window swin = xevent->xclient.data.l[2];
+
/* a grab sync marker */
- if (xevent->xclient.data.l[1] == 0x10000001)
- _ecore_x_window_grab_remove(xevent->xclient.data.l[2], -1, 0, 0);
- else if (xevent->xclient.data.l[1] == 0x10000002)
- _ecore_x_key_grab_remove(xevent->xclient.data.l[2], NULL, 0, 0);
+ if (val == 1)
+ {
+ _ecore_x_window_grab_remove(swin, b, mod, anymod);
+ }
+ else if (val == 2)
+ {
+ const char *str;
+
+ str = ecore_x_keysym_string_get(b);
+ if (str) _ecore_x_key_grab_remove(swin, str, mod, anymod);
+ }
}
else
{