aboutsummaryrefslogtreecommitdiffstats
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) {
516 return NULL; 516 return NULL;
517 } 517 }
518 sway_log(L_DEBUG, "Destroying view '%p'", view); 518 sway_log(L_DEBUG, "Destroying view '%p'", view);
519 swayc_t *parent = view->parent;
520 free_swayc(view); 519 free_swayc(view);
521 520
522 // Destroy empty containers 521 // Destroy empty containers
523 if (parent->type == C_CONTAINER) { 522 swayc_t *parent = view->parent;
523 if (parent && parent->type == C_CONTAINER) {
524 return destroy_container(parent); 524 return destroy_container(parent);
525 } 525 }
526 return parent; 526 return parent;
@@ -707,8 +707,10 @@ swayc_t *container_under_pointer(void) {
707 if (lookup->children && !lookup->unmanaged) { 707 if (lookup->children && !lookup->unmanaged) {
708 return NULL; 708 return NULL;
709 } 709 }
710 struct wlc_point origin; 710 double x, y;
711 wlc_pointer_get_position(&origin); 711 wlc_pointer_get_position_v2(&x, &y);
712 struct wlc_point origin = { .x = x, .y = y };
713
712 while (lookup && lookup->type != C_VIEW) { 714 while (lookup && lookup->type != C_VIEW) {
713 int i; 715 int i;
714 int len; 716 int len;
@@ -847,7 +849,6 @@ int swayc_gap(swayc_t *container) {
847 849
848void container_map(swayc_t *container, void (*f)(swayc_t *view, void *data), void *data) { 850void container_map(swayc_t *container, void (*f)(swayc_t *view, void *data), void *data) {
849 if (container) { 851 if (container) {
850 f(container, data);
851 int i; 852 int i;
852 if (container->children) { 853 if (container->children) {
853 for (i = 0; i < container->children->length; ++i) { 854 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
861 container_map(child, f, data); 862 container_map(child, f, data);
862 } 863 }
863 } 864 }
865 f(container, data);
864 } 866 }
865} 867}
866 868