Subject: [BUG] Pager Balloons

From: Stephane Chazelas <[email-masked]>
Date: Mon, 23 Aug 1999 14:24:35 -0700

Hi,

I've no easy web access from here, so I send you this bug report as an
email, sorry.

I've got the FvwmPager iconic in the down right corner of the screen.  If a
balloon doesn't fit in the screen horizontally _and_ vertically, it is badly
displayed horizontally. This is because, balloon position is first checked
horizontally and then vertically, and `vertical' modifications cancel
`horizontal' ones and then the right side of the balloon is outside the screen.
Here is the code responsible for it (modules/FvwmPager/x_pager.c):

  /* too close to left */
  if ( window_changes.x < 2 )
    window_changes.x = 2;

  /* too close to right */
  else if ( window_changes.x + window_changes.width >
            Scr.MyDisplayWidth - (2 * Desks[i].balloon.border) - 2 )
    window_changes.x = Scr.MyDisplayWidth - window_changes.width -
####   First change

      (2 * Desks[i].balloon.border) - 2;

  /* too close to top ... make yoffset +ve */
  if ( window_changes.y < 2 ) {
    y = - Desks[i].balloon.yoffset + view_height;
    XTranslateCoordinates(dpy, view, Scr.Root, x, y,
                          &window_changes.x, &window_changes.y, &dummy);
  }

  /* too close to bottom ... make yoffset -ve */
  else if ( window_changes.y + Desks[i].balloon.height >
            Scr.MyDisplayHeight - (2 * Desks[i].balloon.border) - 2 ) {
    y = - Desks[i].balloon.yoffset - Desks[i].balloon.height -

      (2 * Desks[i].balloon.border);
    XTranslateCoordinates(dpy, view, Scr.Root, x, y,
                          &window_changes.x, &window_changes.y, &dummy);
####                   2nd change, last change forgotten.

  }

Suggested fix: just put horizontal check after vertical check:

  /* too close to top ... make yoffset +ve */
  if ( window_changes.y < 2 ) {
    y = - Desks[i].balloon.yoffset + view_height;
    XTranslateCoordinates(dpy, view, Scr.Root, x, y,
                          &window_changes.x, &window_changes.y, &dummy);
  }

  /* too close to bottom ... make yoffset -ve */
  else if ( window_changes.y + Desks[i].balloon.height >
            Scr.MyDisplayHeight - (2 * Desks[i].balloon.border) - 2 ) {
    y = - Desks[i].balloon.yoffset - Desks[i].balloon.height -

      (2 * Desks[i].balloon.border);
    XTranslateCoordinates(dpy, view, Scr.Root, x, y,
                          &window_changes.x, &window_changes.y, &dummy);
  }

  /* too close to left */
  if ( window_changes.x < 2 )
    window_changes.x = 2;

  /* too close to right */
  else if ( window_changes.x + window_changes.width >
            Scr.MyDisplayWidth - (2 * Desks[i].balloon.border) - 2 )
    window_changes.x = Scr.MyDisplayWidth - window_changes.width -

      (2 * Desks[i].balloon.border) - 2;

regards,
Stephane
--
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: Dominik Vogt <[email-masked]>
Date: Tue, 24 Aug 1999 00:22:37 +0200

> Suggested fix: just put horizontal check after vertical check:

Thanks, I've fixed it in the development code.

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]