diff options
author | Drew DeVault <sir@cmpwn.com> | 2018-04-04 22:00:50 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-04-04 22:00:50 -0400 |
commit | 9a30a4f557c895e3d9ed9be19813ce43f05e00cb (patch) | |
tree | 2694e174b09d31820fe0fa80195cf8473f0bfb0b /include | |
parent | cdb025a74bb7b36a5cee6fffa6eb0c414af8be71 (diff) | |
parent | 3ea425d4e232d4d03506e7177b0c25d9d964956d (diff) |
Merge pull request #824 from emersion/fix-subsurface-at
Redesign surface input functions
Diffstat (limited to 'include')
-rw-r--r-- | include/wlr/types/wlr_surface.h | 22 | ||||
-rw-r--r-- | include/wlr/types/wlr_wl_shell.h | 10 | ||||
-rw-r--r-- | include/wlr/types/wlr_xdg_shell.h | 12 | ||||
-rw-r--r-- | include/wlr/types/wlr_xdg_shell_v6.h | 12 |
4 files changed, 30 insertions, 26 deletions
diff --git a/include/wlr/types/wlr_surface.h b/include/wlr/types/wlr_surface.h index 4d03df73..380e5e03 100644 --- a/include/wlr/types/wlr_surface.h +++ b/include/wlr/types/wlr_surface.h @@ -122,20 +122,24 @@ void wlr_surface_make_subsurface(struct wlr_surface *surface, struct wlr_surface *parent, uint32_t id); /** - * Get the top of the subsurface tree for this surface. + * Get the root of the subsurface tree for this surface. */ -struct wlr_surface *wlr_surface_get_main_surface(struct wlr_surface *surface); +struct wlr_surface *wlr_surface_get_root_surface(struct wlr_surface *surface); /** - * Find a subsurface within this surface at the surface-local coordinates. - * Returns the surface and coordinates in the topmost surface coordinate system - * or NULL if no subsurface is found at that location. + * Check if the surface accepts input events at the given surface-local + * coordinates. Does not check the surface's subsurfaces. */ -struct wlr_subsurface *wlr_surface_subsurface_at(struct wlr_surface *surface, - double sx, double sy, double *sub_x, double *sub_y); +bool wlr_surface_point_accepts_input(struct wlr_surface *surface, + double sx, double sy); -bool wlr_surface_point_accepts_input( - struct wlr_surface *surface, double sx, double sy); +/** + * Find a surface in this surface's tree that accepts input events at the given + * surface-local coordinates. Returns the surface and coordinates in the leaf + * surface coordinate system or NULL if no surface is found at that location. + */ +struct wlr_surface *wlr_surface_surface_at(struct wlr_surface *surface, + double sx, double sy, double *sub_x, double *sub_y); void wlr_surface_send_enter(struct wlr_surface *surface, struct wlr_output *output); diff --git a/include/wlr/types/wlr_wl_shell.h b/include/wlr/types/wlr_wl_shell.h index 63b1a837..89e950c9 100644 --- a/include/wlr/types/wlr_wl_shell.h +++ b/include/wlr/types/wlr_wl_shell.h @@ -142,13 +142,13 @@ void wlr_wl_shell_surface_configure(struct wlr_wl_shell_surface *surface, enum wl_shell_surface_resize edges, int32_t width, int32_t height); /** - * Find a popup within this surface at the surface-local coordinates. Returns - * the popup and coordinates in the topmost surface coordinate system or NULL if - * no popup is found at that location. + * Find a surface within this wl-shell surface tree at the given surface-local + * coordinates. Returns the surface and coordinates in the leaf surface + * coordinate system or NULL if no surface is found at that location. */ -struct wlr_wl_shell_surface *wlr_wl_shell_surface_popup_at( +struct wlr_surface *wlr_wl_shell_surface_surface_at( struct wlr_wl_shell_surface *surface, double sx, double sy, - double *popup_sx, double *popup_sy); + double *sub_sx, double *sub_sy); bool wlr_surface_is_wl_shell_surface(struct wlr_surface *surface); diff --git a/include/wlr/types/wlr_xdg_shell.h b/include/wlr/types/wlr_xdg_shell.h index b779017f..29b54dba 100644 --- a/include/wlr/types/wlr_xdg_shell.h +++ b/include/wlr/types/wlr_xdg_shell.h @@ -215,19 +215,19 @@ uint32_t wlr_xdg_toplevel_set_resizing(struct wlr_xdg_surface *surface, void wlr_xdg_surface_send_close(struct wlr_xdg_surface *surface); /** - * Compute the popup position in surface-local coordinates. + * Compute the popup position in its parent's surface-local coordinate system. */ void wlr_xdg_surface_popup_get_position(struct wlr_xdg_surface *surface, double *popup_sx, double *popup_sy); /** - * Find a popup within this surface at the surface-local coordinates. Returns - * the popup and coordinates in the topmost surface coordinate system or NULL if - * no popup is found at that location. + * Find a surface within this xdg-surface tree at the given surface-local + * coordinates. Returns the surface and coordinates in the leaf surface + * coordinate system or NULL if no surface is found at that location. */ -struct wlr_xdg_surface *wlr_xdg_surface_popup_at( +struct wlr_surface *wlr_xdg_surface_surface_at( struct wlr_xdg_surface *surface, double sx, double sy, - double *popup_sx, double *popup_sy); + double *sub_x, double *sub_y); bool wlr_surface_is_xdg_surface(struct wlr_surface *surface); diff --git a/include/wlr/types/wlr_xdg_shell_v6.h b/include/wlr/types/wlr_xdg_shell_v6.h index 04c1f324..b646f3fe 100644 --- a/include/wlr/types/wlr_xdg_shell_v6.h +++ b/include/wlr/types/wlr_xdg_shell_v6.h @@ -233,19 +233,19 @@ uint32_t wlr_xdg_toplevel_v6_set_resizing(struct wlr_xdg_surface_v6 *surface, void wlr_xdg_surface_v6_send_close(struct wlr_xdg_surface_v6 *surface); /** - * Compute the popup position in surface-local coordinates. + * Compute the popup position in its parent's surface-local coordinate system. */ void wlr_xdg_surface_v6_popup_get_position(struct wlr_xdg_surface_v6 *surface, double *popup_sx, double *popup_sy); /** - * Find a popup within this surface at the surface-local coordinates. Returns - * the popup and coordinates in the topmost surface coordinate system or NULL if - * no popup is found at that location. + * Find a surface within this xdg-surface tree at the given surface-local + * coordinates. Returns the surface and coordinates in the leaf surface + * coordinate system or NULL if no surface is found at that location. */ -struct wlr_xdg_surface_v6 *wlr_xdg_surface_v6_popup_at( +struct wlr_surface *wlr_xdg_surface_v6_surface_at( struct wlr_xdg_surface_v6 *surface, double sx, double sy, - double *popup_sx, double *popup_sy); + double *sub_x, double *sub_y); /** * Get the geometry for this positioner based on the anchor rect, gravity, and |