xwayland: set initial view state + geometry in handle_associate()

Empirically, the associate event is always seen just after map_request
but before surface map. Window properties are also read by wlroots just
before emitting associate. So after some trial and error, this seems to
be the best place to set initial view states and compute initial
placement.

Fixes initial positioning of "urxvt -g -0-0".

urxvt placement regressed in:
9903331995
("xwayland: rework setting initial geometry from surface")

map_request handler was added ~2 years ago in:
c9018da4c4
("xwayland: set initial geometry in map_request handler")

I'm not sure if the map_request handler was incorrect from day one,
or if something changed in wlroots and/or Xwayland since then.
This commit is contained in:
John Lindgren 2026-03-27 22:10:07 -04:00 committed by Johan Malm
parent fee38bceca
commit 3ce6328f6d
2 changed files with 47 additions and 72 deletions

View file

@ -54,7 +54,6 @@ struct xwayland_view {
struct wl_listener set_strut_partial;
struct wl_listener set_window_type;
struct wl_listener focus_in;
struct wl_listener map_request;
/* Not (yet) implemented */
/* struct wl_listener set_role; */