sway

i3-compatible Wayland compositor
git clone https://git.awy.one/sway
Log | Files | Refs | README | LICENSE

commit 9ee89f11c41e723cad8bfb48e1e9b0e743283018
parent 8034c2542620cc9f2699b242cda94c04fee03051
Author: Ryan Dwyer <ryandwyer1@gmail.com>
Date:   Fri, 17 Aug 2018 09:25:55 +1000

Add get_geometry for xdg_shell_v6

Diffstat:
Msway/desktop/xdg_shell_v6.c | 14+++++++++++++-
1 file changed, 13 insertions(+), 1 deletion(-)

diff --git a/sway/desktop/xdg_shell_v6.c b/sway/desktop/xdg_shell_v6.c @@ -106,7 +106,8 @@ static void get_constraints(struct sway_view *view, double *min_width, *max_height = state->max_height > 0 ? state->max_height : DBL_MAX; } -static const char *get_string_prop(struct sway_view *view, enum sway_view_prop prop) { +static const char *get_string_prop(struct sway_view *view, + enum sway_view_prop prop) { if (xdg_shell_v6_view_from_view(view) == NULL) { return NULL; } @@ -120,6 +121,16 @@ static const char *get_string_prop(struct sway_view *view, enum sway_view_prop p } } +static void get_geometry(struct sway_view *view, struct wlr_box *box) { + struct sway_xdg_shell_v6_view *xdg_shell_v6_view = + xdg_shell_v6_view_from_view(view); + if (xdg_shell_v6_view == NULL) { + return; + } + struct wlr_xdg_surface_v6 *surface = view->wlr_xdg_surface_v6; + wlr_xdg_surface_v6_get_geometry(surface, box); +} + static uint32_t configure(struct sway_view *view, double lx, double ly, int width, int height) { struct sway_xdg_shell_v6_view *xdg_shell_v6_view = @@ -228,6 +239,7 @@ static void destroy(struct sway_view *view) { static const struct sway_view_impl view_impl = { .get_constraints = get_constraints, .get_string_prop = get_string_prop, + .get_geometry = get_geometry, .configure = configure, .set_activated = set_activated, .set_tiled = set_tiled,