wayland: add XWayland set_hints listener, remove hardcoded initial configure

- Listen for set_hints signal on XWayland surfaces so hints
  (including dockapp initial_state) are available at map time.
- Remove the hardcoded 640x480 initial configure — let clients
  request their own geometry via request_configure.
- Link xcb for future dockapp icon_window operations.
This commit is contained in:
lkn 2026-06-27 20:30:11 +02:00
parent 04f9a36da7
commit 4a58fd90eb
9 changed files with 13 additions and 8 deletions

BIN
20260627_19h55m44s_grim.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 454 KiB

BIN
20260627_19h59m14s_grim.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 330 KiB

BIN
dockapp_test.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 591 KiB

BIN
dockapp_test2.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 642 KiB

BIN
dockapp_test3.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 265 KiB

BIN
dockapp_test4.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 682 KiB

View File

@ -541,7 +541,7 @@ LIBEXIF =
LIBM = -lm
LIBOBJS =
LIBRARY_SEARCH_PATH = -L${libdir}
LIBS =
LIBS = -lxcb
LIBTOOL = $(SHELL) $(top_builddir)/libtool
LIBXINERAMA = -lXinerama
LIBXMU = -lXmu

View File

@ -46,6 +46,7 @@ struct wl_toplevel_view {
/* Path 1: geometry listener — keeps scene node in sync when X11 window moves. */
struct wl_listener xw_geometry_listener;
struct wl_listener xw_request_configure_listener;
struct wl_listener xw_set_hints_listener;
struct wl_listener xw_surface_map_listener; /* fires when wlr_surface maps */
/* Phase 18: scene graph tree for this surface (NULL if scene unavailable). */
struct wlr_scene_tree *scene_node;

View File

@ -106,6 +106,14 @@ handle_xwayland_request_configure(struct wl_listener *listener, void *data)
ev->x, ev->y, ev->width, ev->height);
}
static void
handle_xwayland_set_hints(struct wl_listener *listener, void *data)
{
(void)listener; (void)data;
/* Placeholder: hints are now available on the xw_surface.
* wManageWindow reads them via prop_get_wm_hints at map time. */
}
static void
handle_xwayland_request_fullscreen(struct wl_listener *listener, void *data)
{
@ -254,6 +262,7 @@ handle_xwayland_destroy(struct wl_listener *listener, void *data)
wl_list_remove(&view->title_listener.link);
wl_list_remove(&view->request_fullscreen_listener.link);
wl_list_remove(&view->xw_request_configure_listener.link);
wl_list_remove(&view->xw_set_hints_listener.link);
if (view->xw_surface_map_listener.link.next &&
view->xw_surface_map_listener.link.next != &view->xw_surface_map_listener.link)
wl_list_remove(&view->xw_surface_map_listener.link);
@ -418,6 +427,7 @@ handle_xwayland_new_surface(struct wl_listener *listener, void *data)
view->title_listener.notify = handle_xwayland_set_class;
view->xw_geometry_listener.notify = handle_xwayland_set_geometry;
view->xw_request_configure_listener.notify = handle_xwayland_request_configure;
view->xw_set_hints_listener.notify = handle_xwayland_set_hints;
view->request_fullscreen_listener.notify = handle_xwayland_request_fullscreen;
wl_signal_add(&xw->events.associate, &view->map_listener);
@ -426,6 +436,7 @@ handle_xwayland_new_surface(struct wl_listener *listener, void *data)
wl_signal_add(&xw->events.set_class, &view->title_listener);
wl_signal_add(&xw->events.set_geometry, &view->xw_geometry_listener);
wl_signal_add(&xw->events.request_configure, &view->xw_request_configure_listener);
wl_signal_add(&xw->events.set_hints, &view->xw_set_hints_listener);
wl_signal_add(&xw->events.request_fullscreen, &view->request_fullscreen_listener);
wl_list_insert(&wl_state.toplevel_list, &view->link);
@ -449,13 +460,6 @@ handle_xwayland_new_surface(struct wl_listener *listener, void *data)
xw->class ? xw->class : "(none)",
xw->title ? xw->title : "(none)",
xw->x, xw->y);
{
int cw = (xw->width >= 64) ? xw->width : 640;
int ch = (xw->height >= 64) ? xw->height : 480;
wlr_xwayland_surface_configure(xw,
(int16_t)view->x, (int16_t)view->y, cw, ch);
}
}
/* ------------------------------------------------------------------ */