Split configure_win into two
One for configuring root, one for regular windows. Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
This commit is contained in:
		| @ -801,11 +801,10 @@ restack_win(session_t *ps, win *w, xcb_window_t new_above) { | |||||||
|   } |   } | ||||||
| } | } | ||||||
|  |  | ||||||
| void | /// Handle configure event of a root window | ||||||
| configure_win(session_t *ps, xcb_configure_notify_event_t *ce) { | void configure_root(session_t *ps, int width, int height) { | ||||||
|   // On root window changes |   // On root window changes | ||||||
|   auto bi = backend_list[ps->o.backend]; |   auto bi = backend_list[ps->o.backend]; | ||||||
|   if (ce->window == ps->root) { |  | ||||||
|   if (ps->o.experimental_backends) { |   if (ps->o.experimental_backends) { | ||||||
|     assert(bi); |     assert(bi); | ||||||
|     if (!bi->root_change) { |     if (!bi->root_change) { | ||||||
| @ -817,8 +816,8 @@ configure_win(session_t *ps, xcb_configure_notify_event_t *ce) { | |||||||
|     free_paint(ps, &ps->tgt_buffer); |     free_paint(ps, &ps->tgt_buffer); | ||||||
|   } |   } | ||||||
|  |  | ||||||
|     ps->root_width = ce->width; |   ps->root_width = width; | ||||||
|     ps->root_height = ce->height; |   ps->root_height = height; | ||||||
|  |  | ||||||
|   rebuild_screen_reg(ps); |   rebuild_screen_reg(ps); | ||||||
|   rebuild_shadow_exclude_reg(ps); |   rebuild_shadow_exclude_reg(ps); | ||||||
| @ -866,11 +865,12 @@ configure_win(session_t *ps, xcb_configure_notify_event_t *ce) { | |||||||
|     } |     } | ||||||
|   } |   } | ||||||
|   force_repaint(ps); |   force_repaint(ps); | ||||||
|  |  | ||||||
|   return; |   return; | ||||||
| } | } | ||||||
|  |  | ||||||
|   // Non-root window changes | /// Handle configure event of a regular window | ||||||
|  | void | ||||||
|  | configure_win(session_t *ps, xcb_configure_notify_event_t *ce) { | ||||||
|   win *w = find_win(ps, ce->window); |   win *w = find_win(ps, ce->window); | ||||||
|   region_t damage; |   region_t damage; | ||||||
|   pixman_region32_init(&damage); |   pixman_region32_init(&damage); | ||||||
| @ -1238,8 +1238,12 @@ inline static void | |||||||
| ev_configure_notify(session_t *ps, xcb_configure_notify_event_t *ev) { | ev_configure_notify(session_t *ps, xcb_configure_notify_event_t *ev) { | ||||||
|   log_trace("{ send_event: %d, id: %#010x, above: %#010x, override_redirect: %d }", |   log_trace("{ send_event: %d, id: %#010x, above: %#010x, override_redirect: %d }", | ||||||
|          ev->event, ev->window, ev->above_sibling, ev->override_redirect); |          ev->event, ev->window, ev->above_sibling, ev->override_redirect); | ||||||
|  |   if (ev->window == ps->root) { | ||||||
|  |     configure_root(ps, ev->width, ev->height); | ||||||
|  |   } else { | ||||||
|     configure_win(ps, ev); |     configure_win(ps, ev); | ||||||
|   } |   } | ||||||
|  | } | ||||||
|  |  | ||||||
| inline static void | inline static void | ||||||
| ev_destroy_notify(session_t *ps, xcb_destroy_notify_event_t *ev) { | ev_destroy_notify(session_t *ps, xcb_destroy_notify_event_t *ev) { | ||||||
|  | |||||||
		Reference in New Issue
	
	Block a user
	 Yuxuan Shui
					Yuxuan Shui