1
0
Fork 0
mirror of https://github.com/yshui/picom.git synced 2025-10-30 23:46:46 -04:00

wm/win: separate per-window options into their own struct

It's easier to just store them together, since the same group of
information is needed for parsed window rules, and for window rendering.

Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
This commit is contained in:
Yuxuan Shui 2024-07-03 23:21:40 +01:00
parent 797e60f618
commit cdf25b07dc
No known key found for this signature in database
GPG key ID: D3A4405BE6CC17F4
16 changed files with 407 additions and 372 deletions

View file

@ -28,6 +28,19 @@ typedef enum {
enum tristate { TRI_FALSE = -1, TRI_UNKNOWN = 0, TRI_TRUE = 1 };
/// Return value if it's not TRI_UNKNOWN, otherwise return fallback.
static inline enum tristate tri_or(enum tristate value, enum tristate fallback) {
return value ?: fallback;
}
static inline bool tri_or_bool(enum tristate value, bool fallback) {
return value == TRI_UNKNOWN ? fallback : value == TRI_TRUE;
}
static inline enum tristate tri_from_bool(bool value) {
return value ? TRI_TRUE : TRI_FALSE;
}
/// A structure representing margins around a rectangle.
typedef struct {
int top;