diff --git a/src/wayland/meta-wayland-xdg-shell.c b/src/wayland/meta-wayland-xdg-shell.c index afd4bb94b..d747f5c07 100644 --- a/src/wayland/meta-wayland-xdg-shell.c +++ b/src/wayland/meta-wayland-xdg-shell.c @@ -921,6 +921,22 @@ scale_placement_rule (MetaPlacementRule *placement_rule, placement_rule->height *= geometry_scale; } +static void +meta_wayland_xdg_popup_place (MetaWaylandXdgPopup *xdg_popup, + MetaPlacementRule *placement_rule) +{ + MetaWaylandSurfaceRole *surface_role = META_WAYLAND_SURFACE_ROLE (xdg_popup); + MetaWaylandSurface *surface = + meta_wayland_surface_role_get_surface (surface_role); + MetaPlacementRule scaled_placement_rule; + + scaled_placement_rule = *placement_rule; + scale_placement_rule (&scaled_placement_rule, surface); + + meta_window_place_with_placement_rule (surface->window, + &scaled_placement_rule); +} + static void finish_popup_setup (MetaWaylandXdgPopup *xdg_popup) { @@ -933,7 +949,6 @@ finish_popup_setup (MetaWaylandXdgPopup *xdg_popup) MetaWaylandSurface *surface = meta_wayland_surface_role_get_surface (surface_role); MetaWaylandSurface *parent_surface; - MetaPlacementRule scaled_placement_rule; MetaWaylandSeat *seat; uint32_t serial; MetaDisplay *display = meta_get_display (); @@ -981,9 +996,7 @@ finish_popup_setup (MetaWaylandXdgPopup *xdg_popup) window = meta_window_wayland_new (display, surface); meta_wayland_shell_surface_set_window (shell_surface, window); - scaled_placement_rule = xdg_popup->setup.placement_rule; - scale_placement_rule (&scaled_placement_rule, surface); - meta_window_place_with_placement_rule (window, &scaled_placement_rule); + meta_wayland_xdg_popup_place (xdg_popup, &xdg_popup->setup.placement_rule); if (seat) {