bridge WINGs dialog XDG toplevel to WINGs view ID: set view->frame_id and adopt WINGs window ID in handle_toplevel_map

This commit is contained in:
Window Maker 2026-06-04 13:42:27 +02:00
parent 9dcc4f8f72
commit e090b929a4
1 changed files with 25 additions and 0 deletions

View File

@ -264,6 +264,31 @@ handle_toplevel_map(struct wl_listener *listener, void *data)
* (auto_focus=1 set in wl_screen_create_internals); the
* direct wl_focus_set() call is no longer needed here. */
/* Bridge to WINGs view: if this XDG toplevel belongs to
* a WINGs dialog, adopt the WINGs view window ID so
* view_surface_at returns an ID that event dispatch can
* route back to the correct WINGs W_View. */
{
const char *_app = view->xdg_surface->toplevel->app_id;
if (_app && (strcmp(_app, "WINGs") == 0 ||
strcmp(_app, "wings-popup") == 0)) {
/* Find the WINGs frame buffer created by
* wl_client_reparent that hasn't been claimed yet. */
struct wl_frame_buf *_fb;
wl_list_for_each(_fb, &wl_state.frame_list, link) {
if (_fb->id >= 0x20000000 && !wl_find_view_by_id(_fb->id)) {
wwarning("wl_backend: WINGs dialog id 0x%lx -> view",
(unsigned long)_fb->id);
view->id = _fb->id;
view->frame_id = _fb->parent_id;
view->frame_rel_x = _fb->rel_x;
view->frame_rel_y = _fb->rel_y;
break;
}
}
}
}
/* Phase 18: add XDG surface to the scene graph.
*
* ORDERING: wManageWindow (above) calls wl_client_reparent