mirror of
https://github.com/brl/mutter.git
synced 2024-11-25 09:30:45 -05:00
pointer/keyboard: Do a series of renames to our listener as well
This commit is contained in:
parent
2e7a56a28f
commit
515dc08a97
@ -222,10 +222,9 @@ err_keymap_str:
|
||||
}
|
||||
|
||||
static void
|
||||
lose_keyboard_focus (struct wl_listener *listener, void *data)
|
||||
keyboard_handle_focus_surface_destroy (struct wl_listener *listener, void *data)
|
||||
{
|
||||
MetaWaylandKeyboard *keyboard =
|
||||
wl_container_of (listener, keyboard, focus_listener);
|
||||
MetaWaylandKeyboard *keyboard = wl_container_of (listener, keyboard, focus_surface_listener);
|
||||
|
||||
keyboard->focus_resource = NULL;
|
||||
keyboard->focus = NULL;
|
||||
@ -340,7 +339,7 @@ meta_wayland_keyboard_init (MetaWaylandKeyboard *keyboard,
|
||||
|
||||
wl_list_init (&keyboard->resource_list);
|
||||
wl_array_init (&keyboard->keys);
|
||||
keyboard->focus_listener.notify = lose_keyboard_focus;
|
||||
keyboard->focus_surface_listener.notify = keyboard_handle_focus_surface_destroy;
|
||||
keyboard->default_grab.interface = &default_keyboard_grab_interface;
|
||||
keyboard->default_grab.keyboard = keyboard;
|
||||
keyboard->grab = &keyboard->default_grab;
|
||||
@ -522,7 +521,7 @@ meta_wayland_keyboard_set_focus (MetaWaylandKeyboard *keyboard,
|
||||
struct wl_display *display = wl_client_get_display (client);
|
||||
serial = wl_display_next_serial (display);
|
||||
wl_keyboard_send_leave (resource, serial, keyboard->focus->resource);
|
||||
wl_list_remove (&keyboard->focus_listener.link);
|
||||
wl_list_remove (&keyboard->focus_surface_listener.link);
|
||||
|
||||
meta_wayland_surface_focused_unset (keyboard->focus);
|
||||
}
|
||||
@ -557,7 +556,7 @@ meta_wayland_keyboard_set_focus (MetaWaylandKeyboard *keyboard,
|
||||
wl_keyboard_send_enter (resource, serial, surface->resource,
|
||||
&keyboard->keys);
|
||||
}
|
||||
wl_resource_add_destroy_listener (resource, &keyboard->focus_listener);
|
||||
wl_resource_add_destroy_listener (resource, &keyboard->focus_surface_listener);
|
||||
keyboard->focus_serial = serial;
|
||||
|
||||
meta_wayland_surface_focused_set (surface);
|
||||
@ -591,7 +590,7 @@ meta_wayland_keyboard_release (MetaWaylandKeyboard *keyboard)
|
||||
|
||||
/* XXX: What about keyboard->resource_list? */
|
||||
if (keyboard->focus_resource)
|
||||
wl_list_remove (&keyboard->focus_listener.link);
|
||||
wl_list_remove (&keyboard->focus_surface_listener.link);
|
||||
wl_array_release (&keyboard->keys);
|
||||
}
|
||||
|
||||
|
@ -94,7 +94,7 @@ struct _MetaWaylandKeyboard
|
||||
struct wl_list resource_list;
|
||||
MetaWaylandSurface *focus;
|
||||
struct wl_resource *focus_resource;
|
||||
struct wl_listener focus_listener;
|
||||
struct wl_listener focus_surface_listener;
|
||||
uint32_t focus_serial;
|
||||
|
||||
MetaWaylandKeyboardGrab *grab;
|
||||
|
@ -64,10 +64,9 @@ meta_wayland_pointer_get_seat (MetaWaylandPointer *pointer)
|
||||
}
|
||||
|
||||
static void
|
||||
lose_pointer_focus (struct wl_listener *listener, void *data)
|
||||
pointer_handle_focus_surface_destroy (struct wl_listener *listener, void *data)
|
||||
{
|
||||
MetaWaylandPointer *pointer =
|
||||
wl_container_of (listener, pointer, focus_listener);
|
||||
MetaWaylandPointer *pointer = wl_container_of (listener, pointer, focus_surface_listener);
|
||||
|
||||
pointer->focus_resource = NULL;
|
||||
pointer->focus = NULL;
|
||||
@ -267,7 +266,7 @@ meta_wayland_pointer_init (MetaWaylandPointer *pointer,
|
||||
|
||||
memset (pointer, 0, sizeof *pointer);
|
||||
wl_list_init (&pointer->resource_list);
|
||||
pointer->focus_listener.notify = lose_pointer_focus;
|
||||
pointer->focus_surface_listener.notify = pointer_handle_focus_surface_destroy;
|
||||
pointer->default_grab.interface = &default_pointer_grab_interface;
|
||||
pointer->default_grab.pointer = pointer;
|
||||
pointer->grab = &pointer->default_grab;
|
||||
@ -289,7 +288,7 @@ meta_wayland_pointer_release (MetaWaylandPointer *pointer)
|
||||
{
|
||||
/* XXX: What about pointer->resource_list? */
|
||||
if (pointer->focus_resource)
|
||||
wl_list_remove (&pointer->focus_listener.link);
|
||||
wl_list_remove (&pointer->focus_surface_listener.link);
|
||||
|
||||
pointer->focus = NULL;
|
||||
pointer->focus_resource = NULL;
|
||||
@ -332,7 +331,7 @@ meta_wayland_pointer_set_focus (MetaWaylandPointer *pointer,
|
||||
wl_pointer_send_leave (resource, serial, pointer->focus->resource);
|
||||
}
|
||||
|
||||
wl_list_remove (&pointer->focus_listener.link);
|
||||
wl_list_remove (&pointer->focus_surface_listener.link);
|
||||
}
|
||||
|
||||
resource = find_resource_for_surface (&pointer->resource_list, surface);
|
||||
@ -365,7 +364,7 @@ meta_wayland_pointer_set_focus (MetaWaylandPointer *pointer,
|
||||
wl_fixed_to_int (pointer->x),
|
||||
wl_fixed_to_int (pointer->y));
|
||||
wl_pointer_send_enter (resource, serial, surface->resource, sx, sy);
|
||||
wl_resource_add_destroy_listener (resource, &pointer->focus_listener);
|
||||
wl_resource_add_destroy_listener (resource, &pointer->focus_surface_listener);
|
||||
pointer->focus_serial = serial;
|
||||
}
|
||||
|
||||
|
@ -48,7 +48,7 @@ struct _MetaWaylandPointer
|
||||
struct wl_list resource_list;
|
||||
MetaWaylandSurface *focus;
|
||||
struct wl_resource *focus_resource;
|
||||
struct wl_listener focus_listener;
|
||||
struct wl_listener focus_surface_listener;
|
||||
guint32 focus_serial;
|
||||
guint32 click_serial;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user