Skip to content

Commit

Permalink
win: remove unused parameter ignore_state
Browse files Browse the repository at this point in the history
remove unrequired parameter `ignore_state` of
`win_calc_opacity_target()` that was always `false` now.
  • Loading branch information
tryone144 committed Apr 5, 2020
1 parent 285dee3 commit c0eccdb
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 11 deletions.
2 changes: 1 addition & 1 deletion src/event.c
Original file line number Diff line number Diff line change
Expand Up @@ -480,7 +480,7 @@ static inline void ev_property_notify(session_t *ps, xcb_property_notify_event_t
assert(w->state != WSTATE_DESTROYING);

auto opacity_target_old = w->opacity_target;
w->opacity_target = win_calc_opacity_target(ps, w, false);
w->opacity_target = win_calc_opacity_target(ps, w);
if (opacity_target_old != w->opacity_target) {
w->opacity_target_old = opacity_target_old;
}
Expand Down
13 changes: 6 additions & 7 deletions src/win.c
Original file line number Diff line number Diff line change
Expand Up @@ -582,18 +582,17 @@ winmode_t win_calc_mode(const struct managed_win *w) {
*
* @param ps current session
* @param w struct _win object representing the window
* @param ignore_state whether window state should be ignored in opacity calculation
*
* @return target opacity
*/
double win_calc_opacity_target(session_t *ps, const struct managed_win *w, bool ignore_state) {
double win_calc_opacity_target(session_t *ps, const struct managed_win *w) {
double opacity = 1;

if (w->state == WSTATE_UNMAPPED && !ignore_state) {
if (w->state == WSTATE_UNMAPPED) {
// be consistent
return 0;
}
if ((w->state == WSTATE_UNMAPPING || w->state == WSTATE_DESTROYING) && !ignore_state) {
if (w->state == WSTATE_UNMAPPING || w->state == WSTATE_DESTROYING) {
return 0;
}
// Try obeying opacity property and window type opacity firstly
Expand Down Expand Up @@ -916,7 +915,7 @@ void win_on_factor_change(session_t *ps, struct managed_win *w) {
c2_match(ps, w, ps->o.unredir_if_possible_blacklist, NULL);

auto opacity_target_old = w->opacity_target;
w->opacity_target = win_calc_opacity_target(ps, w, false);
w->opacity_target = win_calc_opacity_target(ps, w);
if (opacity_target_old != w->opacity_target) {
w->opacity_target_old = opacity_target_old;

Expand Down Expand Up @@ -1919,7 +1918,7 @@ void unmap_win_start(session_t *ps, struct managed_win *w) {
w->a.map_state = XCB_MAP_STATE_UNMAPPED;
w->state = WSTATE_UNMAPPING;
auto opacity_target_old = w->opacity_target;
w->opacity_target = win_calc_opacity_target(ps, w, false);
w->opacity_target = win_calc_opacity_target(ps, w);
if (opacity_target_old != w->opacity_target) {
w->opacity_target_old = opacity_target_old;
}
Expand Down Expand Up @@ -2107,7 +2106,7 @@ void map_win_start(session_t *ps, struct managed_win *w) {
// XXX We need to make sure that win_data is available
// iff `state` is MAPPED
w->state = WSTATE_MAPPING;
w->opacity_target = win_calc_opacity_target(ps, w, false);
w->opacity_target = win_calc_opacity_target(ps, w);

log_debug("Window %#010x has opacity %f, opacity target is %f", w->base.id,
w->opacity, w->opacity_target);
Expand Down
4 changes: 1 addition & 3 deletions src/win.h
Original file line number Diff line number Diff line change
Expand Up @@ -313,12 +313,10 @@ bool win_get_class(session_t *ps, struct managed_win *w);
*
* @param ps current session
* @param w struct _win object representing the window
* @param ignore_state whether window state should be ignored in opacity calculation
*
* @return target opacity
*/
double attr_pure win_calc_opacity_target(session_t *ps, const struct managed_win *w,
bool ignore_state);
double attr_pure win_calc_opacity_target(session_t *ps, const struct managed_win *w);
bool attr_pure win_should_dim(session_t *ps, const struct managed_win *w);
void win_update_screen(session_t *, struct managed_win *);
/**
Expand Down

0 comments on commit c0eccdb

Please sign in to comment.