Hi,
With the latest addition for allowing $[w.visiblename] expansion,
allowing a window's visible name to match as a valid identifier to a
style line is perhaps the biggest use case for this addition. See the
patch attached which implements this.
I've made a concerted effort to not break how existing styles are
applied; in the general case, a window's visible name and actual name
are going to be the same. Where they diverge is in the use of
IndexedWindowName -- should such a string be used, either explicitly
from the user, or via $[w.visiblename] then make this match *before*
the window's proper name.
Words to this effect are in the Changelog. I've updated NEWS as well this time.
-- Thomas Adam
? style-honours-visible-name.patch
? fvwm/.ewmh_conf.c.swp
Index: AUTHORS
===================================================================
RCS file: /home/cvs/fvwm/fvwm/AUTHORS,v
retrieving revision 1.129
diff -u -r1.129 AUTHORS
--- AUTHORS 4 Oct 2008 22:35:21 -0000 1.129
+++ AUTHORS 5 Oct 2008 18:46:23 -0000
@@ -13,7 +13,8 @@
Window style !StickyStippledTitle (and hence StickyStippledTitle).
Icon style StippledIconTitle and !StickyStippledIconTitle.
StartShaded style option.
-Introduce the command expansion placeholder: $[w.visible_name]
+Introduce the command expansion placeholder: $[w.visiblename]
+Make style matching honour a window's visible name (c.f. $[w.visiblename])
Serge (gentoosiast) Koksharov:
Documentation fixes, bug fixes.
Index: ChangeLog
===================================================================
RCS file: /home/cvs/fvwm/fvwm/ChangeLog,v
retrieving revision 1.3057
diff -u -r1.3057 ChangeLog
--- ChangeLog 4 Oct 2008 22:35:21 -0000 1.3057
+++ ChangeLog 5 Oct 2008 18:46:58 -0000
@@ -1,3 +1,12 @@
+2008-10-05 Thomas Adam <[EMAIL PROTECTED]>
+ * fvwm/style.c (fw_match_style_id):
+ Allow for the window's visible name to be considered when matching a
+ style line. Given $[w.visiblename] is mostly interesting when applying
+ style, make it match before the actual window name is. Whilst they're
+ generally always going to be the same, in the case of having
+ IndxedWindowName, if a style line matches this as a visible name, apply
+ it first of all.
+
2008-10-03 Thomas Adam <[EMAIL PROTECTED]>
* AUTHORS:
* fvwm/expand.c:
Index: NEWS
===================================================================
RCS file: /home/cvs/fvwm/fvwm/NEWS,v
retrieving revision 1.764
diff -u -r1.764 NEWS
--- NEWS 4 Oct 2008 22:35:21 -0000 1.764
+++ NEWS 5 Oct 2008 18:47:03 -0000
@@ -10,6 +10,14 @@
- New extended variable
$[w.visiblename]
+ - Style matching now honours the window's visible name which means it can
+ be matched before the real name, hence:
+
+ Style $[w.visiblename] Colorset 5
+
+ ... is now honoured. Useful with IndexedWindowName as a style
+ option.
+
* Bug fixes:
- Fixed compilation without XRender support.
- Fixed handling of _NET_MOVERESIZE_WINDOWS requests.
Index: doc/commands/Style.xml
===================================================================
RCS file: /home/cvs/fvwm/fvwm/doc/commands/Style.xml,v
retrieving revision 1.8
diff -u -r1.8 Style.xml
--- doc/commands/Style.xml 9 Feb 2008 07:51:23 -0000 1.8
+++ doc/commands/Style.xml 5 Oct 2008 18:47:11 -0000
@@ -27,7 +27,7 @@
the default or to set the window manager default styles.</para>
<para><replaceable>stylename</replaceable>
-can be a window's name, class, or resource string. It may contain
+can be a window's name, class, visible name, or resource string. It may contain
the wildcards '*' and '?', which are matched in the usual Unix
filename manner. Multiple style options in a single
<emphasis remap='B'>Style</emphasis>
Index: fvwm/style.c
===================================================================
RCS file: /home/cvs/fvwm/fvwm/fvwm/style.c,v
retrieving revision 1.259
diff -u -r1.259 style.c
--- fvwm/style.c 7 Jan 2008 20:05:48 -0000 1.259
+++ fvwm/style.c 5 Oct 2008 18:47:22 -0000
@@ -185,7 +185,11 @@
{
return 1;
}
- if (matchWildcards(SID_GET_NAME(s_id), fw->name.name) == 1)
+ if (matchWildcards(SID_GET_NAME(s_id), fw->visible_name) == 1)
+ {
+ return 1;
+ }
+ if (matchWildcards(SID_GET_NAME(s_id), fw->name.name) == 1)
{
return 1;
}