Add pointer_grab_start and end functions
Signed-off-by: Chris Michael <cp.michael@samsung.com>
This commit is contained in:
parent
188f472a0d
commit
b0678e5152
|
@ -153,6 +153,31 @@ e_input_pointer_focus_set(E_Input_Pointer *pointer, E_Surface *surface, Evas_Coo
|
|||
wl_signal_emit(&pointer->signals.focus, pointer);
|
||||
}
|
||||
|
||||
EAPI void
|
||||
e_input_pointer_grab_start(E_Input_Pointer *pointer)
|
||||
{
|
||||
if (!pointer) return;
|
||||
|
||||
if ((pointer->grab) && (pointer->grab->interface))
|
||||
{
|
||||
if (pointer->grab->interface->focus)
|
||||
pointer->grab->interface->focus(pointer->grab);
|
||||
}
|
||||
}
|
||||
|
||||
EAPI void
|
||||
e_input_pointer_grab_end(E_Input_Pointer *pointer)
|
||||
{
|
||||
if (!pointer) return;
|
||||
|
||||
pointer->grab = &pointer->default_grab;
|
||||
if ((pointer->grab) && (pointer->grab->interface))
|
||||
{
|
||||
if (pointer->grab->interface->focus)
|
||||
pointer->grab->interface->focus(pointer->grab);
|
||||
}
|
||||
}
|
||||
|
||||
/* local functions */
|
||||
static void
|
||||
_e_input_capabilities_update(E_Input *seat)
|
||||
|
@ -296,7 +321,8 @@ _e_input_pointer_grab_cb_button(E_Input_Pointer_Grab *grab, unsigned int timesta
|
|||
wl_pointer_send_button(res, serial, timestamp, button, state);
|
||||
}
|
||||
|
||||
if ((ptr->button_count == 0) && (state == WL_POINTER_BUTTON_STATE_RELEASED))
|
||||
if ((ptr->grab->button_count == 0) &&
|
||||
(state == WL_POINTER_BUTTON_STATE_RELEASED))
|
||||
{
|
||||
E_Surface *es;
|
||||
|
||||
|
|
|
@ -47,6 +47,14 @@ struct _E_Input_Pointer_Grab
|
|||
{
|
||||
E_Input_Pointer *pointer;
|
||||
E_Input_Pointer_Grab_Interface *interface;
|
||||
|
||||
Evas_Coord x, y;
|
||||
unsigned int button, button_count;
|
||||
unsigned int serial, timestamp;
|
||||
Eina_Bool up : 1;
|
||||
|
||||
struct wl_client *client;
|
||||
struct wl_list surfaces;
|
||||
};
|
||||
|
||||
struct _E_Input_Pointer
|
||||
|
@ -67,10 +75,6 @@ struct _E_Input_Pointer
|
|||
|
||||
E_Input_Pointer_Grab *grab;
|
||||
E_Input_Pointer_Grab default_grab;
|
||||
|
||||
Evas_Coord grab_x, grab_y;
|
||||
unsigned int grab_button, button_count;
|
||||
unsigned int grab_serial, grab_time;
|
||||
};
|
||||
|
||||
EAPI Eina_Bool e_input_init(E_Compositor *comp, E_Input *seat, const char *name);
|
||||
|
@ -80,6 +84,8 @@ EAPI Eina_Bool e_input_keyboard_init(E_Input *seat);
|
|||
EAPI Eina_Bool e_input_touch_init(E_Input *seat);
|
||||
|
||||
EAPI void e_input_pointer_focus_set(E_Input_Pointer *pointer, E_Surface *surface, Evas_Coord x, Evas_Coord y);
|
||||
EAPI void e_input_pointer_grab_start(E_Input_Pointer *pointer);
|
||||
EAPI void e_input_pointer_grab_end(E_Input_Pointer *pointer);
|
||||
|
||||
# endif
|
||||
#endif
|
||||
|
|
Loading…
Reference in New Issue