Re: WAS fvwm and patches
On Fri, 7 Mar 2008 13:49:30 +0100 Dominik Vogt [EMAIL PROTECTED] wrote: On Fri, Mar 07, 2008 at 12:39:54PM +0100, Jesús Guerrero wrote: On Fri, 7 Mar 2008 06:55:39 +0100 Jesús Guerrero [EMAIL PROTECTED] wrote: On Fri, 7 Mar 2008 00:44:09 +0100 Jesús Guerrero [EMAIL PROTECTED] wrote: Attached: Style InactiveFont patch [...] Isn't this already possible to do with TitleStyle? I don't think so. TitleStyle can't be used to change fonts I think. The purpose of this patch is to be able to use a different font for focused and non-focused windows. For example: to use a standard font for inactive windows, and the same font but bold for the active one. Correct me if I am wrong, but I don't think that TitleStyle can do that. I'd be glad to be wrong. One less patch needed. Regards. -- Jesús Guerrero [EMAIL PROTECTED]
Re: WAS fvwm and patches
On Fri, 7 Mar 2008 06:55:39 +0100 Jesús Guerrero [EMAIL PROTECTED] wrote: On Fri, 7 Mar 2008 00:44:09 +0100 Jesús Guerrero [EMAIL PROTECTED] wrote: Attached: Style InactiveFont patch -- Jesús Guerrero [EMAIL PROTECTED] This patch has some serious problem. It segfaults for me when restarting the wm, but only if there are windows open. The fvwm modules and urxvtc seems to work ok. But if I have firefox, sylpheed, kcalc or any other thing open, it segfaults when restarting. The last thing I can see is the window title and borders being redrawn with the grey default decoration. And with fixed font. I tried gdb but it freezes when it reaches that point. So, it's not of so much help. I have to investigate a bit more. -- Jesús Guerrero [EMAIL PROTECTED]
Re: WAS fvwm and patches
On Fri, Mar 07, 2008 at 02:26:49AM +0100, Jesús Guerrero wrote: On Fri, 7 Mar 2008 00:44:09 +0100 Jesús Guerrero [EMAIL PROTECTED] wrote: Conditionals patch revised and attached. Is it valid? Does it lack something? I don't want to add patches like this anymore. Fvwm should have generic parsing of styles, states and conditions to that *all* stlye names are state names and condition names at the same time. I don't think any of this should be included in 2.6. My idea is to shorten the list of available patches as much as we can by including those that are evidently clean, useful and harmless upstream. That way, we can ease the process for the rest of the patches. -- Jesús Guerrero [EMAIL PROTECTED] /section diff -U5 -r fvwm/fvwm/conditional.c fvwm/fvwm/conditional.c --- fvwm/fvwm/conditional.c 2007-10-06 11:17:09.0 +0200 +++ fvwm/fvwm/conditional.c 2008-03-07 01:10:54.0 +0100 @@ -598,10 +598,40 @@ else if (StrEquals(cond,HasHandles)) { SET_HAS_HANDLES(mask, on); SETM_HAS_HANDLES(mask, 1); } + else if (StrEquals(cond, HasTitle)) + { + SET_HAS_TITLE(mask, on); + SETM_HAS_TITLE(mask, 1); This should probably check for the actual title heigt too. + } + else if (StrEquals(cond, HasBorders)) + { + SET_HAS_NO_BORDER(mask, !on); + SETM_HAS_NO_BORDER(mask, 1); This should probably check for the actual border heigt too. + } + else if (StrEquals(cond, TitleAtBottom)) + { + SET_TITLE_DIR(mask, DIR_S); + SETM_TITLE_DIR(mask, 1); + } + else if (StrEquals(cond, TitleAtTop)) + { + SET_TITLE_DIR(mask, DIR_N); + SETM_TITLE_DIR(mask, 1); + } + else if (StrEquals(cond, TitleAtLeft)) + { + SET_TITLE_DIR(mask, DIR_W); + SETM_TITLE_DIR(mask, 1); + } + else if (StrEquals(cond, TitleAtRight)) + { + SET_TITLE_DIR(mask, DIR_E); + SETM_TITLE_DIR(mask, 1); + } else if (StrEquals(cond,Iconifiable)) { SET_IS_UNICONIFIABLE(mask, !on); SETM_IS_UNICONIFIABLE(mask, 1); } Ciao Dominik ^_^ ^_^ P.S.: Ich lese E-Post nur zweimal täglich. -- Dominik Vogt
Re: WAS fvwm and patches
On Fri, Mar 07, 2008 at 06:12:25AM +0100, Jesús Guerrero wrote: On Fri, 7 Mar 2008 05:46:33 +0100 Jesús Guerrero [EMAIL PROTECTED] wrote: Slight correction on NEWS Note that patches changing the window layout need extensive testing before they can be included: * All combinations of different border drawing styles, * HiddenHandles, * Test them with all BorderWidths of 0, 1, 2, 3, 4, 5, 6, and 7, * Rotated titles, * Shading in all eight directions (checking that the animation has no visible quirks), * Check what happens if the window title is reduced to just a couple of pixels, * check if it works with TitleHeight, * etc. Only decoration patches that were tested against all of these have a chance to be included. Ciao Dominik ^_^ ^_^ -- Dominik Vogt
Re: WAS fvwm and patches
On Fri, Mar 07, 2008 at 07:25:44AM +0100, Jesús Guerrero wrote: Hello, another one: ResizeOutlineThin I'm against this patch as I was when I first saw this patch. There is no need to bloat fvwm with irrelevant options: there is no real reason to have this configurable, the benefit of this is close to zero. It's just code cloat. Ciao Dominik ^_^ ^_^ P.S.: Ich lese E-Post nur zweimal täglich. -- Dominik Vogt
Re: WAS fvwm and patches
On Thu, 06 Mar 2008 20:34:03 -0500 Dan Espen [EMAIL PROTECTED] wrote: =?ISO-8859-1?Q?Jes=FAs?= Guerrero [EMAIL PROTECTED] writes: On Fri, 7 Mar 2008 00:44:09 +0100 Jes=FAs Guerrero [EMAIL PROTECTED] wrote: Conditionals patch revised and attached. Is it valid? Does it lack something? My idea is to shorten the list of available patches as much as we can by=20 including those that are evidently clean, useful and harmless upstream. That way, we can ease the process for the rest of the patches. Except for not updating test cases (which almost no one is doing), it looks clean and reasonable to me. I saw that file and plan to update it. I just need to watch into it to understand the logic of the thing. Feel free to give any advice if you feel that there's something relevant that I should know. For now, I have a preliminary versions with that file included. Attached. -- Jesús Guerrero [EMAIL PROTECTED] diff -U5 -r fvwm/ChangeLog fvwm/ChangeLog --- fvwm/ChangeLog 2008-03-04 01:09:54.0 +0100 +++ fvwm/ChangeLog 2008-03-07 01:33:47.0 +0100 @@ -1,5 +1,13 @@ +2008-03-07 Jesús Guerrero i92guboj(at)terra(dot)es + + * fvwm/contitionals.c (CreateConditionMask): + add some conditional masks: HasTitle, HasBorders, + TitleAtBottom, TitleAtTop, TitleAtLeft, TitleAtRight + * doc/fvwm/conditionals.xml + documentation for the new conditions + 2008-02-29 Viktor Griph griph(at)dd(dot)chalmers(dot)se * fvwm/add_window.c (setup_frame_window): fix core dump with ARGB detection code fix compilation without XRender diff -U5 -r fvwm/doc/fvwm/conditionals.xml fvwm/doc/fvwm/conditionals.xml --- fvwm/doc/fvwm/conditionals.xml 2007-08-07 00:24:03.0 +0200 +++ fvwm/doc/fvwm/conditionals.xml 2008-03-07 01:33:06.0 +0100 @@ -187,11 +187,17 @@ emphasis remap='I'StickyAcrossPages/emphasis, emphasis remap='I'StickyIcon/emphasis, emphasis remap='I'StickyAcrossDesksIcon/emphasis, emphasis remap='I'StickyAcrossPagesIcon/emphasis, emphasis remap='I'Transient/emphasis, -emphasis remap='I'Visible/emphasis./para +emphasis remap='I'Visible/emphasis, +emphasis remap='I'HasTitle/emphasis, +emphasis remap='I'HasBorders/emphasis, +emphasis remap='I'TitleAtBottom/emphasis, +emphasis remap='I'TitleAtTop/emphasis, +emphasis remap='I'TitleAtLeft/emphasis, +emphasis remap='I'TitleAtRight/emphasis./para paraThe emphasis remap='I'AcceptsFocus/emphasis condition excludes all windows that do not want the input focus (the application has set the Input hints for the window to @@ -454,10 +460,23 @@ emphasis remap='I'Visible/emphasis condition matches only windows that are at least partially visible on the current viewport and not completely overlapped by other windows./para +paraThe +emphasis remap='I'HasTitle/emphasis +condition matches only windows that have a title bar./para + +paraThe +emphasis remap='I'HasBorders/emphasis +condition matches only windows that have borders./para + +paraThe +emphasis remap='I'TitleAtBottom/emphasis, emphasis remap='I'TitleAtTop/emphasis, emphasis remap='I'TitleAtLeft/emphasis, emphasis remap='I'TitleAtRight/emphasis, +conditions matches respectively only windows that have a title +bar, and have it on the specified location./para + /section /section diff -U5 -r fvwm/fvwm/conditional.c fvwm/fvwm/conditional.c --- fvwm/fvwm/conditional.c 2007-10-06 11:17:09.0 +0200 +++ fvwm/fvwm/conditional.c 2008-03-07 01:10:54.0 +0100 @@ -598,10 +598,40 @@ else if (StrEquals(cond,HasHandles)) { SET_HAS_HANDLES(mask, on); SETM_HAS_HANDLES(mask, 1); } + else if (StrEquals(cond, HasTitle)) + { + SET_HAS_TITLE(mask, on); + SETM_HAS_TITLE(mask, 1); + } + else if (StrEquals(cond, HasBorders)) + { + SET_HAS_NO_BORDER(mask, !on); + SETM_HAS_NO_BORDER(mask, 1); + } + else if (StrEquals(cond, TitleAtBottom)) + { + SET_TITLE_DIR(mask, DIR_S); + SETM_TITLE_DIR(mask, 1); + } + else if (StrEquals(cond, TitleAtTop)) + { + SET_TITLE_DIR(mask, DIR_N); + SETM_TITLE_DIR(mask, 1); + } + else if (StrEquals(cond, TitleAtLeft)) + { + SET_TITLE_DIR(mask, DIR_W); + SETM_TITLE_DIR(mask, 1); + } + else if (StrEquals(cond, TitleAtRight)) + { + SET_TITLE_DIR(mask, DIR_E); + SETM_TITLE_DIR(mask, 1); + } else if (StrEquals(cond,Iconifiable)) { SET_IS_UNICONIFIABLE(mask, !on); SETM_IS_UNICONIFIABLE(mask, 1); } diff -U5 -r fvwm/NEWS fvwm/NEWS --- fvwm/NEWS 2008-03-04 01:09:54.0 +0100 +++ fvwm/NEWS 2008-03-07 01:50:47.0 +0100 @@ -3,10 +3,15 @@ --- Changes in beta release 2.5.26 (not released yet) +* New features: + + - Added new condition masks: HasTitle, HasBorders, + TitleAtBottom, TitleAtTop, TitleAtLeft, TitleAtRight + * Bug fixes: - Fix crash in ARGB visual detection code - Fix compilation without XRender support diff -U5 -r fvwm/tests/purify/purify.fvwm2rc
Re: WAS fvwm and patches
=?ISO-8859-1?Q?Jes=FAs?= Guerrero [EMAIL PROTECTED] writes: On Thu, 06 Mar 2008 20:34:03 -0500 Dan Espen [EMAIL PROTECTED] wrote: =3D?ISO-8859-1?Q?Jes=3DFAs?=3D Guerrero [EMAIL PROTECTED] writes: On Fri, 7 Mar 2008 00:44:09 +0100 Jes=3DFAs Guerrero [EMAIL PROTECTED] wrote: Conditionals patch revised and attached. Is it valid? Does it lack something? My idea is to shorten the list of available patches as much as we can b= including those that are evidently clean, useful and harmless upstream. That way, we can ease the process for the rest of the patches. Except for not updating test cases (which almost no one is doing), it looks clean and reasonable to me. I saw that file and plan to update it. I just need to watch into it to understand the logic of the thing. Feel free to give any advice if you feel that there's something relevant that I should know. The purpose of that file is to test every functionality of Fvwm using a debugging tool like Purify or Electric Fence. You just want to put something in there that runs thru the logic that the patch contains. For now, I have a preliminary versions with that file included. Attached. Looks good. -- Dan Espen E-mail: [EMAIL PROTECTED]
Re: WAS fvwm and patches
On Fri, 7 Mar 2008 00:44:09 +0100 Jesús Guerrero [EMAIL PROTECTED] wrote: I didn't know about the test tools in the package. The test config file for the menu certainly probed helpful when testing this patch. This is the patch to get flat 1pix thick separators in the menus. Patch attached: FlatSeparators -- Jesús Guerrero [EMAIL PROTECTED] diff -U5 -r fvwm/doc/commands/MenuStyle.xml fvwm/doc/commands/MenuStyle.xml --- fvwm/doc/commands/MenuStyle.xml 2007-08-18 00:36:49.0 +0200 +++ fvwm/doc/commands/MenuStyle.xml 2008-03-07 03:24:46.0 +0100 @@ -56,11 +56,11 @@ MenuFace, PopupDelay, PopupOffset, TitleWarp / !TitleWarp, TitleUnderlines0 / TitleUnderlines1 / TitleUnderlines2, -SeparatorsLong / SeparatorsShort, +SeparatorsLong / SeparatorsShort / FlatSeparators, TrianglesSolid / TrianglesRelief, PopupImmediately / PopupDelayed, PopdownImmediately / PopdownDelayed, PopupActiveArea, DoubleClickTime, @@ -429,10 +429,15 @@ set the length of menu separators. Long separators run from the left edge all the way to the right edge. Short separators leave a few pixels to the edges of the menu./para para +fvwmopt cmd=MenuStyle opt=FlatSeparators/ +changes the separators so that they are a single pixel thick and +colored the same as the text./para + +para fvwmopt cmd=MenuStyle opt=TrianglesSolid/ and fvwmopt cmd=MenuStyle opt=TrianglesRelief/ affect how the small triangles for sub menus is drawn. Solid triangles are filled with a color while relief triangles are hollow./para diff -U5 -r fvwm/fvwm/menuitem.c fvwm/fvwm/menuitem.c --- fvwm/fvwm/menuitem.c 2007-07-26 10:00:43.0 +0200 +++ fvwm/fvwm/menuitem.c 2008-03-07 03:18:49.0 +0100 @@ -80,14 +80,22 @@ * * Draws two horizontal lines to form a separator * */ static void draw_separator( - Window w, GC TopGC, GC BottomGC, int x1, int y, int x2) + Window w, GC TopGC, GC BottomGC, GC ForeGC, int x1, int y, int x2, + Bool do_flat_separators) { - XDrawLine(dpy, w, TopGC , x1, y, x2, y); - XDrawLine(dpy, w, BottomGC, x1-1, y+1, x2+1, y+1); + if (do_flat_separators) + { + XDrawLine(dpy, w, ForeGC, x1, y, x2, y); + } + else + { + XDrawLine(dpy, w, TopGC , x1, y, x2, y); + XDrawLine(dpy, w, BottomGC, x1-1, y+1, x2+1, y+1); + } return; } /* @@ -380,10 +388,11 @@ int off_cs; FvwmRenderAttributes fra; /*Pixel fg, fgsh;*/ int relief_thickness = ST_RELIEF_THICKNESS(ms); Bool is_item_selected; + Bool do_flat_separators; Bool item_cleared = False; Bool xft_clear = False; Bool empty_inter = False; XRectangle b; Region region = None; @@ -598,10 +607,12 @@ /* * Draw the item itself. */ + do_flat_separators = ST_DO_FLAT_SEPARATOR(ms); + /* Calculate the separator offsets. */ if (ST_HAS_LONG_SEPARATORS(ms)) { sx1 = MDIM_ITEM_X_OFFSET(*dim) + relief_thickness; sx2 = MDIM_ITEM_X_OFFSET(*dim) + MDIM_ITEM_WIDTH(*dim) - 1 - @@ -618,13 +629,13 @@ { if (sx1 sx2) { /* It's a separator. */ draw_separator( -mpip-w, gcs.shadow_gc, gcs.hilight_gc, sx1, -y_offset + y_height - MENU_SEPARATOR_HEIGHT, -sx2); +mpip-w, gcs.shadow_gc, gcs.hilight_gc, gcs.fore_gc, +sx1, y_offset + y_height - MENU_SEPARATOR_HEIGHT, +sx2, do_flat_separators); /* Nothing else to do. */ } return; } else if (MI_IS_TEAR_OFF_BAR(mi)) @@ -660,12 +671,12 @@ text_y += MENU_SEPARATOR_HEIGHT + add; y = y_offset + add; if (sx1 sx2) { draw_separator( - mpip-w, gcs.shadow_gc, gcs.hilight_gc, - sx1, y, sx2); + mpip-w, gcs.shadow_gc, gcs.hilight_gc, gcs.fore_gc, + sx1, y, sx2, do_flat_separators); } } /* Underline the title. */ switch (ST_TITLE_UNDERLINES(ms)) { @@ -674,12 +685,12 @@ case 1: if (MI_NEXT_ITEM(mi) != NULL) { y = y_offset + y_height - MENU_SEPARATOR_HEIGHT; draw_separator( - mpip-w, gcs.shadow_gc, gcs.hilight_gc, - sx1, y, sx2); + mpip-w, gcs.shadow_gc, gcs.hilight_gc, gcs.fore_gc, + sx1, y, sx2, do_flat_separators); } break; default: for (i = ST_TITLE_UNDERLINES(ms); i-- 0; ) { diff -U5 -r fvwm/fvwm/menus.c fvwm/fvwm/menus.c --- fvwm/fvwm/menus.c 2007-11-23 11:12:54.0 +0100 +++ fvwm/fvwm/menus.c 2008-03-07 03:18:49.0 +0100 @@ -1601,10 +1601,14 @@ int separator_height; separator_height = (last_item_has_relief) ? MENU_SEPARATOR_HEIGHT + relief_thickness : MENU_SEPARATOR_TOTAL_HEIGHT; + if (MST_DO_FLAT_SEPARATOR(msp-menu)) + { + separator_height += 1; + } MI_Y_OFFSET(mi) = y; if (MI_IS_TITLE(mi)) { MI_HEIGHT(mi) = MST_PTITLEFONT(msp-menu)-height + MST_TITLE_GAP_ABOVE(msp-menu) + diff -U5 -r fvwm/fvwm/menustyle.c fvwm/fvwm/menustyle.c --- fvwm/fvwm/menustyle.c 2007-08-07 22:17:43.0 +0200 +++ fvwm/fvwm/menustyle.c 2008-03-07 03:18:49.0 +0100 @@ -403,11 +403,11 @@ PopupActiveArea, PopupIgnore, PopupClose, MouseWheel, ScrollOffPage,
Re: WAS fvwm and patches
On Fri, 7 Mar 2008 04:13:10 +0100 Jesús Guerrero [EMAIL PROTECTED] wrote: On Fri, 7 Mar 2008 00:44:09 +0100 Jesús Guerrero [EMAIL PROTECTED] wrote: I didn't know about the test tools in the package. The test config file for the menu certainly probed helpful when testing this patch. This is the patch to get flat 1pix thick separators in the menus. Patch attached: FlatSeparators -- Jesús Guerrero [EMAIL PROTECTED] Ops. Small fix. Changelog and NEWS added (based on the previous Conditionals patch). -- Jesús Guerrero [EMAIL PROTECTED] diff -U5 -r fvwm/doc/commands/MenuStyle.xml fvwm/doc/commands/MenuStyle.xml --- fvwm/doc/commands/MenuStyle.xml 2007-08-18 00:36:49.0 +0200 +++ fvwm/doc/commands/MenuStyle.xml 2008-03-07 03:24:46.0 +0100 @@ -56,11 +56,11 @@ MenuFace, PopupDelay, PopupOffset, TitleWarp / !TitleWarp, TitleUnderlines0 / TitleUnderlines1 / TitleUnderlines2, -SeparatorsLong / SeparatorsShort, +SeparatorsLong / SeparatorsShort / FlatSeparators, TrianglesSolid / TrianglesRelief, PopupImmediately / PopupDelayed, PopdownImmediately / PopdownDelayed, PopupActiveArea, DoubleClickTime, @@ -429,10 +429,15 @@ set the length of menu separators. Long separators run from the left edge all the way to the right edge. Short separators leave a few pixels to the edges of the menu./para para +fvwmopt cmd=MenuStyle opt=FlatSeparators/ +changes the separators so that they are a single pixel thick and +colored the same as the text./para + +para fvwmopt cmd=MenuStyle opt=TrianglesSolid/ and fvwmopt cmd=MenuStyle opt=TrianglesRelief/ affect how the small triangles for sub menus is drawn. Solid triangles are filled with a color while relief triangles are hollow./para diff -U5 -r fvwm/fvwm/menuitem.c fvwm/fvwm/menuitem.c --- fvwm/fvwm/menuitem.c 2007-07-26 10:00:43.0 +0200 +++ fvwm/fvwm/menuitem.c 2008-03-07 03:18:49.0 +0100 @@ -80,14 +80,22 @@ * * Draws two horizontal lines to form a separator * */ static void draw_separator( - Window w, GC TopGC, GC BottomGC, int x1, int y, int x2) + Window w, GC TopGC, GC BottomGC, GC ForeGC, int x1, int y, int x2, + Bool do_flat_separators) { - XDrawLine(dpy, w, TopGC , x1, y, x2, y); - XDrawLine(dpy, w, BottomGC, x1-1, y+1, x2+1, y+1); + if (do_flat_separators) + { + XDrawLine(dpy, w, ForeGC, x1, y, x2, y); + } + else + { + XDrawLine(dpy, w, TopGC , x1, y, x2, y); + XDrawLine(dpy, w, BottomGC, x1-1, y+1, x2+1, y+1); + } return; } /* @@ -380,10 +388,11 @@ int off_cs; FvwmRenderAttributes fra; /*Pixel fg, fgsh;*/ int relief_thickness = ST_RELIEF_THICKNESS(ms); Bool is_item_selected; + Bool do_flat_separators; Bool item_cleared = False; Bool xft_clear = False; Bool empty_inter = False; XRectangle b; Region region = None; @@ -598,10 +607,12 @@ /* * Draw the item itself. */ + do_flat_separators = ST_DO_FLAT_SEPARATOR(ms); + /* Calculate the separator offsets. */ if (ST_HAS_LONG_SEPARATORS(ms)) { sx1 = MDIM_ITEM_X_OFFSET(*dim) + relief_thickness; sx2 = MDIM_ITEM_X_OFFSET(*dim) + MDIM_ITEM_WIDTH(*dim) - 1 - @@ -618,13 +629,13 @@ { if (sx1 sx2) { /* It's a separator. */ draw_separator( -mpip-w, gcs.shadow_gc, gcs.hilight_gc, sx1, -y_offset + y_height - MENU_SEPARATOR_HEIGHT, -sx2); +mpip-w, gcs.shadow_gc, gcs.hilight_gc, gcs.fore_gc, +sx1, y_offset + y_height - MENU_SEPARATOR_HEIGHT, +sx2, do_flat_separators); /* Nothing else to do. */ } return; } else if (MI_IS_TEAR_OFF_BAR(mi)) @@ -660,12 +671,12 @@ text_y += MENU_SEPARATOR_HEIGHT + add; y = y_offset + add; if (sx1 sx2) { draw_separator( - mpip-w, gcs.shadow_gc, gcs.hilight_gc, - sx1, y, sx2); + mpip-w, gcs.shadow_gc, gcs.hilight_gc, gcs.fore_gc, + sx1, y, sx2, do_flat_separators); } } /* Underline the title. */ switch (ST_TITLE_UNDERLINES(ms)) { @@ -674,12 +685,12 @@ case 1: if (MI_NEXT_ITEM(mi) != NULL) { y = y_offset + y_height - MENU_SEPARATOR_HEIGHT; draw_separator( - mpip-w, gcs.shadow_gc, gcs.hilight_gc, - sx1, y, sx2); + mpip-w, gcs.shadow_gc, gcs.hilight_gc, gcs.fore_gc, + sx1, y, sx2, do_flat_separators); } break; default: for (i = ST_TITLE_UNDERLINES(ms); i-- 0; ) { diff -U5 -r fvwm/fvwm/menus.c fvwm/fvwm/menus.c --- fvwm/fvwm/menus.c 2007-11-23 11:12:54.0 +0100 +++ fvwm/fvwm/menus.c 2008-03-07 03:18:49.0 +0100 @@ -1601,10 +1601,14 @@ int separator_height; separator_height = (last_item_has_relief) ? MENU_SEPARATOR_HEIGHT + relief_thickness : MENU_SEPARATOR_TOTAL_HEIGHT; + if (MST_DO_FLAT_SEPARATOR(msp-menu)) + { + separator_height += 1; + } MI_Y_OFFSET(mi) = y; if (MI_IS_TITLE(mi)) { MI_HEIGHT(mi) = MST_PTITLEFONT(msp-menu)-height + MST_TITLE_GAP_ABOVE(msp-menu) + diff -U5 -r fvwm/fvwm/menustyle.c fvwm/fvwm/menustyle.c ---
Re: WAS fvwm and patches
Patch attached: ButtonWidth -- Jesús Guerrero [EMAIL PROTECTED] diff -r -U3 fvwm/ChangeLog fvwm/ChangeLog --- fvwm/ChangeLog 2008-03-07 05:34:21.0 +0100 +++ fvwm/ChangeLog 2008-03-07 05:28:14.0 +0100 @@ -19,6 +19,14 @@ *fvwm/doc/commands/MenuStyle.xml added the menustyle FlatSeparators documentation + *fvwm/doc/commands/TitleStyle.xml + added documentation for the ButtonWidth patch + + *fvwm/frame.c + *fvwm/screen.h + *fvwm/builtins.c + patched for ButtonWidth + 2008-02-29 Viktor Griph griph(at)dd(dot)chalmers(dot)se * fvwm/add_window.c (setup_frame_window): diff -r -U3 fvwm/doc/commands/TitleStyle.xml fvwm/doc/commands/TitleStyle.xml --- fvwm/doc/commands/TitleStyle.xml 2008-03-07 05:33:39.0 +0100 +++ fvwm/doc/commands/TitleStyle.xml 2008-03-07 05:24:09.0 +0100 @@ -25,6 +25,11 @@ MinHeight optional replaceablenum/replaceable /optional + /arg + arg choice='opt' + ButtonWidth optional + replaceablenum/replaceable + /optional /arg /cmdsynopsis @@ -36,6 +41,9 @@ sets the title bar's height to an amount in pixels. fvwmopt cmd=TitleStyle opt=MinHeight/ sets the minimal height in pixels of the title bar. +fvwmopt cmd=TitleStyle opt=ButtonWidth/ +Sets the width of the title bar buttons. Setting a width +of 0 or no width uses the title height, as before. Defaults are emphasis remap='I'Centered/emphasis, the window's font height and no minimal height. diff -r -U3 fvwm/fvwm/builtins.c fvwm/fvwm/builtins.c --- fvwm/fvwm/builtins.c 2008-03-07 05:33:39.0 +0100 +++ fvwm/fvwm/builtins.c 2008-03-07 05:13:38.0 +0100 @@ -492,6 +492,21 @@ if (action) action += next; } + else if (!do_add StrEquals(parm,buttonwidth)) + { + int width = 0; + int next = 0; + + sscanf(action, %d%n, width, next); + + if (decor-button_width != width) + { +decor-button_width = width; +decor-flags.has_changed = 1; + } + if (action) +action += next; + } else if (!do_add StrEquals(parm,MinHeight)) { int height = 0; diff -r -U3 fvwm/fvwm/frame.c fvwm/fvwm/frame.c --- fvwm/fvwm/frame.c 2008-03-07 05:33:38.0 +0100 +++ fvwm/fvwm/frame.c 2008-03-07 05:13:38.0 +0100 @@ -1369,7 +1369,14 @@ tb_thick = fw-title_thickness; nbuttons = fw-nr_left_buttons + fw-nr_right_buttons; nbuttons_big = 0; - b_length = tb_thick; + if (fw-decor-button_width == 0) + { + b_length = tb_thick; + } + else + { + b_length = fw-decor-button_width; + } t_length = tb_length - nbuttons * b_length; if (nbuttons 0 t_length MIN_WINDOW_TITLE_LENGTH) { diff -r -U3 fvwm/fvwm/screen.h fvwm/fvwm/screen.h --- fvwm/fvwm/screen.h 2008-03-07 05:33:38.0 +0100 +++ fvwm/fvwm/screen.h 2008-03-07 05:13:38.0 +0100 @@ -286,6 +286,7 @@ #endif int title_height; /* explicitly specified title bar height */ int min_title_height; + int button_width; /* titlebar buttons */ TitleButton buttons[NUMBER_OF_TITLE_BUTTONS]; TitleButton titlebar; diff -r -U3 fvwm/NEWS fvwm/NEWS --- fvwm/NEWS 2008-03-07 05:34:21.0 +0100 +++ fvwm/NEWS 2008-03-07 05:29:47.0 +0100 @@ -10,6 +10,7 @@ - Added new condition masks: HasTitle, HasBorders, TitleAtBottom, TitleAtTop, TitleAtLeft, TitleAtRight - Added new menu separator menustyle: FlatSeparator + - Added new menu titlestyle: ButtonWidth * Bug fixes:
Re: WAS fvwm and patches
On 07/03/2008, Jesús Guerrero [EMAIL PROTECTED] wrote: On Thu, 06 Mar 2008 20:34:03 -0500 Dan Espen [EMAIL PROTECTED] wrote: =?ISO-8859-1?Q?Jes=FAs?= Guerrero [EMAIL PROTECTED] writes: On Fri, 7 Mar 2008 00:44:09 +0100 Jes=FAs Guerrero [EMAIL PROTECTED] wrote: Conditionals patch revised and attached. Is it valid? Does it lack something? My idea is to shorten the list of available patches as much as we can by=20 including those that are evidently clean, useful and harmless upstream. That way, we can ease the process for the rest of the patches. Except for not updating test cases (which almost no one is doing), it looks clean and reasonable to me. I saw that file and plan to update it. I just need to watch into it to understand the logic of the thing. Feel free to give any advice if you feel that there's something relevant that I should know. For now, I have a preliminary versions with that file included. Attached. I was the original author of this patch to add HasTitle and HasBorders - it was then augmented by someone else, I forget whom. To be honest, there's all *manner* of different tests one could do here, and this patch is by no means representative enough of them. Although if more conditionals are to be added in this way, the list would get rather long, and an alternative approach might need to be sought after. -- Thomas Adam
Re: WAS fvwm and patches
On Fri, 7 Mar 2008 05:13:38 + Thomas Adam [EMAIL PROTECTED] wrote: I was the original author of this patch to add HasTitle and HasBorders - it was then augmented by someone else, I forget whom. To be honest, there's all *manner* of different tests one could do here, and this patch is by no means representative enough of them. Although if more conditionals are to be added in this way, the list would get rather long, and an alternative approach might need to be sought after. The guy at http://www.abdn.ac.uk/~u15dm4/fvwm/, who is distributing several more patches on that web, claims to have modified your patch. So I suppose it was him the one who changed them. When you look into the code, as you say, it's evident that a lot of stuff could be added that way and the number of options could get way overwhelming. But that's out of my scope. I just intend (if possible) to get some of those patches included upstream. If someone wants to extend them, that's ok. -- Jesús Guerrero [EMAIL PROTECTED]
Re: WAS fvwm and patches
On Fri, 7 Mar 2008 00:44:09 +0100 Jesús Guerrero [EMAIL PROTECTED] wrote: Attached: Style InactiveFont patch -- Jesús Guerrero [EMAIL PROTECTED] diff -r -U3 fvwm/ChangeLog fvwm/ChangeLog --- fvwm/ChangeLog 2008-03-07 05:53:47.0 +0100 +++ fvwm/ChangeLog 2008-03-07 06:07:12.0 +0100 @@ -27,6 +27,17 @@ *fvwm/builtins.c patched for ButtonWidth + *fvwm/doc/commands/Style.xml + added documentation for Style InactiveFont + + *fvwm/style.c + *fvwm/style.h + *fvwm/fvwm.h + *fvwm/add_window.c + *fvwm/window_flags.h + *fvwm/borders.c + patched to add new Style: InactiveFont + 2008-02-29 Viktor Griph griph(at)dd(dot)chalmers(dot)se * fvwm/add_window.c (setup_frame_window): diff -r -U3 fvwm/doc/commands/Style.xml fvwm/doc/commands/Style.xml --- fvwm/doc/commands/Style.xml 2008-03-07 05:53:47.0 +0100 +++ fvwm/doc/commands/Style.xml 2008-03-07 06:04:49.0 +0100 @@ -84,6 +84,7 @@ emphasis remap='I'IconBackgroundColorset/emphasis, emphasis remap='I'IconTitleRelief/emphasis, emphasis remap='I'IconBackgroundRelief/emphasis, emphasis remap='I'IconBackgroundPadding/emphasis, emphasis remap='I'Font/emphasis, +emphasis remap='I'InactiveFont/emphasis, emphasis remap='I'IconFont/emphasis, emphasis remap='I'StartsOnDesk/emphasis / emphasis remap='I'StartsOnPage/emphasis / emphasis remap='I'StartsAnyWhere/emphasis, emphasis remap='I'StartsOnScreen/emphasis, @@ -606,13 +607,14 @@ and it is restored if the argument is omitted./para paraThe -fvwmopt cmd=Style opt=Font/ and fvwmopt cmd=Style opt=IconFont/ +fvwmopt cmd=Style opt=Font/, fvwmopt cmd=Style opt=InactiveFont/ +and fvwmopt cmd=Style opt=IconFont/ options take the name of a font as their sole argument. This font -is used in the window or icon title. By default the font given in -the +is used in the active window, inactive window or icon title respectively. +By default the font given in the fvwmref cmd=DefaultFont/ command is used. To revert back to the default, use the style -without the name argument. These styles replace the older +without the name argument. The first two styles replace the older fvwmref cmd=WindowFont/ and fvwmopt cmd=Style opt=IconFont/ commands./para diff -r -U3 fvwm/fvwm/add_window.c fvwm/fvwm/add_window.c --- fvwm/fvwm/add_window.c 2008-03-07 05:53:47.0 +0100 +++ fvwm/fvwm/add_window.c 2008-03-07 05:58:46.0 +0100 @@ -638,6 +638,18 @@ fw-title_font = Scr.DefaultFont; SET_USING_DEFAULT_WINDOW_FONT(fw, 1); + if (IS_INACTIVE_WINDOW_FONT_LOADED(fw) !USING_DEFAULT_INACTIVE_WINDOW_FONT(fw) + fw-title_font != Scr.DefaultFont) + { + FlocaleUnloadFont(dpy, fw-title_font); + } + SET_INACTIVE_WINDOW_FONT_LOADED(fw, 0); + /* Fall back to default font. There are some race conditions when a + * window is destroyed and recaptured where an invalid font might be + * accessed otherwise. */ + fw-title_font = Scr.DefaultFont; + SET_USING_DEFAULT_INACTIVE_WINDOW_FONT(fw, 1); + return; } @@ -1735,6 +1747,25 @@ } SET_WINDOW_FONT_LOADED(fw, 1); } + /* load inactive font */ + if (!IS_INACTIVE_WINDOW_FONT_LOADED(fw)) + { + if (S_HAS_INACTIVE_WINDOW_FONT(SCF(*pstyle)) + SGET_INACTIVE_WINDOW_FONT(*pstyle) + (fw-inactive_title_font = + FlocaleLoadFont(dpy, SGET_INACTIVE_WINDOW_FONT(*pstyle), FVWM))) + { + SET_USING_DEFAULT_INACTIVE_WINDOW_FONT(fw, 0); + } + else + { + /* no explicit font or failed to load, use active title font + * instead */ + fw-inactive_title_font = fw-title_font; + SET_USING_DEFAULT_INACTIVE_WINDOW_FONT(fw, 1); + } + SET_INACTIVE_WINDOW_FONT_LOADED(fw, 1); + } setup_title_geometry(fw, pstyle); return; diff -r -U3 fvwm/fvwm/borders.c fvwm/fvwm/borders.c --- fvwm/fvwm/borders.c 2008-03-07 05:53:47.0 +0100 +++ fvwm/fvwm/borders.c 2008-03-07 05:58:46.0 +0100 @@ -3525,7 +3525,7 @@ static void border_draw_title_mono( FvwmWindow *fw, titlebar_descr *td, title_draw_descr *tdd, - FlocaleWinString *fstr, Pixmap dest_pix) + FlocaleWinString *fstr, Pixmap dest_pix, Bool do_hilight) { int has_vt; @@ -3535,7 +3535,8 @@ td-offset - 2, 0, td-length+4, fw-title_thickness); if (fw-visible_name != (char *)NULL) { - FlocaleDrawString(dpy, fw-title_font, fstr, 0); + FlocaleDrawString(dpy, do_hilight ? fw-title_font : + fw-inactive_title_font, fstr, 0); } /* for mono, we clear an area in the title bar where the window * title goes, so that its more legible. For color, no need */ @@ -3599,7 +3600,7 @@ static void border_draw_title_deep( FvwmWindow *fw, titlebar_descr *td, title_draw_descr *tdd, - FlocaleWinString *fstr, Pixmap dest_pix, Window w) + FlocaleWinString *fstr, Pixmap dest_pix, Window w, Bool do_hilight) { DecorFace *df; pixmap_background_type bg; @@ -3621,14 +3622,15 @@ 1); } } - FlocaleDrawString(dpy, fw-title_font, tdd-fstr, 0); + FlocaleDrawString(dpy, do_hilight ? fw-title_font : + fw-inactive_title_font, tdd-fstr, 0); return; } static void