debug: trace wmaker-popup-v1 protocol flow

This commit is contained in:
Window Maker 2026-05-24 18:31:37 +02:00
parent b5cc53a8a8
commit 1cf271932a
2 changed files with 14 additions and 2 deletions

View File

@ -463,11 +463,16 @@ wl_client_toplevel_realize(struct W_View *view, int width, int height)
if (ctx->wmaker_popup_mgr) {
top->wmaker_popup = wmaker_popup_manager_v1_get_popup(
ctx->wmaker_popup_mgr, top->xdg_toplevel);
wwarning("wclient_wl: wrapped popup toplevel id=0x%lx pos=(%d,%d) wrapper=%p",
(unsigned long)view->window, view->pos.x, view->pos.y,
(void*)top->wmaker_popup);
/* Apply any position recorded in view->pos before realize. */
if (top->wmaker_popup && (view->pos.x || view->pos.y)) {
wmaker_popup_v1_set_position(top->wmaker_popup,
view->pos.x, view->pos.y);
}
} else {
wwarning("wclient_wl: popup view but no manager bound");
}
} else {
xdg_toplevel_set_app_id(top->xdg_toplevel, "WINGs");
@ -535,6 +540,9 @@ void
W_WLClientPopupSetPosition(WNativeWindow window, int x, int y)
{
WLClientToplevel *top = wlc_top_find(window);
wwarning("wclient_wl: SetPosition id=0x%lx pos=(%d,%d) top=%p wrapper=%p",
(unsigned long)window, x, y, (void*)top,
top ? (void*)top->wmaker_popup : NULL);
if (!top || !top->wmaker_popup) return;
wmaker_popup_v1_set_position(top->wmaker_popup, x, y);
}
@ -1063,6 +1071,7 @@ registry_handle_global(void *data, struct wl_registry *registry,
} else if (strcmp(interface, wmaker_popup_manager_v1_interface.name) == 0) {
ctx->wmaker_popup_mgr = wl_registry_bind(registry, name,
&wmaker_popup_manager_v1_interface, 1);
wwarning("wclient_wl: bound wmaker_popup_manager_v1");
}
}

View File

@ -1397,6 +1397,7 @@ wmaker_popup_handle_set_position(struct wl_client *client,
{
(void)client;
struct wl_toplevel_view *view = wl_resource_get_user_data(resource);
wwarning("wmaker_popup: set_position view=%p (%d,%d)", (void*)view, x, y);
if (!view) return;
view->popup_x = (int)x;
view->popup_y = (int)y;
@ -1421,10 +1422,12 @@ wmaker_popup_apply(struct wl_toplevel_view *view)
{
if (!view || !view->popup) return;
/* Update the canonical view position so subsequent compositor logic
* (frame moves, scene-node positioning) sees the new placement. */
int dx = view->popup_x - view->x;
int dy = view->popup_y - view->y;
wwarning("wmaker_popup_apply: view=%p (%d,%d)->(%d,%d) frame_id=0x%lx scene_node=%p",
(void*)view, view->x, view->y, view->popup_x, view->popup_y,
(unsigned long)view->frame_id, (void*)view->scene_node);
view->x = view->popup_x;
view->y = view->popup_y;