wmaker-popup-v1: raise popup above parent and track parent moves

Two issues:
1. Popups rendered behind their parent toplevel because the scene node
   wasn't raised on apply. Add wlr_scene_node_raise_to_top so popups
   appear above the parent.
2. When the parent toplevel moved, popups stayed at their old screen
   position. In wl_window_move (compositor-side), after a regular
   toplevel's position changes, iterate all popups and re-apply those
   whose popup_parent is this toplevel so they track the parent.
This commit is contained in:
Window Maker 2026-05-24 18:58:07 +02:00
parent baf021fa0c
commit b040b5c7fe
1 changed files with 16 additions and 2 deletions

View File

@ -1470,16 +1470,21 @@ wmaker_popup_apply(struct wl_toplevel_view *view)
if (fb) {
fb->x += dx;
fb->y += dy;
if (fb->tree)
if (fb->tree) {
wlr_scene_node_set_position(&fb->tree->node, fb->x, fb->y);
else if (fb->scene_buf)
/* Raise above siblings so popups appear over their parent */
wlr_scene_node_raise_to_top(&fb->tree->node);
} else if (fb->scene_buf) {
wlr_scene_node_set_position(&fb->scene_buf->node, fb->x, fb->y);
wlr_scene_node_raise_to_top(&fb->scene_buf->node);
}
view->frame_rel_x = 0;
view->frame_rel_y = 0;
}
} else if (view->scene_node) {
wlr_scene_node_set_position(&view->scene_node->node,
view->x, view->y);
wlr_scene_node_raise_to_top(&view->scene_node->node);
}
}
@ -6980,6 +6985,15 @@ static void wl_window_move(WNativeWindow win, int x, int y)
wlr_xwayland_surface_configure(v->xw_surface,
(int16_t)v->x, (int16_t)v->y,
v->xw_surface->width, v->xw_surface->height);
/* Re-apply any popups whose parent is this toplevel so they
* track the parent's position. */
struct wl_toplevel_view *p;
wl_list_for_each(p, &wl_state.toplevel_list, link) {
if (p->popup && p->popup_parent
&& wl_find_view_by_xdg_surface(p->popup_parent->base) == v) {
wmaker_popup_apply(p);
}
}
return;
}
struct wl_frame_buf *fb = frame_buf_find(win);