if (state)
{
- if ((input->pointer_focus) && (!input->grab))
+ if ((input->pointer_focus) && (!input->grab) && (!input->grab_count))
{
ecore_wl_input_grab(input, input->pointer_focus, button);
input->grab_timestamp = timestamp;
if (input->pointer_focus)
_ecore_wl_input_mouse_down_send(input, input->pointer_focus,
0, button, timestamp);
+ input->grab_count++;
}
else
{
_ecore_wl_input_mouse_up_send(input, input->pointer_focus,
0, button, timestamp);
- if ((input->grab) && (input->grab_button == button) && (!state))
+ input->grab_count--;
+ if (input->grab_count < 0)
+ input->grab_count = 0;
+ if ((input->grab) && (input->grab_button == button) && (!state) && (!input->grab_count))
ecore_wl_input_ungrab(input);
}
input->sx = wl_fixed_to_int(x);
input->sy = wl_fixed_to_int(y);
- _ecore_wl_input_mouse_move_send(input, input->touch_focus, timestamp, id);
- _ecore_wl_input_cb_pointer_enter(data, NULL, serial, surface, x, y);
- if ((input->touch_focus) && (!input->grab))
+ //_ecore_wl_input_mouse_move_send(input, input->touch_focus, timestamp, id);
+ if (!input->grab_count)
{
- ecore_wl_input_grab(input, input->touch_focus, BTN_LEFT);
- input->grab_timestamp = timestamp;
+ _ecore_wl_input_cb_pointer_enter(data, NULL, serial, surface, x, y);
+ if ((input->touch_focus) && (!input->grab))
+ {
+ ecore_wl_input_grab(input, input->touch_focus, BTN_LEFT);
+ input->grab_timestamp = timestamp;
+ }
}
_ecore_wl_input_mouse_down_send(input, input->touch_focus,
id, BTN_LEFT, timestamp);
+
+ input->grab_count++;
}
static void
input->display->serial = serial;
_ecore_wl_input_mouse_up_send(input, input->touch_focus, id, BTN_LEFT, timestamp);
- if ((input->grab) && (input->grab_button == BTN_LEFT))
+ input->grab_count--;
+ if (input->grab_count < 0)
+ input->grab_count = 0;
+ if ((input->grab) && (input->grab_button == BTN_LEFT) && (!input->grab_count))
ecore_wl_input_ungrab(input);
}