Subject: Small MultiPixmap Fix

From: Suzanne Skinner <[email-masked]>
Date: Sun, 8 Sep 2002 19:00:04 -0400

The attached patch to borders.c in CVS fixes a small bug with MultiPixmap
titlebars. The bug causes the titlebar to sometimes not update properly
immediately after a resize.

Suzanne

-- 
[email-masked] - http://www.igs.net/~tril/
--- borders.c.orig	Sun Sep  8 17:52:15 2002
+++ borders.c	Sun Sep  8 17:52:28 2002
@@ -259,7 +259,6 @@
 	int before_space, after_space, under_offset, under_width;
 	int size;
 	FlocaleWinString fstr;
-	rectangle tmp_g;
 	Bool has_vt = HAS_VERTICAL_TITLE(fw);
 
 	pm = df->u.multi_pixmaps;
@@ -268,20 +267,19 @@
 	XSetClipMask(dpy, gc, None);
 	title = fw->visible_name;
 
-	tmp_g.width = 0;
-	tmp_g.height = 0;
-	get_title_geometry(fw, &tmp_g);
 	if (pm[TBP_MAIN])
 	{
 		border_render_into_pixmap(
-			gc, pm[TBP_MAIN], dest_pix, 0, 0, tmp_g.width,
-			tmp_g.height, (stretch_flags & (1 << TBP_MAIN)));
+			gc, pm[TBP_MAIN], dest_pix, 0, 0,
+			SWAP_ARGS(has_vt, fw->title_length, fw->title_thickness),
+			(stretch_flags & (1 << TBP_MAIN)));
 	}
 	else if (!title)
 	{
 		border_render_into_pixmap(
-			gc, pm[TBP_LEFT_MAIN], dest_pix, 0, 0, tmp_g.width,
-			tmp_g.height, (stretch_flags & (1 << TBP_LEFT_MAIN)));
+			gc, pm[TBP_LEFT_MAIN], dest_pix, 0, 0,
+			SWAP_ARGS(has_vt, fw->title_length, fw->title_thickness),
+			(stretch_flags & (1 << TBP_LEFT_MAIN)));
 	}
 
 	if (title)

---

From: Dominik Vogt <[email-masked]>
Date: Mon, 9 Sep 2002 11:00:02 +0200

> immediately after a resize.

I don't understand what this patch changes.  The values returned
by get_title_geometry should be the same as fw->title_length and
fw->title_thickness.  What exactly do I have to do to make this
happen? (Please include a config file, I've not tried the
MultiPixmap patch yet).

Bye

Dominik ^_^  ^_^

 --
Dominik Vogt, mail: [email-masked], phone: 0721/91374-382
Schlund + Partner AG, Erbprinzenstr. 4-12, D-76133 Karlsruhe
--
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: Suzanne Skinner <[email-masked]>
Date: Mon, 9 Sep 2002 14:09:17 -0400

> fw->title_thickness.

It is indeed strange--it seems that the return values of get_title_geometry
are invalid (reflecting the pre-resize dimensions of the window) on the first
refresh.

To reproduce, use the attached fvwm2rc and replace the wood.xpm pixmap with a
tileable pixmap that exists on your system. Go into fvwm and start an xterm.
Resize it horizontally. It may take a couple tries but eventually you should
end up with a gray rectangle in the titlebar. The patch seems to fix this.

Suzanne

---

From: Dominik Vogt <[email-masked]>
Date: Tue, 10 Sep 2002 09:54:11 +0200

> end up with a gray rectangle in the titlebar. The patch seems to fix this.

I'll take a look at the problem when CVS runs again.  We should
find the root cause of the problem.  The functions in geometry.c
are the only ones that should access the titlebar layout members
of the window structure in the long run.

Bye

Dominik ^_^  ^_^

---

From: Dominik Vogt <[email-masked]>
Date: Sun, 15 Sep 2002 23:23:51 +0200

> are invalid (reflecting the pre-resize dimensions of the window) on the first

The return values are invalid because the function must not be
called from borders.c.  Instead, the desired geometry is passed in
via the structure "titlebar_descr *td":

  td->layout.title_g

The caller of border_draw_multi_pixmap_titlebar() didn't pass that
argument, so the function used get_title_geometry() instead.
Along with the fix, I added a warning at the beginning of the
file.

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]