diff --git a/layer.c b/layer.c index 0603e88..af31f89 100644 --- a/layer.c +++ b/layer.c @@ -352,7 +352,7 @@ void diyac_new_layer_surface(struct wl_listener *listener, void *data) */ struct wlr_layer_surface_v1_state old_state = layer_surface->current; layer_surface->current = layer_surface->pending; - diyac_output_update_usable_area(output); + // diyac_output_update_usable_area(output); layer_surface->current = old_state; } diff --git a/view.c b/view.c index 621c8da..00e9d4a 100644 --- a/view.c +++ b/view.c @@ -26,10 +26,9 @@ static int handle_configure_timeout(void *data) return 0; /* ignored per wl_event_loop docs */ } -static void diyac_view_configure(struct diyac_view *view, struct wlr_box geo) +void diya_view_set_pending_configure_serial(struct diyac_view* view, uint32_t serial) { - view->pending_size = geo; - view->configuration_serial = wlr_xdg_toplevel_set_size(view->xdg_toplevel, geo.width, geo.height); + view->configuration_serial = serial; if (!view->configuration_timeout) { view->configuration_timeout = wl_event_loop_add_timer(view->server->wl_event_loop, handle_configure_timeout, view); @@ -37,10 +36,24 @@ static void diyac_view_configure(struct diyac_view *view, struct wlr_box geo) wl_event_source_timer_update(view->configuration_timeout, CONFIGURE_TIMEOUT_MS); } +static void diyac_view_configure(struct diyac_view *view, struct wlr_box geo) +{ + view->pending_size = geo; + uint32_t serial = wlr_xdg_toplevel_set_size(view->xdg_toplevel, geo.width, geo.height); + if(serial > 0) + { + diya_view_set_pending_configure_serial(view, serial); + } +} + static void diyac_view_set_activated(struct diyac_view *view, bool activated) { struct diyac_server *server = view->server; - wlr_xdg_toplevel_set_activated(view->xdg_toplevel, activated); + uint32_t serial = wlr_xdg_toplevel_set_activated(view->xdg_toplevel, activated); + if(serial > 0) + { + diya_view_set_pending_configure_serial(view, serial); + } if (view->toplevel.handle) { wlr_foreign_toplevel_handle_v1_set_activated(view->toplevel.handle, activated); diff --git a/view.h b/view.h index 67b0a56..b334843 100644 --- a/view.h +++ b/view.h @@ -22,4 +22,5 @@ void diyac_view_update_title(struct diyac_view * view); void diyac_view_update_app_id(struct diyac_view * view); void diyac_view_sync_geo(struct diyac_view *view); void diya_view_unfocus(struct diyac_view* view); +void diya_view_set_pending_configure_serial(struct diyac_view* view, uint32_t serial); #endif \ No newline at end of file diff --git a/xdg.c b/xdg.c index b68afe1..f0cf177 100644 --- a/xdg.c +++ b/xdg.c @@ -65,6 +65,10 @@ static void xdg_toplevel_commit(struct wl_listener *listener, void *data) wlr_xdg_surface_schedule_configure(xdg_surface); uint32_t wm_caps = WLR_XDG_TOPLEVEL_WM_CAPABILITIES_MAXIMIZE | WLR_XDG_TOPLEVEL_WM_CAPABILITIES_FULLSCREEN | WLR_XDG_TOPLEVEL_WM_CAPABILITIES_MINIMIZE; wlr_xdg_toplevel_set_wm_capabilities(toplevel->xdg_toplevel, wm_caps); + if(serial > 0) + { + diya_view_set_pending_configure_serial(toplevel, serial); + } return; }