Commit 1bd3c13f authored by Jonas Ådahl's avatar Jonas Ådahl Committed by Florian Müllner

wayland/xdg-shell: Split out popup placement out of setup finish

Makes the function slightly more comprehensible.

!496
parent 5d1eccfb
......@@ -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)
{
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment