~ruther/dwl

b616476c856d893e0d7bd1e35b74cc996ec7f4b4 — Leonardo Hernández Hernández 1 year, 1 month ago d4ad373
remove unnecessary LayerShell.geom

We only used geom.x and geom.y. We can access those variables directly from the
scene node.
1 files changed, 4 insertions(+), 7 deletions(-)

M dwl.c
M dwl.c => dwl.c +4 -7
@@ 171,7 171,6 @@ typedef struct {
	unsigned int type; /* LayerShell */

	Monitor *mon;
	struct wlr_box geom;
	struct wlr_scene_tree *scene;
	struct wlr_scene_tree *popups;
	struct wlr_scene_layer_surface_v1 *scene_layer;


@@ 533,8 532,6 @@ arrangelayer(Monitor *m, struct wl_list *list, struct wlr_box *usable_area, int 

		wlr_scene_layer_surface_v1_configure(l->scene_layer, &full_area, usable_area);
		wlr_scene_node_set_position(&l->popups->node, l->scene->node.x, l->scene->node.y);
		l->geom.x = l->scene->node.x;
		l->geom.y = l->scene->node.y;
	}
}



@@ 844,8 841,8 @@ commitpopup(struct wl_listener *listener, void *data)
	if ((l && !l->mon) || (c && !c->mon))
		return;
	box = type == LayerShell ? l->mon->m : c->mon->w;
	box.x -= (type == LayerShell ? l->geom.x : c->geom.x);
	box.y -= (type == LayerShell ? l->geom.y : c->geom.y);
	box.x -= (type == LayerShell ? l->scene->node.x : c->geom.x);
	box.y -= (type == LayerShell ? l->scene->node.y : c->geom.y);
	wlr_xdg_popup_unconstrain_from_box(popup, &box);
	wl_list_remove(&listener->link);
}


@@ 1824,8 1821,8 @@ motionnotify(uint32_t time, struct wlr_input_device *device, double dx, double d
			&& toplevel_from_wlr_surface(seat->pointer_state.focused_surface, &w, &l) >= 0) {
		c = w;
		surface = seat->pointer_state.focused_surface;
		sx = cursor->x - (l ? l->geom.x : w->geom.x);
		sy = cursor->y - (l ? l->geom.y : w->geom.y);
		sx = cursor->x - (l ? l->scene->node.x : w->geom.x);
		sy = cursor->y - (l ? l->scene->node.y : w->geom.y);
	}

	/* time is 0 in internal calls meant to restore pointer focus. */