Here you go...

On Fri, Nov 04, 2011 at 06:43:59PM +0100, Anselm R Garbe wrote:
> Hi Brian,
> 
> thanks for your patch. I would like to test it.
> 
> Can you resend it as attachment that is created using
> 
> cd dwm/
> hg diff > dwm_two_monitor_fix.patch
> 
> Thanks in advance,
> Anselm
> 
> On 2 November 2011 22:19, Brian L Angus <an...@eng.utah.edu> wrote:
> > Hello and thanks for the wonder that is dwm.
> >
> > Below is a patch for issues I have found with 2 monitors where one
> > monitor is below another.
> >
> > The issue can be found when moving a floating window that fills the
> > entire available area from one monitor to another. ??(This is with a
> > borderpx of 0)
> >
> > thanks,
> > Brian
> >
> >
> > Index: dwm.c
> > ===================================================================
> > --- dwm.c
> > +++ dwm.c
> > @@ -338,18 +338,18 @@
> > ?? ?? ?? ?? ?? ?? ?? ?? ?? ?? ?? ??*x = 0;
> > ?? ?? ?? ?? ?? ?? ?? ??if(*y + *h + 2 * c->bw < 0)
> > ?? ?? ?? ?? ?? ?? ?? ?? ?? ?? ?? ??*y = 0;
> > ?? ?? ?? ??}
> > ?? ?? ?? ??else {
> > - ?? ?? ?? ?? ?? ?? ?? if(*x > m->mx + m->mw)
> > - ?? ?? ?? ?? ?? ?? ?? ?? ?? ?? ?? *x = m->mx + m->mw - WIDTH(c);
> > - ?? ?? ?? ?? ?? ?? ?? if(*y > m->my + m->mh)
> > - ?? ?? ?? ?? ?? ?? ?? ?? ?? ?? ?? *y = m->my + m->mh - HEIGHT(c);
> > - ?? ?? ?? ?? ?? ?? ?? if(*x + *w + 2 * c->bw < m->mx)
> > - ?? ?? ?? ?? ?? ?? ?? ?? ?? ?? ?? *x = m->mx;
> > - ?? ?? ?? ?? ?? ?? ?? if(*y + *h + 2 * c->bw < m->my)
> > - ?? ?? ?? ?? ?? ?? ?? ?? ?? ?? ?? *y = m->my;
> > + ?? ?? ?? ?? ?? ?? ?? if(*x >= m->wx + m->ww)
> > + ?? ?? ?? ?? ?? ?? ?? ?? ?? ?? ?? *x = m->wx + m->ww - WIDTH(c);
> > + ?? ?? ?? ?? ?? ?? ?? if(*y >= m->wy + m->wh)
> > + ?? ?? ?? ?? ?? ?? ?? ?? ?? ?? ?? *y = m->wy + m->wh - HEIGHT(c);
> > + ?? ?? ?? ?? ?? ?? ?? if(*x + *w + 2 * c->bw <= m->wx)
> > + ?? ?? ?? ?? ?? ?? ?? ?? ?? ?? ?? *x = m->wx;
> > + ?? ?? ?? ?? ?? ?? ?? if(*y + *h + 2 * c->bw <= m->wy)
> > + ?? ?? ?? ?? ?? ?? ?? ?? ?? ?? ?? *y = m->wy;
> > ?? ?? ?? ??}
> > ?? ?? ?? ??if(*h < bh)
> > ?? ?? ?? ?? ?? ?? ?? ??*h = bh;
> > ?? ?? ?? ??if(*w < bh)
> > ?? ?? ?? ?? ?? ?? ?? ??*w = bh;
> > @@ -1144,11 +1144,11 @@
> > ?? ?? ?? ?? ?? ?? ?? ?? ?? ?? ?? ??c->x = c->mon->mx + c->mon->mw - 
> > WIDTH(c);
> > ?? ?? ?? ?? ?? ?? ?? ??if(c->y + HEIGHT(c) > c->mon->my + c->mon->mh)
> > ?? ?? ?? ?? ?? ?? ?? ?? ?? ?? ?? ??c->y = c->mon->my + c->mon->mh - 
> > HEIGHT(c);
> > ?? ?? ?? ?? ?? ?? ?? ??c->x = MAX(c->x, c->mon->mx);
> > ?? ?? ?? ?? ?? ?? ?? ??/* only fix client y-offset, if the client center 
> > might cover the bar */
> > - ?? ?? ?? ?? ?? ?? ?? c->y = MAX(c->y, ((c->mon->by == 0) && (c->x + (c->w 
> > / 2) >= c->mon->wx)
> > + ?? ?? ?? ?? ?? ?? ?? c->y = MAX(c->y, ((c->mon->by == c->mon->my) && 
> > (c->x + (c->w / 2) >= c->mon->wx)
> > ?? ?? ?? ?? ?? ?? ?? ?? ?? ?? ?? ?? ?? && (c->x + (c->w / 2) < c->mon->wx + 
> > c->mon->ww)) ? bh : c->mon->my);
> > ?? ?? ?? ?? ?? ?? ?? ??c->bw = borderpx;
> > ?? ?? ?? ??}
> > ?? ?? ?? ??wc.border_width = c->bw;
> > ?? ?? ?? ??XConfigureWindow(dpy, w, CWBorderWidth, &wc);
> >
> >
> >
diff -r 1228e3d45d25 dwm.c
--- a/dwm.c     Wed Nov 02 12:01:28 2011 +0000
+++ b/dwm.c     Fri Nov 04 12:56:00 2011 -0600
@@ -340,14 +340,14 @@
                        *y = 0;
        }
        else {
-               if(*x > m->mx + m->mw)
-                       *x = m->mx + m->mw - WIDTH(c);
-               if(*y > m->my + m->mh)
-                       *y = m->my + m->mh - HEIGHT(c);
-               if(*x + *w + 2 * c->bw < m->mx)
-                       *x = m->mx;
-               if(*y + *h + 2 * c->bw < m->my)
-                       *y = m->my;
+               if(*x >= m->wx + m->ww)
+                       *x = m->wx + m->ww - WIDTH(c);
+               if(*y >= m->wy + m->wh)
+                       *y = m->wy + m->wh - HEIGHT(c);
+               if(*x + *w + 2 * c->bw <= m->wx)
+                       *x = m->wx;
+               if(*y + *h + 2 * c->bw <= m->wy)
+                       *y = m->wy;
        }
        if(*h < bh)
                *h = bh;
@@ -1146,7 +1146,7 @@
                        c->y = c->mon->my + c->mon->mh - HEIGHT(c);
                c->x = MAX(c->x, c->mon->mx);
                /* only fix client y-offset, if the client center might cover 
the bar */
-               c->y = MAX(c->y, ((c->mon->by == 0) && (c->x + (c->w / 2) >= 
c->mon->wx)
+               c->y = MAX(c->y, ((c->mon->by == c->mon->my) && (c->x + (c->w / 
2) >= c->mon->wx)
                           && (c->x + (c->w / 2) < c->mon->wx + c->mon->ww)) ? 
bh : c->mon->my);
                c->bw = borderpx;
        }

Reply via email to