1
0
Fork 0

wayland: Use helper to set shell surface window

The helper deals with updating the surface output state.

https://gitlab.gnome.org/GNOME/mutter/merge_requests/5
https://bugzilla.gnome.org/show_bug.cgi?id=791938
This commit is contained in:
Jonas Ådahl 2017-12-22 16:26:24 +08:00
parent 44624736c5
commit 514c7028f4
4 changed files with 25 additions and 5 deletions

View file

@ -73,6 +73,19 @@ meta_wayland_shell_surface_calculate_geometry (MetaWaylandShellSurface *shell_su
*out_geometry = geometry;
}
void
meta_wayland_shell_surface_set_window (MetaWaylandShellSurface *shell_surface,
MetaWindow *window)
{
MetaWaylandSurfaceRole *surface_role =
META_WAYLAND_SURFACE_ROLE (shell_surface);
MetaWaylandSurface *surface =
meta_wayland_surface_role_get_surface (surface_role);
meta_wayland_surface_set_window (surface, window);
meta_window_update_monitor (window, FALSE);
}
void
meta_wayland_shell_surface_configure (MetaWaylandShellSurface *shell_surface,
int new_x,

View file

@ -64,4 +64,7 @@ void meta_wayland_shell_surface_managed (MetaWaylandShellSurface *shell_surface,
void meta_wayland_shell_surface_calculate_geometry (MetaWaylandShellSurface *shell_surface,
MetaRectangle *out_geometry);
void meta_wayland_shell_surface_set_window (MetaWaylandShellSurface *shell_surface,
MetaWindow *window);
#endif /* META_WAYLAND_SHELL_SURFACE_H */

View file

@ -474,12 +474,14 @@ create_wl_shell_surface_window (MetaWaylandSurface *surface)
{
MetaWaylandWlShellSurface *wl_shell_surface =
META_WAYLAND_WL_SHELL_SURFACE (surface->role);
MetaWaylandShellSurface *shell_surface =
META_WAYLAND_SHELL_SURFACE (wl_shell_surface);
MetaWaylandSurface *parent;
MetaWindow *window;
GList *l;
window = meta_window_wayland_new (meta_get_display (), surface);
meta_wayland_surface_set_window (surface, window);
meta_wayland_shell_surface_set_window (shell_surface, window);
if (wl_shell_surface->title)
meta_window_set_title (surface->window, wl_shell_surface->title);

View file

@ -782,6 +782,8 @@ static void
finish_popup_setup (MetaWaylandXdgPopup *xdg_popup)
{
MetaWaylandXdgSurface *xdg_surface = META_WAYLAND_XDG_SURFACE (xdg_popup);
MetaWaylandShellSurface *shell_surface =
META_WAYLAND_SHELL_SURFACE (xdg_surface);
MetaWaylandSurfaceRole *surface_role = META_WAYLAND_SURFACE_ROLE (xdg_popup);
struct wl_resource *xdg_shell_resource =
meta_wayland_xdg_surface_get_shell_resource (xdg_surface);
@ -833,8 +835,7 @@ finish_popup_setup (MetaWaylandXdgPopup *xdg_popup)
&xdg_popup->parent_destroy_listener);
window = meta_window_wayland_new (display, surface);
meta_wayland_surface_set_window (surface, window);
meta_window_update_monitor (window, FALSE);
meta_wayland_shell_surface_set_window (shell_surface, window);
scaled_placement_rule = xdg_popup->setup.placement_rule;
scale_placement_rule (&scaled_placement_rule, surface);
@ -1498,6 +1499,7 @@ xdg_surface_constructor_get_toplevel (struct wl_client *client,
MetaWaylandSurface *surface = constructor->surface;
MetaWaylandXdgToplevel *xdg_toplevel;
MetaWaylandXdgSurface *xdg_surface;
MetaWaylandShellSurface *shell_surface;
MetaWindow *window;
if (!meta_wayland_surface_assign_role (surface,
@ -1526,8 +1528,8 @@ xdg_surface_constructor_get_toplevel (struct wl_client *client,
meta_wayland_xdg_surface_constructor_finalize (constructor, xdg_surface);
window = meta_window_wayland_new (meta_get_display (), surface);
meta_wayland_surface_set_window (surface, window);
meta_window_update_monitor (window, FALSE);
shell_surface = META_WAYLAND_SHELL_SURFACE (xdg_surface);
meta_wayland_shell_surface_set_window (shell_surface, window);
}
static void