remove unnecessary LayerShell.geom

We only used geom.x and geom.y. We can access those variables directly from the
scene node.
This commit is contained in:
Leonardo Hernández Hernández 2024-08-14 13:09:09 -06:00
parent d4ad37354e
commit b616476c85
No known key found for this signature in database
GPG Key ID: E538897EE11B9624

11
dwl.c
View File

@ -171,7 +171,6 @@ typedef struct {
unsigned int type; /* LayerShell */ unsigned int type; /* LayerShell */
Monitor *mon; Monitor *mon;
struct wlr_box geom;
struct wlr_scene_tree *scene; struct wlr_scene_tree *scene;
struct wlr_scene_tree *popups; struct wlr_scene_tree *popups;
struct wlr_scene_layer_surface_v1 *scene_layer; 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_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); 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)) if ((l && !l->mon) || (c && !c->mon))
return; return;
box = type == LayerShell ? l->mon->m : c->mon->w; box = type == LayerShell ? l->mon->m : c->mon->w;
box.x -= (type == LayerShell ? l->geom.x : c->geom.x); box.x -= (type == LayerShell ? l->scene->node.x : c->geom.x);
box.y -= (type == LayerShell ? l->geom.y : c->geom.y); box.y -= (type == LayerShell ? l->scene->node.y : c->geom.y);
wlr_xdg_popup_unconstrain_from_box(popup, &box); wlr_xdg_popup_unconstrain_from_box(popup, &box);
wl_list_remove(&listener->link); 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) { && toplevel_from_wlr_surface(seat->pointer_state.focused_surface, &w, &l) >= 0) {
c = w; c = w;
surface = seat->pointer_state.focused_surface; surface = seat->pointer_state.focused_surface;
sx = cursor->x - (l ? l->geom.x : w->geom.x); sx = cursor->x - (l ? l->scene->node.x : w->geom.x);
sy = cursor->y - (l ? l->geom.y : w->geom.y); sy = cursor->y - (l ? l->scene->node.y : w->geom.y);
} }
/* time is 0 in internal calls meant to restore pointer focus. */ /* time is 0 in internal calls meant to restore pointer focus. */