aboutsummaryrefslogtreecommitdiff
path: root/rootston
diff options
context:
space:
mode:
authorTony Crisci <tony@dubstepdish.com>2017-11-08 08:19:23 -0500
committerTony Crisci <tony@dubstepdish.com>2017-11-08 08:19:23 -0500
commitfc09f904624a8f3a4fc7577ba19137a3700c7a45 (patch)
treeb1b003f31d7f31b69d3c4a77fea162ef894b508f /rootston
parent86b86f07143132a399f28c13c6e86db027bb0486 (diff)
rootston: guess seat for xwayland moveresize
Diffstat (limited to 'rootston')
-rw-r--r--rootston/xwayland.c14
1 files changed, 9 insertions, 5 deletions
diff --git a/rootston/xwayland.c b/rootston/xwayland.c
index b53b98a9..92ba5e60 100644
--- a/rootston/xwayland.c
+++ b/rootston/xwayland.c
@@ -110,12 +110,16 @@ static void handle_request_configure(struct wl_listener *listener, void *data) {
xwayland_surface, event->x, event->y, event->width, event->height);
}
-// XXX Needs deep refactoring to get this better. We need to select the correct
-// seat based on seat pointer focus, but interactive moving and resizing is not
-// yet seat aware. Even then, we can only guess because X11 events don't give us
-// enough wayland info to know for sure.
static struct roots_seat *guess_seat_for_view(struct roots_view *view) {
- // TODO
+ // the best we can do is to pick the first seat that has the surface focused
+ // for the pointer
+ struct roots_input *input = view->desktop->server->input;
+ struct roots_seat *seat;
+ wl_list_for_each(seat, &input->seats, link) {
+ if (seat->seat->pointer_state.focused_surface == view->wlr_surface) {
+ return seat;
+ }
+ }
return NULL;
}