win: rename find_toplevel2 to find_toplevel_nocache
So it is slightly clearer what is the difference to find_toplevel(). Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
This commit is contained in:
parent
397710ac27
commit
53bb488530
|
@ -302,8 +302,8 @@ static inline void ev_unmap_notify(session_t *ps, xcb_unmap_notify_event_t *ev)
|
||||||
}
|
}
|
||||||
|
|
||||||
static inline void ev_reparent_notify(session_t *ps, xcb_reparent_notify_event_t *ev) {
|
static inline void ev_reparent_notify(session_t *ps, xcb_reparent_notify_event_t *ev) {
|
||||||
log_debug("{ new_parent: %#010x, override_redirect: %d }", ev->parent,
|
log_debug("Window %#010x has new parent: %#010x, override_redirect: %d",
|
||||||
ev->override_redirect);
|
ev->window, ev->parent, ev->override_redirect);
|
||||||
|
|
||||||
if (ev->parent == ps->root) {
|
if (ev->parent == ps->root) {
|
||||||
// X will generate reparent notifiy even if the parent didn't actually
|
// X will generate reparent notifiy even if the parent didn't actually
|
||||||
|
@ -336,7 +336,7 @@ static inline void ev_reparent_notify(session_t *ps, xcb_reparent_notify_event_t
|
||||||
// Firstly, check if it's a known client window
|
// Firstly, check if it's a known client window
|
||||||
if (!find_toplevel(ps, ev->window)) {
|
if (!find_toplevel(ps, ev->window)) {
|
||||||
// If not, look for its frame window
|
// If not, look for its frame window
|
||||||
auto w_top = find_toplevel2(ps, ev->parent);
|
auto w_top = find_toplevel_nocache(ps, ev->parent);
|
||||||
// If found, and the client window has not been determined, or its
|
// If found, and the client window has not been determined, or its
|
||||||
// frame may not have a correct client, continue
|
// frame may not have a correct client, continue
|
||||||
if (w_top &&
|
if (w_top &&
|
||||||
|
@ -446,7 +446,7 @@ static inline void ev_property_notify(session_t *ps, xcb_property_notify_event_t
|
||||||
(const uint32_t[]){determine_evmask(
|
(const uint32_t[]){determine_evmask(
|
||||||
ps, ev->window, WIN_EVMODE_UNKNOWN)});
|
ps, ev->window, WIN_EVMODE_UNKNOWN)});
|
||||||
|
|
||||||
auto w_top = find_toplevel2(ps, ev->window);
|
auto w_top = find_toplevel_nocache(ps, ev->window);
|
||||||
// Initialize client_win as early as possible
|
// Initialize client_win as early as possible
|
||||||
if (w_top &&
|
if (w_top &&
|
||||||
(!w_top->client_win || w_top->client_win == w_top->base.id) &&
|
(!w_top->client_win || w_top->client_win == w_top->base.id) &&
|
||||||
|
|
|
@ -180,7 +180,7 @@ static inline struct managed_win *find_win_all(session_t *ps, const xcb_window_t
|
||||||
if (!w)
|
if (!w)
|
||||||
w = find_toplevel(ps, wid);
|
w = find_toplevel(ps, wid);
|
||||||
if (!w)
|
if (!w)
|
||||||
w = find_toplevel2(ps, wid);
|
w = find_toplevel_nocache(ps, wid);
|
||||||
return w;
|
return w;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -2195,7 +2195,7 @@ struct managed_win *find_toplevel(session_t *ps, xcb_window_t id) {
|
||||||
* @param wid window ID
|
* @param wid window ID
|
||||||
* @return struct _win object of the found window, NULL if not found
|
* @return struct _win object of the found window, NULL if not found
|
||||||
*/
|
*/
|
||||||
struct managed_win *find_toplevel2(session_t *ps, xcb_window_t wid) {
|
struct managed_win *find_toplevel_nocache(session_t *ps, xcb_window_t wid) {
|
||||||
// TODO this should probably be an "update tree", then find_toplevel.
|
// TODO this should probably be an "update tree", then find_toplevel.
|
||||||
// current approach is a bit more "racy"
|
// current approach is a bit more "racy"
|
||||||
struct win *w = NULL;
|
struct win *w = NULL;
|
||||||
|
|
|
@ -408,7 +408,7 @@ struct managed_win *find_toplevel(session_t *ps, xcb_window_t id);
|
||||||
* @param wid window ID
|
* @param wid window ID
|
||||||
* @return struct _win object of the found window, NULL if not found
|
* @return struct _win object of the found window, NULL if not found
|
||||||
*/
|
*/
|
||||||
struct managed_win *find_toplevel2(session_t *ps, xcb_window_t wid);
|
struct managed_win *find_toplevel_nocache(session_t *ps, xcb_window_t wid);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Check if a window is a fullscreen window.
|
* Check if a window is a fullscreen window.
|
||||||
|
|
Loading…
Reference in New Issue