diff options
author | emersion <contact@emersion.fr> | 2018-04-04 17:57:12 -0400 |
---|---|---|
committer | Drew DeVault <sir@cmpwn.com> | 2018-04-04 22:03:14 -0400 |
commit | 44b8d30f5254628f8e6d5a12010f6e5f810d756e (patch) | |
tree | 42039b2d318ab944dd148990329b4a2cf94fd9a3 /sway | |
parent | 8eff00f72395add1881aa677e3c718c0554cb096 (diff) |
Use new wlr_*_surface_at functions
Diffstat (limited to 'sway')
-rw-r--r-- | sway/desktop/output.c | 2 | ||||
-rw-r--r-- | sway/tree/container.c | 45 |
2 files changed, 15 insertions, 32 deletions
diff --git a/sway/desktop/output.c b/sway/desktop/output.c index 38b52a41..0e8a9485 100644 --- a/sway/desktop/output.c +++ b/sway/desktop/output.c @@ -204,8 +204,6 @@ static void render_view(struct sway_container *view, void *data) { case SWAY_VIEW_XWAYLAND: render_surface(surface, wlr_output, when, view->x, view->y, 0, alpha); break; - default: - break; } } diff --git a/sway/tree/container.c b/sway/tree/container.c index 1ea10759..bd9f1edf 100644 --- a/sway/tree/container.c +++ b/sway/tree/container.c @@ -412,9 +412,17 @@ struct sway_container *container_at(struct sway_container *parent, double view_sx = ox - swayc->x; double view_sy = oy - swayc->y; + double _sx, _sy; + struct wlr_surface *_surface; switch (sview->type) { case SWAY_VIEW_XWAYLAND: + _surface = wlr_surface_surface_at(sview->surface, + view_sx, view_sy, &_sx, &_sy); + break; case SWAY_VIEW_WL_SHELL: + _surface = wlr_wl_shell_surface_surface_at( + sview->wlr_wl_shell_surface, + view_sx, view_sy, &_sx, &_sy); break; case SWAY_VIEW_XDG_SHELL_V6: // the top left corner of the sway container is the @@ -422,38 +430,15 @@ struct sway_container *container_at(struct sway_container *parent, view_sx += sview->wlr_xdg_surface_v6->geometry.x; view_sy += sview->wlr_xdg_surface_v6->geometry.y; - // check for popups - double popup_sx, popup_sy; - struct wlr_xdg_surface_v6 *popup = - wlr_xdg_surface_v6_popup_at(sview->wlr_xdg_surface_v6, - view_sx, view_sy, &popup_sx, &popup_sy); - - if (popup) { - *sx = view_sx - popup_sx; - *sy = view_sy - popup_sy; - *surface = popup->surface; - return swayc; - } + _surface = wlr_xdg_surface_v6_surface_at( + sview->wlr_xdg_surface_v6, + view_sx, view_sy, &_sx, &_sy); break; } - - // check for subsurfaces - double sub_x, sub_y; - struct wlr_subsurface *subsurface = - wlr_surface_subsurface_at(sview->surface, - view_sx, view_sy, &sub_x, &sub_y); - if (subsurface) { - *sx = view_sx - sub_x; - *sy = view_sy - sub_y; - *surface = subsurface->surface; - return swayc; - } - - if (wlr_surface_point_accepts_input( - sview->surface, view_sx, view_sy)) { - *sx = view_sx; - *sy = view_sy; - *surface = swayc->sway_view->surface; + if (_surface) { + *sx = _sx; + *sy = _sy; + *surface = _surface; return swayc; } } else { |