win: remove map_win_by_id
Since it has only one user. Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
This commit is contained in:
parent
5787c17ebe
commit
1549997811
21
src/event.c
21
src/event.c
|
@ -271,7 +271,26 @@ static inline void ev_destroy_notify(session_t *ps, xcb_destroy_notify_event_t *
|
||||||
}
|
}
|
||||||
|
|
||||||
static inline void ev_map_notify(session_t *ps, xcb_map_notify_event_t *ev) {
|
static inline void ev_map_notify(session_t *ps, xcb_map_notify_event_t *ev) {
|
||||||
map_win_by_id(ps, ev->window);
|
// Unmap overlay window if it got mapped but we are currently not
|
||||||
|
// in redirected state.
|
||||||
|
if (ps->overlay && ev->window == ps->overlay && !ps->redirected) {
|
||||||
|
log_debug("Overlay is mapped while we are not redirected");
|
||||||
|
auto e = xcb_request_check(ps->c, xcb_unmap_window(ps->c, ps->overlay));
|
||||||
|
if (e) {
|
||||||
|
log_error("Failed to unmap the overlay window");
|
||||||
|
free(e);
|
||||||
|
}
|
||||||
|
// We don't track the overlay window, so we can return
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
auto w = find_managed_win(ps, ev->window);
|
||||||
|
if (!w) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
map_win(ps, w);
|
||||||
|
|
||||||
// FocusIn/Out may be ignored when the window is unmapped, so we must
|
// FocusIn/Out may be ignored when the window is unmapped, so we must
|
||||||
// recheck focus here
|
// recheck focus here
|
||||||
ps->pending_updates = true; // to update focus
|
ps->pending_updates = true; // to update focus
|
||||||
|
|
22
src/win.c
22
src/win.c
|
@ -2042,28 +2042,6 @@ void map_win(session_t *ps, struct managed_win *w) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void map_win_by_id(session_t *ps, xcb_window_t id) {
|
|
||||||
// Unmap overlay window if it got mapped but we are currently not
|
|
||||||
// in redirected state.
|
|
||||||
if (ps->overlay && id == ps->overlay && !ps->redirected) {
|
|
||||||
log_debug("Overlay is mapped while we are not redirected");
|
|
||||||
auto e = xcb_request_check(ps->c, xcb_unmap_window(ps->c, ps->overlay));
|
|
||||||
if (e) {
|
|
||||||
log_error("Failed to unmap the overlay window");
|
|
||||||
free(e);
|
|
||||||
}
|
|
||||||
// We don't track the overlay window, so we can return
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
auto w = find_managed_win(ps, id);
|
|
||||||
if (!w) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
map_win(ps, w);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Find a managed window from window id in window linked list of the session.
|
* Find a managed window from window id in window linked list of the session.
|
||||||
*/
|
*/
|
||||||
|
|
|
@ -365,7 +365,6 @@ bool must_use unmap_win(session_t *ps, struct managed_win *, bool destroy);
|
||||||
void destroy_unmanaged_win(session_t *ps, struct win *w);
|
void destroy_unmanaged_win(session_t *ps, struct win *w);
|
||||||
|
|
||||||
void map_win(session_t *ps, struct managed_win *w);
|
void map_win(session_t *ps, struct managed_win *w);
|
||||||
void map_win_by_id(session_t *ps, xcb_window_t id);
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Execute fade callback of a window if fading finished.
|
* Execute fade callback of a window if fading finished.
|
||||||
|
|
Loading…
Reference in New Issue