diff options
author | Ryan Dwyer <ryandwyer1@gmail.com> | 2018-08-17 09:25:55 +1000 |
---|---|---|
committer | Ryan Dwyer <ryandwyer1@gmail.com> | 2018-08-18 10:39:38 +1000 |
commit | 9ee89f11c41e723cad8bfb48e1e9b0e743283018 (patch) | |
tree | fc120c9b2c8f757ead7703a8e4540dc0eea6c38a | |
parent | Render saved buffer using saved geometry (diff) | |
download | sway-9ee89f11c41e723cad8bfb48e1e9b0e743283018.tar.gz sway-9ee89f11c41e723cad8bfb48e1e9b0e743283018.tar.zst sway-9ee89f11c41e723cad8bfb48e1e9b0e743283018.zip |
Add get_geometry for xdg_shell_v6
-rw-r--r-- | sway/desktop/xdg_shell_v6.c | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/sway/desktop/xdg_shell_v6.c b/sway/desktop/xdg_shell_v6.c index 5b3c7b2b..bbc7456c 100644 --- 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, | |||
106 | *max_height = state->max_height > 0 ? state->max_height : DBL_MAX; | 106 | *max_height = state->max_height > 0 ? state->max_height : DBL_MAX; |
107 | } | 107 | } |
108 | 108 | ||
109 | static const char *get_string_prop(struct sway_view *view, enum sway_view_prop prop) { | 109 | static const char *get_string_prop(struct sway_view *view, |
110 | enum sway_view_prop prop) { | ||
110 | if (xdg_shell_v6_view_from_view(view) == NULL) { | 111 | if (xdg_shell_v6_view_from_view(view) == NULL) { |
111 | return NULL; | 112 | return NULL; |
112 | } | 113 | } |
@@ -120,6 +121,16 @@ static const char *get_string_prop(struct sway_view *view, enum sway_view_prop p | |||
120 | } | 121 | } |
121 | } | 122 | } |
122 | 123 | ||
124 | static void get_geometry(struct sway_view *view, struct wlr_box *box) { | ||
125 | struct sway_xdg_shell_v6_view *xdg_shell_v6_view = | ||
126 | xdg_shell_v6_view_from_view(view); | ||
127 | if (xdg_shell_v6_view == NULL) { | ||
128 | return; | ||
129 | } | ||
130 | struct wlr_xdg_surface_v6 *surface = view->wlr_xdg_surface_v6; | ||
131 | wlr_xdg_surface_v6_get_geometry(surface, box); | ||
132 | } | ||
133 | |||
123 | static uint32_t configure(struct sway_view *view, double lx, double ly, | 134 | static uint32_t configure(struct sway_view *view, double lx, double ly, |
124 | int width, int height) { | 135 | int width, int height) { |
125 | struct sway_xdg_shell_v6_view *xdg_shell_v6_view = | 136 | struct sway_xdg_shell_v6_view *xdg_shell_v6_view = |
@@ -228,6 +239,7 @@ static void destroy(struct sway_view *view) { | |||
228 | static const struct sway_view_impl view_impl = { | 239 | static const struct sway_view_impl view_impl = { |
229 | .get_constraints = get_constraints, | 240 | .get_constraints = get_constraints, |
230 | .get_string_prop = get_string_prop, | 241 | .get_string_prop = get_string_prop, |
242 | .get_geometry = get_geometry, | ||
231 | .configure = configure, | 243 | .configure = configure, |
232 | .set_activated = set_activated, | 244 | .set_activated = set_activated, |
233 | .set_tiled = set_tiled, | 245 | .set_tiled = set_tiled, |