mirror of
https://codeberg.org/dwl/dwl.git
synced 2024-12-25 10:46:30 +00:00
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:
parent
d4ad37354e
commit
b616476c85
1 changed files with 4 additions and 7 deletions
11
dwl.c
11
dwl.c
|
@ -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. */
|
||||
|
|
Loading…
Reference in a new issue