aboutsummaryrefslogtreecommitdiff
path: root/include/wlr
diff options
context:
space:
mode:
authoremersion <contact@emersion.fr>2018-06-01 14:29:05 +0100
committerGitHub <noreply@github.com>2018-06-01 14:29:05 +0100
commit84c09152aff771d3de899594b6590ce2db173025 (patch)
tree3a090551a15d3052ce59ba35b3f1a762a4b632d1 /include/wlr
parent6b7a55aa3d548e29917027e68181412897a01b1a (diff)
parent3994762ae05d18f2ec0fe9509e4dd41224cde56e (diff)
Merge pull request #1021 from Ongy/xdg_geometry
Add wlr_surface_get_geometry
Diffstat (limited to 'include/wlr')
-rw-r--r--include/wlr/types/wlr_surface.h8
-rw-r--r--include/wlr/types/wlr_xdg_shell.h9
-rw-r--r--include/wlr/types/wlr_xdg_shell_v6.h9
3 files changed, 26 insertions, 0 deletions
diff --git a/include/wlr/types/wlr_surface.h b/include/wlr/types/wlr_surface.h
index d1127c86..0fa7e9c2 100644
--- a/include/wlr/types/wlr_surface.h
+++ b/include/wlr/types/wlr_surface.h
@@ -159,6 +159,14 @@ void wlr_surface_send_leave(struct wlr_surface *surface,
void wlr_surface_send_frame_done(struct wlr_surface *surface,
const struct timespec *when);
+struct wlr_box;
+/**
+ * Get the bounding box that contains the surface and all subsurfaces in
+ * surface coordinates.
+ * X and y may be negative, if there are subsurfaces with negative position.
+ */
+void wlr_surface_get_extends(struct wlr_surface *surface, struct wlr_box *box);
+
/**
* Set a callback for surface commit that runs before all the other callbacks.
* This is intended for use by the surface role.
diff --git a/include/wlr/types/wlr_xdg_shell.h b/include/wlr/types/wlr_xdg_shell.h
index 5eb30a16..6a967bc7 100644
--- a/include/wlr/types/wlr_xdg_shell.h
+++ b/include/wlr/types/wlr_xdg_shell.h
@@ -342,6 +342,15 @@ struct wlr_xdg_surface *wlr_xdg_surface_from_wlr_surface(
struct wlr_surface *surface);
/**
+ * Get the surface geometry.
+ * This is either the geometry as set by the client, or defaulted to the bounds
+ * of the surface + the subsurfaces (as specified by the protocol).
+ *
+ * The x and y value can be <0
+ */
+void wlr_xdg_surface_get_geometry(struct wlr_xdg_surface *surface, struct wlr_box *box);
+
+/**
* Call `iterator` on each surface in the xdg-surface tree, with the surface's
* position relative to the root xdg-surface. The function is called from root to
* leaves (in rendering order).
diff --git a/include/wlr/types/wlr_xdg_shell_v6.h b/include/wlr/types/wlr_xdg_shell_v6.h
index 2fdf49e5..07c831ce 100644
--- a/include/wlr/types/wlr_xdg_shell_v6.h
+++ b/include/wlr/types/wlr_xdg_shell_v6.h
@@ -319,6 +319,15 @@ struct wlr_xdg_surface_v6 *wlr_xdg_surface_v6_from_wlr_surface(
struct wlr_surface *surface);
/**
+ * Get the surface geometry.
+ * This is either the geometry as set by the client, or defaulted to the bounds
+ * of the surface + the subsurfaces (as specified by the protocol).
+ *
+ * The x and y value can be <0
+ */
+void wlr_xdg_surface_v6_get_geometry(struct wlr_xdg_surface_v6 *surface, struct wlr_box *box);
+
+/**
* Call `iterator` on each surface in the xdg-surface tree, with the surface's
* position relative to the root xdg-surface. The function is called from root to
* leaves (in rendering order).