Window state tracking refactor

Window state tracking is basically the back bond of window fading. We
add a new enum field to the win struct to track the state of the window,
instead of using a set of boolean variables. We also remove the fading
callbacks, since it is only used for fading, so the potential of code
reuse is lost. And it makes the code slightly harder to understand.

Also fixed a problem that --no-fading-openclose is not behaving as
advertised (from my observation, enabling this flag disables fading
entirely, instead of just diabling it for open/close).

Also uses double for opacity everywhere internally. Use opacity_t only
when setting X opacity prop.

TODO: Remove win::*_last

Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
This commit is contained in:
Yuxuan Shui
2019-02-09 15:50:40 +00:00
parent e109bee380
commit a826e0ce79
16 changed files with 573 additions and 555 deletions

View File

@ -167,9 +167,9 @@ typedef struct options_t {
// === Fading ===
/// How much to fade in in a single fading step.
opacity_t fade_in_step;
double fade_in_step;
/// How much to fade out in a single fading step.
opacity_t fade_out_step;
double fade_out_step;
/// Fading time delta. In milliseconds.
unsigned long fade_delta;
/// Whether to disable fading on window open/close.
@ -181,11 +181,10 @@ typedef struct options_t {
// === Opacity ===
/// Default opacity for inactive windows.
/// 32-bit integer with the format of _NET_WM_OPACITY. 0 stands for
/// not enabled, default.
opacity_t inactive_opacity;
/// 32-bit integer with the format of _NET_WM_OPACITY.
double inactive_opacity;
/// Default opacity for inactive windows.
opacity_t active_opacity;
double active_opacity;
/// Whether inactive_opacity overrides the opacity set by window
/// attributes.
bool inactive_opacity_override;