diff --git a/src/event.c b/src/event.c index 19feb3e3..932c126b 100644 --- a/src/event.c +++ b/src/event.c @@ -405,7 +405,8 @@ static inline void ev_configure_notify(session_t *ps, xcb_configure_notify_event } if (ev->window == ps->c.screen_info->root) { - set_root_flags(ps, ROOT_FLAGS_CONFIGURED); + configure_root(ps); + ps->pending_updates = true; } else { configure_win(ps, ev); } diff --git a/src/picom.c b/src/picom.c index b9f5250c..41068b5c 100644 --- a/src/picom.c +++ b/src/picom.c @@ -125,12 +125,6 @@ const char *const BACKEND_STRS[] = {[BKEND_XRENDER] = "xrender", /// XXX Limit what xerror can access by not having this pointer session_t *ps_g = NULL; -void set_root_flags(session_t *ps, uint64_t flags) { - log_debug("Setting root flags: %" PRIu64, flags); - ps->root_flags |= flags; - ps->pending_updates = true; -} - void quit(session_t *ps) { ps->quit = true; ev_break(ps->loop, EVBREAK_ALL); @@ -652,7 +646,7 @@ static inline void invalidate_reg_ignore(session_t *ps) { } /// Handle configure event of the root window -static void configure_root(session_t *ps) { +void configure_root(session_t *ps) { // TODO(yshui) re-initializing backend should be done outside of the // critical section. Probably set a flag and do it in draw_callback_impl. auto r = XCB_AWAIT(xcb_get_geometry, ps->c.c, ps->c.screen_info->root); @@ -733,13 +727,6 @@ static void configure_root(session_t *ps) { } } -static void handle_root_flags(session_t *ps) { - if ((ps->root_flags & ROOT_FLAGS_CONFIGURED) != 0) { - configure_root(ps); - ps->root_flags &= ~(uint64_t)ROOT_FLAGS_CONFIGURED; - } -} - /** * Go through the window stack and calculate some parameters for rendering. * @@ -1597,12 +1584,6 @@ static void handle_pending_updates(struct session *ps, double delta_t) { // Process new windows, and maybe allocate struct managed_win for them handle_new_windows(ps); - // Handle screen changes - // This HAS TO be called before refresh_windows, as handle_root_flags - // could call configure_root, which will release images and mark them - // stale. - handle_root_flags(ps); - // Process window flags refresh_windows(ps); } diff --git a/src/picom.h b/src/picom.h index 9be745e0..73a501c6 100644 --- a/src/picom.h +++ b/src/picom.h @@ -24,10 +24,6 @@ #include "wm/win.h" #include "x.h" -enum root_flags { - ROOT_FLAGS_CONFIGURED = 2 // Received configure notify on the root window -}; - // == Functions == // TODO(yshui) move static inline functions that are only used in picom.c, into picom.c @@ -41,7 +37,7 @@ void queue_redraw(session_t *ps); void discard_pending(session_t *ps, uint32_t sequence); -void set_root_flags(session_t *ps, uint64_t flags); +void configure_root(session_t *ps); void quit(session_t *ps);