diff options
author | Drew DeVault <sir@cmpwn.com> | 2018-03-31 11:40:34 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-03-31 11:40:34 -0400 |
commit | 89ca6676bedca3580a2db45a2f60f34c136cd3d0 (patch) | |
tree | 8131a6e50f159d30b6bc936384fdd3fb460e95b3 /sway/input/cursor.c | |
parent | a1e7ffd857b27a430989718c7328e7b969a99ca3 (diff) | |
parent | 98b67e2399df70d1e8354d5641744d1730a60189 (diff) |
Merge pull request #1681 from emersion/xwayland-configure-position
Fix various xwayland issues
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, struct wl_list *unmanaged = &root_container.sway_root->unmanaged_views; struct sway_view *view; wl_list_for_each_reverse(view, unmanaged, unmanaged_view_link) { - if (view->type == SWAY_XWAYLAND_VIEW) { - struct wlr_xwayland_surface *xsurface = view->wlr_xwayland_surface; - struct wlr_box box = { - .x = xsurface->x, - .y = xsurface->y, - .width = xsurface->width, - .height = xsurface->height, - }; - - if (wlr_box_contains_point(&box, cursor->x, cursor->y)) { - *surface = xsurface->surface; - *sx = cursor->x - box.x; - *sy = cursor->y - box.y; - return NULL; - } + if (view->type != SWAY_XWAYLAND_VIEW) { + continue; + } + + struct wlr_xwayland_surface *xsurface = view->wlr_xwayland_surface; + struct wlr_box box = { + .x = xsurface->x, + .y = xsurface->y, + .width = xsurface->width, + .height = xsurface->height, + }; + + if (wlr_box_contains_point(&box, cursor->x, cursor->y)) { + *surface = xsurface->surface; + *sx = cursor->x - box.x; + *sy = cursor->y - box.y; + return NULL; } } |