aboutsummaryrefslogtreecommitdiff
path: root/sway
diff options
context:
space:
mode:
Diffstat (limited to 'sway')
-rw-r--r--sway/container.c16
1 files changed, 8 insertions, 8 deletions
diff --git a/sway/container.c b/sway/container.c
index 11dcdb7f..2f656bd8 100644
--- a/sway/container.c
+++ b/sway/container.c
@@ -346,23 +346,23 @@ swayc_t *new_floating_view(wlc_handle handle) {
view->sticky = false;
// Set the geometry of the floating view
- struct wlc_geometry geometry;
- wlc_view_get_visible_geometry(handle, &geometry);
+ const struct wlc_geometry *geometry = wlc_view_get_geometry(handle);
// give it requested geometry, but place in center if possible
// in top left otherwise
- if (geometry.size.w != 0) {
- view->x = (swayc_active_workspace()->width - geometry.size.w) / 2;
+ if (geometry->size.w != 0) {
+ view->x = (swayc_active_workspace()->width - geometry->size.w) / 2;
} else {
view->x = 0;
}
- if (geometry.size.h != 0) {
- view->y = (swayc_active_workspace()->height - geometry.size.h) / 2;
+ if (geometry->size.h != 0) {
+ view->y = (swayc_active_workspace()->height - geometry->size.h) / 2;
} else {
view->y = 0;
}
- view->width = geometry.size.w;
- view->height = geometry.size.h;
+
+ view->width = geometry->size.w;
+ view->height = geometry->size.h;
view->desired_width = view->width;
view->desired_height = view->height;