Skip to content
This repository was archived by the owner on Jan 26, 2024. It is now read-only.

Commit 1b6ec88

Browse files
committed
No need to send surface.leave/enter events
The scene graph implementation sends these for us, and it does so more accurately than our overly-simplified approach. Layer shell surfaces don't appear to receive these events at all, according to my WAYLAND_DEBUG experiments with bemenu and dtao. ΔSLOC: -4
1 parent ca4a97b commit 1b6ec88

File tree

1 file changed

+2
-6
lines changed

1 file changed

+2
-6
lines changed

dwl.c

+2-6
Original file line numberDiff line numberDiff line change
@@ -1531,7 +1531,6 @@ void
15311531
maplayersurfacenotify(struct wl_listener *listener, void *data)
15321532
{
15331533
LayerSurface *l = wl_container_of(listener, l, map);
1534-
wlr_surface_send_enter(l->layer_surface->surface, l->mon->wlr_output);
15351534
motionnotify(0);
15361535
}
15371536

@@ -2097,15 +2096,12 @@ setmon(Client *c, Monitor *m, uint32_t newtags)
20972096
c->mon = m;
20982097
c->prev = c->geom;
20992098

2100-
/* TODO leave/enter is not optimal but works */
2101-
if (oldmon) {
2102-
wlr_surface_send_leave(client_surface(c), oldmon->wlr_output);
2099+
/* Scene graph sends surface leave/enter events on move and resize */
2100+
if (oldmon)
21032101
arrange(oldmon);
2104-
}
21052102
if (m) {
21062103
/* Make sure window actually overlaps with the monitor */
21072104
resize(c, c->geom, 0);
2108-
wlr_surface_send_enter(client_surface(c), m->wlr_output);
21092105
c->tags = newtags ? newtags : m->tagset[m->seltags]; /* assign tags of target monitor */
21102106
setfullscreen(c, c->isfullscreen); /* This will call arrange(c->mon) */
21112107
}

0 commit comments

Comments
 (0)