From 90f7b45841e534819ebe69232528613069217203 Mon Sep 17 00:00:00 2001 From: Thomas Adam Date: Sat, 3 Oct 2020 00:59:47 +0100 Subject: [PATCH] EWMH area: don't crop the boundary When getting the working EWMH area, don't crop the boundary to the screen edge. --- fvwm/ewmh.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/fvwm/ewmh.c b/fvwm/ewmh.c index b6f0a1d61..d5dea7dda 100644 --- a/fvwm/ewmh.c +++ b/fvwm/ewmh.c @@ -979,8 +979,8 @@ void ewmh_ComputeAndSetWorkArea(struct monitor *m) bottom = max(bottom, fw->strut.bottom); } - w = m->si->x + m->si->w; - h = m->si->y + m->si->h; + w = m->si->x > 0 ? m->si->x : 0 + m->si->w; + h = m->si->y > 0 ? m->si->y : 0 + m->si->y + m->si->h; x = left; y = top; @@ -1038,8 +1038,8 @@ void ewmh_HandleDynamicWorkArea(struct monitor *m) dyn_bottom = max(dyn_bottom, fw->dyn_strut.bottom); } - w = m->si->x + m->si->w; - h = m->si->y + m->si->h; + w = m->si->x > 0 ? m->si->x : 0 + m->si->w; + h = m->si->y > 0 ? m->si->y : 0 + m->si->y + m->si->h; x = dyn_left; y = dyn_top; width = w - (dyn_left + dyn_right); @@ -1109,8 +1109,8 @@ void EWMH_GetWorkAreaIntersection( } nx = max(*x, area_x); ny = max(*y, area_y); - nw = min(*x + *w, area_x + area_w) - nx; - nh = min(*y + *h, area_y + area_h) - ny; + nw = min(*x + *w, area_x + area_w); + nh = min(*y + *h, area_y + area_h); *x = nx; *y = ny;