@ -162,11 +162,17 @@ default_grab_button(struct weston_pointer_grab *grab,
}
}
}
}
static void
default_grab_pointer_cancel ( struct weston_pointer_grab * grab )
{
}
static const struct weston_pointer_grab_interface
static const struct weston_pointer_grab_interface
default_pointer_grab_interface = {
default_pointer_grab_interface = {
default_grab_focus ,
default_grab_focus ,
default_grab_motion ,
default_grab_motion ,
default_grab_button
default_grab_button ,
default_grab_pointer_cancel ,
} ;
} ;
static void
static void
@ -225,10 +231,16 @@ default_grab_touch_motion(struct weston_touch_grab *grab, uint32_t time,
}
}
}
}
static void
default_grab_touch_cancel ( struct weston_touch_grab * grab )
{
}
static const struct weston_touch_grab_interface default_touch_grab_interface = {
static const struct weston_touch_grab_interface default_touch_grab_interface = {
default_grab_touch_down ,
default_grab_touch_down ,
default_grab_touch_up ,
default_grab_touch_up ,
default_grab_touch_motion
default_grab_touch_motion ,
default_grab_touch_cancel ,
} ;
} ;
static void
static void
@ -329,10 +341,16 @@ default_grab_modifiers(struct weston_keyboard_grab *grab, uint32_t serial,
}
}
}
}
static void
default_grab_keyboard_cancel ( struct weston_keyboard_grab * grab )
{
}
static const struct weston_keyboard_grab_interface
static const struct weston_keyboard_grab_interface
default_keyboard_grab_interface = {
default_keyboard_grab_interface = {
default_grab_key ,
default_grab_key ,
default_grab_modifiers ,
default_grab_modifiers ,
default_grab_keyboard_cancel ,
} ;
} ;
static void
static void
@ -601,6 +619,12 @@ weston_keyboard_end_grab(struct weston_keyboard *keyboard)
keyboard - > grab = & keyboard - > default_grab ;
keyboard - > grab = & keyboard - > default_grab ;
}
}
static void
weston_keyboard_cancel_grab ( struct weston_keyboard * keyboard )
{
keyboard - > grab - > interface - > cancel ( keyboard - > grab ) ;
}
WL_EXPORT void
WL_EXPORT void
weston_pointer_start_grab ( struct weston_pointer * pointer ,
weston_pointer_start_grab ( struct weston_pointer * pointer ,
struct weston_pointer_grab * grab )
struct weston_pointer_grab * grab )
@ -617,6 +641,12 @@ weston_pointer_end_grab(struct weston_pointer *pointer)
pointer - > grab - > interface - > focus ( pointer - > grab ) ;
pointer - > grab - > interface - > focus ( pointer - > grab ) ;
}
}
static void
weston_pointer_cancel_grab ( struct weston_pointer * pointer )
{
pointer - > grab - > interface - > cancel ( pointer - > grab ) ;
}
WL_EXPORT void
WL_EXPORT void
weston_touch_start_grab ( struct weston_touch * touch , struct weston_touch_grab * grab )
weston_touch_start_grab ( struct weston_touch * touch , struct weston_touch_grab * grab )
{
{
@ -630,6 +660,12 @@ weston_touch_end_grab(struct weston_touch *touch)
touch - > grab = & touch - > default_grab ;
touch - > grab = & touch - > default_grab ;
}
}
static void
weston_touch_cancel_grab ( struct weston_touch * touch )
{
touch - > grab - > interface - > cancel ( touch - > grab ) ;
}
WL_EXPORT void
WL_EXPORT void
weston_pointer_clamp ( struct weston_pointer * pointer , wl_fixed_t * fx , wl_fixed_t * fy )
weston_pointer_clamp ( struct weston_pointer * pointer , wl_fixed_t * fx , wl_fixed_t * fy )
{
{
@ -1139,10 +1175,7 @@ notify_keyboard_focus_out(struct weston_seat *seat)
}
}
weston_keyboard_set_focus ( keyboard , NULL ) ;
weston_keyboard_set_focus ( keyboard , NULL ) ;
/* FIXME: We really need keyboard grab cancel here to
weston_keyboard_cancel_grab ( keyboard ) ;
* let the grab shut down properly . As it is we leak
* the grab data . */
weston_keyboard_end_grab ( keyboard ) ;
}
}
WL_EXPORT void
WL_EXPORT void
@ -1798,6 +1831,7 @@ weston_seat_release_keyboard(struct weston_seat *seat)
seat - > keyboard_device_count - - ;
seat - > keyboard_device_count - - ;
if ( seat - > keyboard_device_count = = 0 ) {
if ( seat - > keyboard_device_count = = 0 ) {
weston_keyboard_set_focus ( seat - > keyboard , NULL ) ;
weston_keyboard_set_focus ( seat - > keyboard , NULL ) ;
weston_keyboard_cancel_grab ( seat - > keyboard ) ;
seat_send_updated_caps ( seat ) ;
seat_send_updated_caps ( seat ) ;
}
}
}
}
@ -1835,6 +1869,7 @@ weston_seat_release_pointer(struct weston_seat *seat)
weston_pointer_set_focus ( pointer , NULL ,
weston_pointer_set_focus ( pointer , NULL ,
wl_fixed_from_int ( 0 ) ,
wl_fixed_from_int ( 0 ) ,
wl_fixed_from_int ( 0 ) ) ;
wl_fixed_from_int ( 0 ) ) ;
weston_pointer_cancel_grab ( pointer ) ;
if ( pointer - > sprite )
if ( pointer - > sprite )
pointer_unmap_sprite ( pointer ) ;
pointer_unmap_sprite ( pointer ) ;
@ -1872,6 +1907,7 @@ weston_seat_release_touch(struct weston_seat *seat)
seat - > touch_device_count - - ;
seat - > touch_device_count - - ;
if ( seat - > touch_device_count = = 0 ) {
if ( seat - > touch_device_count = = 0 ) {
weston_touch_set_focus ( seat , NULL ) ;
weston_touch_set_focus ( seat , NULL ) ;
weston_touch_cancel_grab ( seat - > touch ) ;
seat_send_updated_caps ( seat ) ;
seat_send_updated_caps ( seat ) ;
}
}
}
}