dwl
dwl copied to clipboard
various improvements to layer surface
- remove various useless assignments of layersurface->mon
- styles changes
- ~~do not send wlr_surface_send_enter on map (this is handled by scene-graph)~~
- do not set wlr_layer_surface->output to NULL at destroy
I'm almost sure this breaks nothing, but many of my latest commits introduced bugs so better checking.
And also this may cause regressions on a multimonitor setup, @fauxmight can you check please?
@sevz17 Due to life, I do not currently have access to my multi-monitor setup. I will test this, but it will be later this week. Not ignoring the request.
No rush, I do really appreciate you helping me with multi-monitor testing, take your time.
@sevz17 (Apologies for such delay on this one. Life has been in the way.)
Testing of layer shell client: waybar:
On multi-monitor, layer-shell clients display correctly on all monitors. Popup surfaces spawned by a layer shell client on the monitor at position 0, 0 show correctly. HOWEVER: Popup surfaces spawned by a layer shell client on another monitor show up on the 0, 0 position monitor
does this diff any difference?
diff --git a/dwl.c b/dwl.c
index f6da247..96dcd50 100644
--- a/dwl.c
+++ b/dwl.c
@@ -1372,6 +1372,7 @@ void
maplayersurfacenotify(struct wl_listener *listener, void *data)
{
LayerSurface *l = wl_container_of(listener, l, map);
+ l->mon = l->layer_surface->output->data;
wlr_surface_send_enter(l->layer_surface->surface, l->mon->wlr_output);
motionnotify(0);
}
and... in the main branch it works as expected?
This diff made no change. Popup layers spawned by secondary monitors still show up on the primary monitor.
This issue is identical in the main branch and does not work correctly there either.
Ok, and this one?
diff --git a/dwl.c b/dwl.c
index f6da247..1b03d9f 100644
--- a/dwl.c
+++ b/dwl.c
@@ -973,8 +973,8 @@ createnotify(struct wl_listener *listener, void *data)
if (!l || !l->mon)
return;
box = l->type == LayerShell ? l->mon->m : l->mon->w;
- box.x -= l->geom.x;
- box.y -= l->geom.y;
+ box.x = l->type == LayerShell ? 0 - l->geom.x : box.x - l->geom.x;
+ box.y = l->type == LayerShell ? 0 - l->geom.y : box.y - l->geom.y;
wlr_xdg_popup_unconstrain_from_box(xdg_surface->popup, &box);
return;
} else if (xdg_surface->role == WLR_XDG_SURFACE_ROLE_NONE)
This latest change causes popup layers to not show at all when spawned by a client on a non-primary monitor. The popup layer still shows correctly when spawned by a client that is on the primary monitor.
ah, I should have asked you first: in gdb what is the output of p l->geom
, p l->mon->m
and p box
when spawning a layer shell popup on a non-primary monitor (at the line 978)?
Apologies for the delay. With two 1920x1080 monitors, here are the outputs requested:
(gdb) p l->geom
$1 = {x = 1920, y = 0, width = 1920, height = 23}
(gdb) p l->mon->m
$2 = {x = 1920, y = 0, width = 1920, height = 1080}
(gdb)
Mmm, that are the values expected, to be honest I don't know why the popups doesn't appear, The box should be in the popup's root toplevel parent surface coordinate system
, which in this case is 0,0
@sevz17: For clarity: the popups DO appear. But if a popup SHOULD appear on a secondary monitor (because it is spawned by a layer-surface client on a secondary monitor), it shows up on the PRIMARY monitor instead. The issue is NOT introduced by this branch's changes. This is the same in the master branch, so merging this really does not cause any noticeable regression.