compositor: Pass both surface and seat in activation signal
Signed-off-by: Jonas Ådahl <jadahl@gmail.com> Reviewed-by: Daniel Stone <daniels@collabora.com>
This commit is contained in:
@@ -1011,6 +1011,11 @@ struct weston_surface_state {
|
|||||||
struct weston_buffer_viewport buffer_viewport;
|
struct weston_buffer_viewport buffer_viewport;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
struct weston_surface_activation_data {
|
||||||
|
struct weston_surface *surface;
|
||||||
|
struct weston_seat *seat;
|
||||||
|
};
|
||||||
|
|
||||||
struct weston_surface {
|
struct weston_surface {
|
||||||
struct wl_resource *resource;
|
struct wl_resource *resource;
|
||||||
struct wl_signal destroy_signal; /* callback argument: this surface */
|
struct wl_signal destroy_signal; /* callback argument: this surface */
|
||||||
|
|||||||
+7
-1
@@ -2930,6 +2930,7 @@ weston_seat_set_keyboard_focus(struct weston_seat *seat,
|
|||||||
{
|
{
|
||||||
struct weston_compositor *compositor = seat->compositor;
|
struct weston_compositor *compositor = seat->compositor;
|
||||||
struct weston_keyboard *keyboard = weston_seat_get_keyboard(seat);
|
struct weston_keyboard *keyboard = weston_seat_get_keyboard(seat);
|
||||||
|
struct weston_surface_activation_data activation_data;
|
||||||
|
|
||||||
if (keyboard && keyboard->focus != surface) {
|
if (keyboard && keyboard->focus != surface) {
|
||||||
weston_keyboard_set_focus(keyboard, surface);
|
weston_keyboard_set_focus(keyboard, surface);
|
||||||
@@ -2937,7 +2938,12 @@ weston_seat_set_keyboard_focus(struct weston_seat *seat,
|
|||||||
}
|
}
|
||||||
|
|
||||||
inc_activate_serial(compositor);
|
inc_activate_serial(compositor);
|
||||||
wl_signal_emit(&compositor->activate_signal, surface);
|
|
||||||
|
activation_data = (struct weston_surface_activation_data) {
|
||||||
|
.surface = surface,
|
||||||
|
.seat = seat,
|
||||||
|
};
|
||||||
|
wl_signal_emit(&compositor->activate_signal, &activation_data);
|
||||||
}
|
}
|
||||||
|
|
||||||
int
|
int
|
||||||
|
|||||||
@@ -778,7 +778,8 @@ weston_wm_send_focus_window(struct weston_wm *wm,
|
|||||||
static void
|
static void
|
||||||
weston_wm_window_activate(struct wl_listener *listener, void *data)
|
weston_wm_window_activate(struct wl_listener *listener, void *data)
|
||||||
{
|
{
|
||||||
struct weston_surface *surface = data;
|
struct weston_surface_activation_data *activation_data = data;
|
||||||
|
struct weston_surface *surface = activation_data->surface;
|
||||||
struct weston_wm_window *window = NULL;
|
struct weston_wm_window *window = NULL;
|
||||||
struct weston_wm *wm =
|
struct weston_wm *wm =
|
||||||
container_of(listener, struct weston_wm, activate_listener);
|
container_of(listener, struct weston_wm, activate_listener);
|
||||||
|
|||||||
Reference in New Issue
Block a user