aboutsummaryrefslogtreecommitdiff
path: root/dwl.c
diff options
context:
space:
mode:
authorGuido Cella <guidocella91@gmail.com>2020-09-08 10:28:29 +0200
committerGuido Cella <guidocella91@gmail.com>2020-09-08 10:28:29 +0200
commit69847872bb1d3ac7dd259facb97934da66c27cc5 (patch)
tree7d00d0193f75d0c69ee3e19bb767d8ab39d944c7 /dwl.c
parent79f3bbaf38a844f21ccc95d5dcdc60e871ac2840 (diff)
fix multi monitors
If you don't recalculate the monitor's geometry before arranging, clients get arranged in the first monitor. I don't understand why this fixes the bug since tile() uses m->w rather than m->m, nor why it needs to be recalculated after creating the monitor but sway does it too. Although not necessary to fix the bug I also made arrangelayer() do like sway again and recalculate usable_area instead of reusing m->m, since m->m seems to be incorrect until it gets recalculated shortly after in arrange(), so I suspect that leaving usable_area = m->m will cause issues under certain circumstances. Someone with a multi-monitor setup or better knowledge of Wayland may be able to figure out the cause of the bug. For now, this makes layer shell work.
Diffstat (limited to 'dwl.c')
-rw-r--r--dwl.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/dwl.c b/dwl.c
index bd7ea6c..c921fa9 100644
--- a/dwl.c
+++ b/dwl.c
@@ -463,6 +463,7 @@ applyrules(Client *c)
void
arrange(Monitor *m)
{
+ m->m = *wlr_output_layout_get_box(output_layout, m->wlr_output);
if (m->lt[m->sellt]->arrange)
m->lt[m->sellt]->arrange(m);
/* XXX recheck pointer focus here... or in resize()? */
@@ -549,7 +550,7 @@ arrangelayer(Monitor *m, struct wl_list *list, struct wlr_box *usable_area, bool
void
arrangelayers(Monitor *m)
{
- struct wlr_box usable_area = m->m;
+ struct wlr_box usable_area = { 0 };
uint32_t layers_above_shell[] = {
ZWLR_LAYER_SHELL_V1_LAYER_OVERLAY,
ZWLR_LAYER_SHELL_V1_LAYER_TOP,
@@ -558,6 +559,9 @@ arrangelayers(Monitor *m)
LayerSurface *layersurface;
struct wlr_keyboard *kb = wlr_seat_get_keyboard(seat);
+ wlr_output_effective_resolution(m->wlr_output,
+ &usable_area.width, &usable_area.height);
+
// Arrange exclusive surfaces from top->bottom
arrangelayer(m, &m->layers[ZWLR_LAYER_SHELL_V1_LAYER_OVERLAY],
&usable_area, true);