Commit graph

5 commits

Author SHA1 Message Date
Consus
3e5b988d38 common: use fnmatch() for pattern matching
Drop-in POSIX-compliant function that has a nice glob(7) manual page for
reference.
2023-10-01 14:17:29 +01:00
Consus
12f6a8975a Unbreak match_glob
Since bool is not a C89 type, include <stdbool.h> in match.h.
2023-10-01 14:17:29 +01:00
Johan Malm
bdd3849138 match.c: fix g_utf8_casefold() memory leak
Reported-by: @jlindgren90
2023-05-06 12:08:31 +01:00
Johan Malm
d609c9e3f9 Support window-rules
Two types of window rules are supported, actions and properties. They are
defined as shown below.

    <windowRules>

      <!-- Action -->
      <windowRule identifier="some-application">
        <action name="Maximize"/>
      </windowRule>

      <!-- Property -->
      <windowRule identifier="foo*" serverDecoration="yes|no"/>

    </windowRules>

Rules are applied if windows match the criteria defined by the
'identifier' attribute which relates to app_id for native Wayland windows
and WM_CLASS for XWayland clients.

Matching against patterns with '*' (wildcard) and '?' (joker) is
supported.

Add 'serverDecoration' property.
2023-05-04 22:09:55 +01:00
Johan Malm
71f5ac8323 Add common/match.c with match_glob() from theme.c
...and make it fully case-insensitive in preparation for window-rules.
2023-05-04 22:09:55 +01:00