`Style` commands don't search `WM_WINDOW_ROLE` X window properties
It doesn't appear that the built-in Style command appname string (which accepts '*' & '?' wildcards; see mlvwm(1) manual page) can match against the WM_WINDOW_ROLE X window property. I believe it currently only matches against WM_CLASS or WM_NAME.
There are many X11 applications that have different types of windows which should have different styles, including the menu bar itself as well as various window features. For example, Claws Mail has WM_CLASS(STRING) = "claws-mail", "Claws-mail" set on all windows, but the WM_WINDOW_ROLE differs by the various window types:
- The main account/mailbox view has
WM_WINDOW_ROLE(STRING) = "mainwindow" - A new message has
WM_WINDOW_ROLE(STRING) = "compose" - Opening an existing message has
WM_WINDOW_ROLE(STRING) = "messageview"
A window with a mainwindow role should have different menu bar options than messageview or compose. So, it'd be very helpful to be able to define multiple Style commands for the same WM_CLASS, but differing WM_WINDOW_ROLE.
It appears that WM_WINDOW_ROLE is part of the ICCCM specification, see section 5. Session Management.
Looking at this again for another mlvwmrc issue and wanted to note the following for future me:
- Parsing of
Style ... ENDconfiguration blocks is implemented inconfig.c'sSetStyles(). Each line's parsing includes:- The first quoted portion of the line is used as the Style
name(including*&?wildcard characters) and either:Scr.style_listis searched for an existingstylewithnameand the matching style is used- If one isn't found, a new
styleis created with thenameand appended to theScr.style_listlinked list
- The rest of the comma-separated options are parsed and the appropriate function will be executed for the
style
- The first quoted portion of the line is used as the Style
- Styles are destroyed in
config.c'sFreeStyles() add_window.c'slookupstyles()searchesScr.style_listfor matchingname(usingmatchWildcards()to support*&?wildcard characters), returning thestylewhere any of the following match:- Matches against the window
name - If the window has a
class(anXClassHint), it then matches: a.class->res_nameb.class->res_class
- Matches against the window
add_window.c'sAddWindow()useslookupstyles()to find the matchingstyle, then applies the Style's configuration to the window