pointer/keyboard: Remove focus_resource_listener
In order to support multiple pointers for the same client, we're going to need to kill it. This will cause crashes for now, but will be fixed by the next commit.
This commit is contained in:
parent
edfaf3de49
commit
f1034d0459
@ -211,19 +211,6 @@ keyboard_handle_focus_surface_destroy (struct wl_listener *listener, void *data)
|
||||
MetaWaylandKeyboard *keyboard = wl_container_of (listener, keyboard, focus_surface_listener);
|
||||
|
||||
keyboard->focus_surface = NULL;
|
||||
|
||||
if (keyboard->focus_resource)
|
||||
{
|
||||
wl_list_remove (&keyboard->focus_resource_listener.link);
|
||||
keyboard->focus_resource = NULL;
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
keyboard_handle_focus_resource_destroy (struct wl_listener *listener, void *data)
|
||||
{
|
||||
MetaWaylandKeyboard *keyboard = wl_container_of (listener, keyboard, focus_resource_listener);
|
||||
|
||||
keyboard->focus_resource = NULL;
|
||||
}
|
||||
|
||||
@ -294,7 +281,6 @@ meta_wayland_keyboard_init (MetaWaylandKeyboard *keyboard,
|
||||
wl_array_init (&keyboard->keys);
|
||||
|
||||
keyboard->focus_surface_listener.notify = keyboard_handle_focus_surface_destroy;
|
||||
keyboard->focus_resource_listener.notify = keyboard_handle_focus_resource_destroy;
|
||||
|
||||
keyboard->default_grab.interface = &default_keyboard_grab_interface;
|
||||
keyboard->default_grab.keyboard = keyboard;
|
||||
@ -444,7 +430,6 @@ meta_wayland_keyboard_set_focus (MetaWaylandKeyboard *keyboard,
|
||||
uint32_t serial = wl_display_next_serial (display);
|
||||
wl_keyboard_send_leave (keyboard->focus_resource, serial, keyboard->focus_surface->resource);
|
||||
|
||||
wl_list_remove (&keyboard->focus_resource_listener.link);
|
||||
keyboard->focus_resource = NULL;
|
||||
}
|
||||
|
||||
@ -473,7 +458,6 @@ meta_wayland_keyboard_set_focus (MetaWaylandKeyboard *keyboard,
|
||||
wl_keyboard_send_enter (keyboard->focus_resource, serial, keyboard->focus_surface->resource,
|
||||
&keyboard->keys);
|
||||
|
||||
wl_resource_add_destroy_listener (keyboard->focus_resource, &keyboard->focus_resource_listener);
|
||||
keyboard->focus_serial = serial;
|
||||
}
|
||||
}
|
||||
|
@ -82,7 +82,6 @@ struct _MetaWaylandKeyboard
|
||||
MetaWaylandSurface *focus_surface;
|
||||
struct wl_listener focus_surface_listener;
|
||||
struct wl_resource *focus_resource;
|
||||
struct wl_listener focus_resource_listener;
|
||||
uint32_t focus_serial;
|
||||
|
||||
MetaWaylandKeyboardGrab *grab;
|
||||
|
@ -60,19 +60,6 @@ pointer_handle_focus_surface_destroy (struct wl_listener *listener, void *data)
|
||||
MetaWaylandPointer *pointer = wl_container_of (listener, pointer, focus_surface_listener);
|
||||
|
||||
pointer->focus_surface = NULL;
|
||||
|
||||
if (pointer->focus_resource)
|
||||
{
|
||||
wl_list_remove (&pointer->focus_resource_listener.link);
|
||||
pointer->focus_resource = NULL;
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
pointer_handle_focus_resource_destroy (struct wl_listener *listener, void *data)
|
||||
{
|
||||
MetaWaylandPointer *pointer = wl_container_of (listener, pointer, focus_resource_listener);
|
||||
|
||||
pointer->focus_resource = NULL;
|
||||
}
|
||||
|
||||
@ -271,7 +258,6 @@ meta_wayland_pointer_init (MetaWaylandPointer *pointer)
|
||||
wl_list_init (&pointer->resource_list);
|
||||
|
||||
pointer->focus_surface_listener.notify = pointer_handle_focus_surface_destroy;
|
||||
pointer->focus_resource_listener.notify = pointer_handle_focus_resource_destroy;
|
||||
|
||||
pointer->default_grab.interface = &default_pointer_grab_interface;
|
||||
pointer->default_grab.pointer = pointer;
|
||||
@ -332,7 +318,6 @@ meta_wayland_pointer_set_focus (MetaWaylandPointer *pointer,
|
||||
uint32_t serial = wl_display_next_serial (display);
|
||||
wl_pointer_send_leave (pointer->focus_resource, serial, pointer->focus_surface->resource);
|
||||
|
||||
wl_list_remove (&pointer->focus_resource_listener.link);
|
||||
pointer->focus_resource = NULL;
|
||||
}
|
||||
|
||||
@ -365,7 +350,6 @@ meta_wayland_pointer_set_focus (MetaWaylandPointer *pointer,
|
||||
wl_pointer_send_enter (pointer->focus_resource, serial, pointer->focus_surface->resource, sx, sy);
|
||||
}
|
||||
|
||||
wl_resource_add_destroy_listener (pointer->focus_resource, &pointer->focus_resource_listener);
|
||||
pointer->focus_serial = serial;
|
||||
}
|
||||
}
|
||||
|
@ -49,7 +49,6 @@ struct _MetaWaylandPointer
|
||||
MetaWaylandSurface *focus_surface;
|
||||
struct wl_listener focus_surface_listener;
|
||||
struct wl_resource *focus_resource;
|
||||
struct wl_listener focus_resource_listener;
|
||||
guint32 focus_serial;
|
||||
guint32 click_serial;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user