Greets all, The attached patch (applied to fvwm-snap-20020819) fixes MultiPixmap titlebars in CVS!
It turned out to be quite straightforward, as you'll see... Suzanne -- [EMAIL PROTECTED] - http://www.igs.net/~tril/
--- fvwm/borders.c.orig Tue Aug 20 00:31:43 2002 +++ fvwm/borders.c Tue Aug 20 00:41:06 2002 @@ -200,8 +200,8 @@ * by DrawMultiPixmapTitlebar. ([EMAIL PROTECTED]) * ****************************************************************************/ -static void RenderIntoWindow( - GC gc, FvwmPicture *src, Window dest, int x_start, int y_start, +static void RenderIntoPixmap( + GC gc, FvwmPicture *src, Pixmap dest, int x_start, int y_start, int width, int height, Bool stretch) { Pixmap pm; @@ -247,9 +247,9 @@ * ****************************************************************************/ #define SWAP_ARGS(f,a1,a2) (f)?(a2):(a1),(f)?(a1):(a2) -static void DrawMultiPixmapTitlebar(FvwmWindow *fw, DecorFace *df) +static void DrawMultiPixmapTitlebar(FvwmWindow *fw, DecorFace *df, + Pixmap dest_pix) { - Window title_win; GC gc; char *title; FvwmPicture **pm; @@ -265,7 +265,6 @@ stretch_flags = df->u.multi_stretch_flags; gc = Scr.TitleGC; XSetClipMask(dpy, gc, None); - title_win = FW_W_TITLE(fw); title = fw->visible_name; tmp_g.width = 0; @@ -273,14 +272,14 @@ get_title_geometry(fw, &tmp_g); if (pm[TBP_MAIN]) { - RenderIntoWindow( - gc, pm[TBP_MAIN], title_win, 0, 0, tmp_g.width, + RenderIntoPixmap( + gc, pm[TBP_MAIN], dest_pix, 0, 0, tmp_g.width, tmp_g.height, (stretch_flags & (1 << TBP_MAIN))); } else if (!title) { - RenderIntoWindow( - gc, pm[TBP_LEFT_MAIN], title_win, 0, 0, tmp_g.width, + RenderIntoPixmap( + gc, pm[TBP_LEFT_MAIN], dest_pix, 0, 0, tmp_g.width, tmp_g.height, (stretch_flags & (1 << TBP_LEFT_MAIN))); } @@ -347,16 +346,16 @@ if (pm[TBP_LEFT_MAIN] && before_space > 0) { - RenderIntoWindow( - gc, pm[TBP_LEFT_MAIN], title_win, 0, 0, + RenderIntoPixmap( + gc, pm[TBP_LEFT_MAIN], dest_pix, 0, 0, SWAP_ARGS(has_vt, before_space, fw->title_thickness), (stretch_flags & (1 << TBP_LEFT_MAIN))); } if (pm[TBP_RIGHT_MAIN] && after_space > 0) { - RenderIntoWindow( - gc, pm[TBP_RIGHT_MAIN], title_win, + RenderIntoPixmap( + gc, pm[TBP_RIGHT_MAIN], dest_pix, SWAP_ARGS(has_vt, under_offset + under_width, 0), SWAP_ARGS(has_vt, after_space, @@ -365,8 +364,8 @@ } if (pm[TBP_UNDER_TEXT] && under_width > 0) { - RenderIntoWindow( - gc, pm[TBP_UNDER_TEXT], title_win, + RenderIntoPixmap( + gc, pm[TBP_UNDER_TEXT], dest_pix, SWAP_ARGS(has_vt, under_offset, 0), SWAP_ARGS(has_vt, under_width, fw->title_thickness), @@ -377,7 +376,7 @@ { XCopyArea( - dpy, pm[TBP_LEFT_OF_TEXT]->picture, title_win, + dpy, pm[TBP_LEFT_OF_TEXT]->picture, dest_pix, gc, 0, 0, SWAP_ARGS(has_vt, size, fw->title_thickness), @@ -388,7 +387,7 @@ if (size > 0 && size <= after_space) { XCopyArea( - dpy, pm[TBP_RIGHT_OF_TEXT]->picture, title_win, + dpy, pm[TBP_RIGHT_OF_TEXT]->picture, dest_pix, gc, 0, 0, SWAP_ARGS(has_vt, size, fw->title_thickness), @@ -396,11 +395,11 @@ 0)); after_space -= size; } - size = fw->title_thickness; - text_offset = fw->title_text_offset; + + text_offset = fw->title_text_offset + 2; memset(&fstr, 0, sizeof(fstr)); fstr.str = fw->visible_name; - fstr.win = title_win; + fstr.win = dest_pix; if (has_vt) { fstr.x = text_offset; @@ -425,7 +424,7 @@ if (size > 0 && size <= before_space) { XCopyArea( - dpy, pm[TBP_LEFT_END]->picture, title_win, gc, 0, 0, + dpy, pm[TBP_LEFT_END]->picture, dest_pix, gc, 0, 0, SWAP_ARGS(has_vt, size, fw->title_thickness), 0, 0); } @@ -433,7 +432,7 @@ if (size > 0 && size <= after_space) { XCopyArea( - dpy, pm[TBP_RIGHT_END]->picture, title_win, gc, 0, 0, + dpy, pm[TBP_RIGHT_END]->picture, dest_pix, gc, 0, 0, SWAP_ARGS(has_vt, size, fw->title_thickness), fw->title_length - size, 0); } @@ -2113,7 +2112,7 @@ #ifdef FANCY_TITLEBARS else if (tdd.df->style.face_type == MultiPixmap) { - DrawMultiPixmapTitlebar(fw, tdd.df); + DrawMultiPixmapTitlebar(fw, tdd.df, dest_pix); } #endif else