aboutsummaryrefslogtreecommitdiff
path: root/sway/container.c
diff options
context:
space:
mode:
Diffstat (limited to 'sway/container.c')
-rw-r--r--sway/container.c12
1 files changed, 7 insertions, 5 deletions
diff --git a/sway/container.c b/sway/container.c
index 358ba767..718608ff 100644
--- a/sway/container.c
+++ b/sway/container.c
@@ -516,11 +516,11 @@ swayc_t *destroy_view(swayc_t *view) {
return NULL;
}
sway_log(L_DEBUG, "Destroying view '%p'", view);
- swayc_t *parent = view->parent;
free_swayc(view);
// Destroy empty containers
- if (parent->type == C_CONTAINER) {
+ swayc_t *parent = view->parent;
+ if (parent && parent->type == C_CONTAINER) {
return destroy_container(parent);
}
return parent;
@@ -707,8 +707,10 @@ swayc_t *container_under_pointer(void) {
if (lookup->children && !lookup->unmanaged) {
return NULL;
}
- struct wlc_point origin;
- wlc_pointer_get_position(&origin);
+ double x, y;
+ wlc_pointer_get_position_v2(&x, &y);
+ struct wlc_point origin = { .x = x, .y = y };
+
while (lookup && lookup->type != C_VIEW) {
int i;
int len;
@@ -847,7 +849,6 @@ int swayc_gap(swayc_t *container) {
void container_map(swayc_t *container, void (*f)(swayc_t *view, void *data), void *data) {
if (container) {
- f(container, data);
int i;
if (container->children) {
for (i = 0; i < container->children->length; ++i) {
@@ -861,6 +862,7 @@ void container_map(swayc_t *container, void (*f)(swayc_t *view, void *data), voi
container_map(child, f, data);
}
}
+ f(container, data);
}
}