aboutsummaryrefslogtreecommitdiff
path: root/sway/desktop
diff options
context:
space:
mode:
authoremersion <contact@emersion.fr>2018-07-02 23:06:44 +0100
committerRyan Dwyer <ryandwyer1@gmail.com>2018-08-18 10:39:38 +1000
commitb3ee9af0c837bcb48eb30021eaa42c882426e66a (patch)
tree8f2635471aaee001a51e11e922ddb01952ed0f55 /sway/desktop
parentdb4b4935b38b778398170d083a693f82831f1936 (diff)
downloadsway-b3ee9af0c837bcb48eb30021eaa42c882426e66a.tar.xz
Add view_get_geometry
Diffstat (limited to 'sway/desktop')
-rw-r--r--sway/desktop/xdg_shell.c14
-rw-r--r--sway/desktop/xwayland.c2
2 files changed, 13 insertions, 3 deletions
diff --git a/sway/desktop/xdg_shell.c b/sway/desktop/xdg_shell.c
index 6a7a3f7f..2b260357 100644
--- a/sway/desktop/xdg_shell.c
+++ b/sway/desktop/xdg_shell.c
@@ -107,7 +107,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_view_from_view(view) == NULL) {
return NULL;
}
@@ -121,6 +122,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_view *xdg_shell_view =
+ xdg_shell_view_from_view(view);
+ if (xdg_shell_view == NULL) {
+ return;
+ }
+ struct wlr_xdg_surface *surface = view->wlr_xdg_surface;
+ wlr_xdg_surface_get_geometry(surface, box);
+}
+
static uint32_t configure(struct sway_view *view, double lx, double ly,
int width, int height) {
struct sway_xdg_shell_view *xdg_shell_view =
@@ -231,6 +242,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,
diff --git a/sway/desktop/xwayland.c b/sway/desktop/xwayland.c
index 14f59b9c..dca62fb1 100644
--- a/sway/desktop/xwayland.c
+++ b/sway/desktop/xwayland.c
@@ -287,8 +287,6 @@ static void handle_commit(struct wl_listener *listener, void *data) {
if (view->swayc->instruction) {
transaction_notify_view_ready_by_size(view,
surface_state->width, surface_state->height);
- } else if (container_is_floating(view->swayc)) {
- view_update_size(view, surface_state->width, surface_state->height);
}
view_damage_from(view);