Skip to content

Commit

Permalink
wm/win: rename is_ewmh_focused to is_focused
Browse files Browse the repository at this point in the history
The old name is inaccurate, this flag is not limited to ewmh.

Signed-off-by: Yuxuan Shui <[email protected]>
  • Loading branch information
yshui committed Jun 27, 2024
1 parent 61485c3 commit 4305b6e
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
10 changes: 5 additions & 5 deletions src/wm/win.c
Original file line number Diff line number Diff line change
Expand Up @@ -1665,17 +1665,17 @@ void win_set_focused(session_t *ps, struct win *w) {
}

auto old_active_win = wm_active_win(ps->wm);
if (w->is_ewmh_focused) {
if (w->is_focused) {
assert(old_active_win == w);
return;
}

wm_set_active_win(ps->wm, w);
w->is_ewmh_focused = true;
w->is_focused = true;

if (old_active_win) {
assert(old_active_win->is_ewmh_focused);
old_active_win->is_ewmh_focused = false;
assert(old_active_win->is_focused);
old_active_win->is_focused = false;
win_on_focus_change(ps, old_active_win);
}
win_on_focus_change(ps, w);
Expand Down Expand Up @@ -2309,5 +2309,5 @@ bool win_is_bypassing_compositor(const session_t *ps, const struct win *w) {
* settings
*/
bool win_is_focused_raw(const struct win *w) {
return w->a.map_state == XCB_MAP_STATE_VIEWABLE && w->is_ewmh_focused;
return w->a.map_state == XCB_MAP_STATE_VIEWABLE && w->is_focused;
}
4 changes: 2 additions & 2 deletions src/wm/win.h
Original file line number Diff line number Diff line change
Expand Up @@ -197,8 +197,8 @@ struct win {
/// `is_ewmh_fullscreen`, or the windows spatial relation with the
/// root window. Which one is used is determined by user configuration.
bool is_fullscreen;
/// Whether the window is the EWMH active window.
bool is_ewmh_focused;
/// Whether the window is the active window.
bool is_focused;

// Opacity-related members
/// Window opacity
Expand Down

0 comments on commit 4305b6e

Please sign in to comment.