wl_backend: use map_request signal instead of associate for xwayland
The associate signal fires when a wlr_surface is linked to the xwayland surface, but this can happen before or during new_surface processing. map_request fires when the X11 client actually sends MapRequest — at which point WM_CLASS is set and the client is ready to be managed and shown.
This commit is contained in:
parent
72a592a402
commit
1733e3449c
|
|
@ -1929,7 +1929,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;
|
||||
|
||||
wl_signal_add(&xw->events.associate, &view->map_listener);
|
||||
wl_signal_add(&xw->events.map_request, &view->map_listener);
|
||||
wl_signal_add(&xw->events.dissociate, &view->unmap_listener);
|
||||
wl_signal_add(&xw->events.destroy, &view->destroy_listener);
|
||||
wl_signal_add(&xw->events.set_class, &view->title_listener);
|
||||
|
|
@ -1942,12 +1942,8 @@ handle_xwayland_new_surface(struct wl_listener *listener, void *data)
|
|||
view->y = (wl_state.output ? (int)wl_state.output->height : 1080) / 4;
|
||||
|
||||
/* If the surface is already associated (has a wlr_surface), we missed
|
||||
* the associate event. Trigger the map handler directly. */
|
||||
if (xw->surface) {
|
||||
wwarning("wl_backend: xwayland surface 0x%x already associated, triggering map",
|
||||
(unsigned)xw->window_id);
|
||||
view->map_listener.notify(&view->map_listener, NULL);
|
||||
}
|
||||
* the associate event. Not needed with map_request — the client will
|
||||
* send MapRequest when ready. */
|
||||
|
||||
wwarning("wl_backend: new XWayland surface id=0x%lx class=%s title=%s pos=%d,%d",
|
||||
view->id,
|
||||
|
|
|
|||
Loading…
Reference in New Issue