@@ -293,6 +293,7 @@ popup_handle_destroy(struct wl_listener *listener, void *data)
293293 struct cg_xdg_popup * popup = wl_container_of (listener , popup , destroy );
294294 wl_list_remove (& popup -> destroy .link );
295295 wl_list_remove (& popup -> commit .link );
296+ wl_list_remove (& popup -> reposition .link );
296297 free (popup );
297298}
298299
@@ -306,6 +307,14 @@ popup_handle_commit(struct wl_listener *listener, void *data)
306307 }
307308}
308309
310+ static void
311+ popup_handle_reposition (struct wl_listener * listener , void * data )
312+ {
313+ struct cg_xdg_popup * popup = wl_container_of (listener , popup , reposition );
314+
315+ popup_unconstrain (popup -> xdg_popup );
316+ }
317+
309318void
310319handle_new_xdg_popup (struct wl_listener * listener , void * data )
311320{
@@ -350,6 +359,9 @@ handle_new_xdg_popup(struct wl_listener *listener, void *data)
350359 popup -> commit .notify = popup_handle_commit ;
351360 wl_signal_add (& wlr_popup -> base -> surface -> events .commit , & popup -> commit );
352361
362+ popup -> reposition .notify = popup_handle_reposition ;
363+ wl_signal_add (& wlr_popup -> events .reposition , & popup -> reposition );
364+
353365 struct wlr_scene_tree * popup_scene_tree = wlr_scene_xdg_surface_create (parent_scene_tree , wlr_popup -> base );
354366 if (popup_scene_tree == NULL ) {
355367 wlr_log (WLR_ERROR , "Failed to allocate scene-graph node for XDG popup" );
0 commit comments