void seat_init(struct server *server);
void seat_finish(struct server *server);
-void seat_focus_surface(struct wlr_seat *seat, struct wlr_surface *surface);
+void seat_focus_surface(struct seat *seat, struct wlr_surface *surface);
void interactive_begin(struct view *view, enum cursor_mode mode,
uint32_t edges);
desktop_focus_view(struct seat *seat, struct view *view)
{
if (!view) {
- seat_focus_surface(seat->seat, NULL);
+ seat_focus_surface(seat, NULL);
return;
}
if (view->minimized) {
}
move_to_front(view);
set_activated(view->surface, true);
- seat_focus_surface(seat->seat, view->surface);
+ seat_focus_surface(seat, view->surface);
move_xwayland_sub_views_to_front(view);
}
}
#include <wlr/util/log.h>
#include "labwc.h"
-static struct seat *current_seat;
-
static void
input_device_destroy(struct wl_listener *listener, void *data)
{
wlr_log(WLR_ERROR, "cannot allocate seat");
exit(EXIT_FAILURE);
}
- current_seat = seat;
wl_list_init(&seat->inputs);
seat->new_input.notify = new_input_notify;
}
void
-seat_focus_surface(struct wlr_seat *seat, struct wlr_surface *surface)
+seat_focus_surface(struct seat *seat, struct wlr_surface *surface)
{
if (!surface) {
- wlr_seat_keyboard_notify_clear_focus(seat);
+ wlr_seat_keyboard_notify_clear_focus(seat->seat);
return;
}
- struct wlr_keyboard *kb = ¤t_seat->keyboard_group->keyboard;
- wlr_seat_keyboard_notify_enter(seat, surface, kb->keycodes,
+ struct wlr_keyboard *kb = &seat->keyboard_group->keyboard;
+ wlr_seat_keyboard_notify_enter(seat->seat, surface, kb->keycodes,
kb->num_keycodes, &kb->modifiers);
}
unmanaged->ly = xsurface->y;
if (wlr_xwayland_or_surface_wants_focus(xsurface)) {
- struct wlr_seat *seat = unmanaged->server->seat.seat;
- seat_focus_surface(seat, xsurface->surface);
+ seat_focus_surface(&unmanaged->server->seat, xsurface->surface);
}
}
wl_list_remove(&unmanaged->link);
wl_list_remove(&unmanaged->commit.link);
- struct wlr_seat *seat = unmanaged->server->seat.seat;
- if (seat->keyboard_state.focused_surface == xsurface->surface) {
+ struct seat *seat = &unmanaged->server->seat;
+ if (seat->seat->keyboard_state.focused_surface == xsurface->surface) {
struct xwayland_unmanaged *u;
struct wl_list *list = &unmanaged->server->unmanaged_surfaces;
wl_list_for_each (u, list, link) {