wayland: Phase 44 — client_synth_configure/window_resize send XDG configure

Implement three vtable slots:
  - client_synth_configure: calls wlr_xdg_toplevel_set_size + schedule_configure
    so the WM can resize/reposition XDG toplevel clients
  - window_resize: same — sends a configure with the new width/height
  - window_move: no-op comment (position is WM-side only for Wayland)

All three use wl_find_view_by_id to recover the wl_toplevel_view.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
Levi Neely 2026-03-28 06:41:17 +01:00
parent 0fe2960995
commit 4574fe8873
1 changed files with 27 additions and 3 deletions

View File

@ -23,6 +23,8 @@
* geometry for mapped XDG toplevels.
* Phase 43: focus_set delivers keyboard focus via wlr_seat; headless keyboard
* device created and attached to seat; mapped toplevels auto-focused.
* Phase 44: client_synth_configure, window_resize send XDG configure events
* so clients receive size changes from the WM.
*/
#ifdef HAVE_CONFIG_H
@ -759,8 +761,21 @@ static void wl_window_map(WNativeWindow win) { (void)win; }
static void wl_window_map_raised(WNativeWindow win) { (void)win; }
static void wl_window_map_subwindows(WNativeWindow parent) { (void)parent; }
static void wl_window_unmap(WNativeWindow win) { (void)win; }
static void wl_window_move(WNativeWindow win, int x, int y) { (void)win; (void)x; (void)y; }
static void wl_window_resize(WNativeWindow win, int w, int h) { (void)win; (void)w; (void)h; }
static void wl_window_move(WNativeWindow win, int x, int y)
{
/* Phase 44: position is tracked on the WM side; no server-side move needed. */
(void)win; (void)x; (void)y;
}
static void wl_window_resize(WNativeWindow win, int w, int h)
{
/* Phase 44: send a configure with the new size. */
struct wl_toplevel_view *v = wl_find_view_by_id(win);
if (!v || !v->xdg_surface || w <= 0 || h <= 0)
return;
wlr_xdg_toplevel_set_size(v->xdg_surface, (uint32_t)w, (uint32_t)h);
wlr_xdg_surface_schedule_configure(v->xdg_surface);
}
static void wl_window_set_border(WNativeWindow win, unsigned long pixel) { (void)win; (void)pixel; }
static void wl_window_set_border_width(WNativeWindow win, int width) { (void)win; (void)width; }
static void wl_window_set_save_under(WNativeWindow win, int save_under) { (void)win; (void)save_under; }
@ -831,7 +846,16 @@ static void
wl_client_synth_configure(WNativeWindow client_win,
int x, int y, int width, int height,
int border_width, WNativeWindow above)
{ (void)client_win; (void)x; (void)y; (void)width; (void)height; (void)border_width; (void)above; }
{
/* Phase 44: send an XDG configure with the new size to the client. */
(void)x; (void)y; (void)border_width; (void)above;
struct wl_toplevel_view *v = wl_find_view_by_id(client_win);
if (!v || !v->xdg_surface)
return;
if (width > 0 && height > 0)
wlr_xdg_toplevel_set_size(v->xdg_surface, (uint32_t)width, (uint32_t)height);
wlr_xdg_surface_schedule_configure(v->xdg_surface);
}
static void wl_client_add_to_save_set(WNativeWindow win) { (void)win; }
static void wl_client_remove_from_save_set(WNativeWindow win) { (void)win; }