Subject: Re: FVWM: AspectPixmap not fitting menu ...

From: Dominik Vogt <[email-masked]>
Date: Mon, 17 Mar 2003 11:19:17 +0100

(moved to fvwm-workers)

On Mon, Mar 17, 2003 at 06:04:25PM +1100, Cameron Simpson wrote:
> It's long bugged me that my AspectPixmap menu backdrops don't always fit
> the menu; indeed, they rarely fit perfectly. Now, I know the image itself
> cannot always fit, but I expected tiling after the scaling. Instead I
> see patches from previous menu backdrops (I switch menu backdrop images
> every so often).
> 
> So I went to the source and found in libs/Colorset.c, line 600 or so:
> 
> 	/* Draws a colorset background into the specified rectangle in the target
> 	 * drawable. */                 
> 	void SetClippedRectangleBackground(
> 
> I'm a bit puzzled. Now I understand why it looks as it does, and I admit
> I've not yet read the code and the calling code properly, but can someone
> who understands the colorset code tell me why a menu background is simply
> drawn once onto the area instead of being set as the XWindow's background
> pixmap, which would then be tiled nicely but the X server?
> 
> Such an arrangement would let one use AspectPixmap to get the image
> roughly right and then have the X server hide the edges with more
> backdrop.
> 
> Failing this, shouldn't FVWM be blacking out (or something - maybe
> the background-colour value if present in the Style) the whole menu
> backdrop first?

THere is a bug in the aspect stretching code.  If the pixmap is
wider than it is tall, it is stretched to fit the target
rectangle's height, and if it is taller than it is wide it is
stretched to match the target width.  For example, if the pixmap
and has this format:

  +------+
  |      |
  |      |
  |      |
  |      |
  |      |
  +------+

And the menu this:

  +------+
  |      |
  |      |
  |      |
  |      |
  |      |
  |      |
  |      |
  |      |
  +------+

The pixmap only occupies the upper part of the menu.  I think we
a "TiledAspectPixmap" option too.

Bye

Dominik ^_^  ^_^
--
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: Cameron Simpson <[email-masked]>
Date: Tue, 18 Mar 2003 10:14:31 +1100

On 11:19 17 Mar 2003, Dominik Vogt <[email-masked]> wrote:
| (moved to fvwm-workers)
| On Mon, Mar 17, 2003 at 06:04:25PM +1100, Cameron Simpson wrote:
| > It's long bugged me that my AspectPixmap menu backdrops don't always fit
| > the menu; indeed, they rarely fit perfectly. Now, I know the image itself
| > cannot always fit, but I expected tiling after the scaling. Instead I
| > see patches from previous menu backdrops (I switch menu backdrop images
| > every so often).
| > 	[...] /* Draws a colorset background into the specified rectangle in the target
| > 	 * drawable. */ [...]
| > can someone
| > who understands the colorset code tell me why a menu background is simply
| > drawn once onto the area instead of being set as the XWindow's background
| > pixmap, which would then be tiled nicely but the X server?
| > 
| > Such an arrangement would let one use AspectPixmap to get the image
| > roughly right and then have the X server hide the edges with more
| > backdrop.
| > 
| > Failing this, shouldn't FVWM be blacking out (or something - maybe
| > the background-colour value if present in the Style) the whole menu
| > backdrop first?
| 
| THere is a bug in the aspect stretching code.  If the pixmap is
| wider than it is tall, it is stretched to fit the target
| rectangle's height, and if it is taller than it is wide it is
| stretched to match the target width.  For example, if the pixmap
| and has this format:
| [... taller-than-wide rectangle ...]
| And the menu this:
| [... even taller rectangle ...]
| The pixmap only occupies the upper part of the menu.

Mine is in the middle, not the top, but no matter.

This is not the bug. AspectPixmap is required to preserve the image aspect
ratio, and therefore cannot fit the menu all the time, and indeed will
rarely be a perfect fit.

The bug is that portion of the menu not fit by the pixmap is old historic
pixmap data. I thin it should either be some background colour or a
tiled copy of the AspectPixmap.

It also doesn't really address the question of why the pixmap is drawn
onto the menu instead of being set as the XWindow's background. I'm
curious about the reason for this choice. It seems to me that putting
it as the background would get you tiling for free.

| I think we
| a "TiledAspectPixmap" option too.

It's not in the 2.5.6 FvwmTheme manual entry.

Cheers,
-- 
Cameron Simpson, DoD#743        [email-masked]    http://www.zip.com.au/~cs/

In the unlikely event of losing Pascal's Wager, I intend to saunter in to
Judgement Day with a bookshelf full of grievances, a flaming sword of my
own devising, and a serious attitude problem.	- Rick Moen
--
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, 18 Mar 2003 09:40:51 +0100

> Mine is in the middle, not the top, but no matter.

Yes.

> ratio, and therefore cannot fit the menu all the time, and indeed will

It can not be made a perfect fit, but it can be made lager than
the target rectangle.

> | a "TiledAspectPixmap" option too.

Read: I think we *need* a "TiledAspectPixmap" option too.

Bye

Dominik ^_^  ^_^