diff options
Diffstat (limited to 'sway/input/cursor.c')
-rw-r--r-- | sway/input/cursor.c | 32 |
1 files changed, 17 insertions, 15 deletions
diff --git a/sway/input/cursor.c b/sway/input/cursor.c index 74af6426..67776f8f 100644 --- a/sway/input/cursor.c +++ b/sway/input/cursor.c | |||
@@ -50,21 +50,23 @@ static struct sway_container *container_at_cursor(struct sway_cursor *cursor, | |||
50 | struct wl_list *unmanaged = &root_container.sway_root->unmanaged_views; | 50 | struct wl_list *unmanaged = &root_container.sway_root->unmanaged_views; |
51 | struct sway_view *view; | 51 | struct sway_view *view; |
52 | wl_list_for_each_reverse(view, unmanaged, unmanaged_view_link) { | 52 | wl_list_for_each_reverse(view, unmanaged, unmanaged_view_link) { |
53 | if (view->type == SWAY_XWAYLAND_VIEW) { | 53 | if (view->type != SWAY_XWAYLAND_VIEW) { |
54 | struct wlr_xwayland_surface *xsurface = view->wlr_xwayland_surface; | 54 | continue; |
55 | struct wlr_box box = { | 55 | } |
56 | .x = xsurface->x, | 56 | |
57 | .y = xsurface->y, | 57 | struct wlr_xwayland_surface *xsurface = view->wlr_xwayland_surface; |
58 | .width = xsurface->width, | 58 | struct wlr_box box = { |
59 | .height = xsurface->height, | 59 | .x = xsurface->x, |
60 | }; | 60 | .y = xsurface->y, |
61 | 61 | .width = xsurface->width, | |
62 | if (wlr_box_contains_point(&box, cursor->x, cursor->y)) { | 62 | .height = xsurface->height, |
63 | *surface = xsurface->surface; | 63 | }; |
64 | *sx = cursor->x - box.x; | 64 | |
65 | *sy = cursor->y - box.y; | 65 | if (wlr_box_contains_point(&box, cursor->x, cursor->y)) { |
66 | return NULL; | 66 | *surface = xsurface->surface; |
67 | } | 67 | *sx = cursor->x - box.x; |
68 | *sy = cursor->y - box.y; | ||
69 | return NULL; | ||
68 | } | 70 | } |
69 | } | 71 | } |
70 | 72 | ||