Subject: Re: dashed separators in Pager

From: Dominik Vogt <[email-masked]>
Date: Sat, 30 Dec 2000 15:44:21 +0100

On Fri, Dec 29, 2000 at 03:03:50PM +0100, Giuseppe Della Ricca wrote:
> Hi Dominik,
> 
> concerning the problem with the dashed separators in the Pager changing
> during normal navigation between desks, I've found that the following
> patch can cure the problem: I suspect that the cause can be due to some
> rounding errors, but I'm not sure. Maybe it is elsewhere, I don't know.
> 
> But in any case, it looks like it works for me.
> 
> What do you think ? I know that it's not elegant: the idea is to start
> drawing the dashed lines always from the top-left corner of each
> 'sub-desk'.

If this patch is the cure, then your X server must be broken.  The
fact that your patch works for you proves that

 a) the calculation of x1, x2, y1 and y2 is correct.  Otherwise
    your code would not work either.
 b) the "dashed" line draw really looks like this: "- - - -----"
    although the gc and coordinates of the line are correct.

Which X server and OS did you use again?

Since the drawing algorithm seems to be broken, using a different
algorithm might cure the problem.  I have set the line width of
the dash lines from 0 to 1.  A 0 line width tells the X server to
use its fastest algorithm to draw lines of width 1.  Please tell
me if this solves your problem.

> PS
> in the attachment, a dump of my FvwmButton with swallowed FvwmPager
> showing the problems with the dashed saparators before the patch.

Please always send mail to the mailing list so everybody can read
and comment on it.

> --- x_pager.c.new	Fri Dec 29 13:27:47 2000
> +++ x_pager.c.orig	Fri Dec 29 11:17:29 2000
> @@ -1419,15 +1419,11 @@
>  void DrawGrid(int i, int erase)
>  {
>    int y, y1, y2, x, x1, x2,d,hor_off,ver_off,w;
> -  int j,n,m;
>    char str[15], *ptr;
> 
>    if((i < 0 ) || (i >= ndesks))
>      return;
> 
> -  n = Scr.VxMax / Scr.MyDisplayWidth;
> -  m = Scr.VyMax / Scr.MyDisplayHeight;
> -
>    x = Scr.MyDisplayWidth;
>    y1 = 0;
>    y2 = desk_h;
> @@ -1435,14 +1431,7 @@
>    {
>      x1 = x * desk_w / Scr.VWidth;
>      if (!use_no_separators)
> -    {
> -      j = 0;
> -      while(j < m+1)
> -      {
> -        XDrawLine(dpy,Desks[i].w,Desks[i].DashedGC,x1,y2*j/(m+1),x1,y2*(j+1)/(m+1));
> -        j++;
> -      }
> -    }
> +      XDrawLine(dpy,Desks[i].w,Desks[i].DashedGC,x1,y1,x1,y2);
>      x += Scr.MyDisplayWidth;
>    }
> 
> @@ -1453,14 +1442,7 @@
>    {
>      y1 = y * desk_h / Scr.VHeight;
>      if (!use_no_separators)
> -    {
> -      j = 0;
> -      while(j < n+1)
> -      {
> -        XDrawLine(dpy,Desks[i].w,Desks[i].DashedGC,x2*j/(n+1),y1,x2*(j+1)/(n+1),y1);
> -        j++;
> -      }
> -    }
> +      XDrawLine(dpy,Desks[i].w,Desks[i].DashedGC,x1,y1,x2,y1);
>      y += Scr.MyDisplayHeight;
>    }
>    if(((Scr.CurrentDesk - desk1)  == i) && !ShapeLabels)

Bye

Dominik ^_^  ^_^

--
Dominik Vogt, [email-masked]
Reply-To: [email-masked]
--
Visit the official FVWM web page at <URL:http://www.fvwm.org/>.
To unsubscribe from the list, send "unsubscribe fvwm-workers" in the
body of a message to [email-masked].
To report problems, send mail to [email-masked]

---

From: Giuseppe Della Ricca <[email-masked]>
Date: Sun, 31 Dec 2000 09:44:28 +0100 (CET)

On Sat, 30 Dec 2000, Dominik Vogt wrote:

> If this patch is the cure, then your X server must be broken.

> Which X server and OS did you use again?

I'm using the neomagic driver on XFree86 4.0.2 from RawHide on RH7.0
(I've not tested this on Xdec from True64 since I'm not at work)
I have a NeoMagic 2160 chipset (MagicGraph 128XD).

> me if this solves your problem.

*YES* this fixed the problem !

Now it's OK: maybe it has something to do with XAA under XFree 4, then ?

In any case, now everything in Fvwm2 it's working fine for me !!!
So I don't have any 'problem report' left for 2001 ...

Thanks a lot !

Cheers,
Giuseppe.