wayland/xdg-shell: Split out popup placement out of setup finish
Makes the function slightly more comprehensible. https://gitlab.gnome.org/GNOME/mutter/merge_requests/496
This commit is contained in:
parent
5d1eccfb6f
commit
1bd3c13fe1
@ -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)
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user