mirror of
https://github.com/brl/mutter.git
synced 2024-11-09 23:46:33 -05:00
wayland: Let the roles handle their windows being managed
Move xdg_shell specific code from generic Wayland code into the xdg shell code unit by letting the roles handle the corresponding MetaWindow being managed. https://bugzilla.gnome.org/show_bug.cgi?id=757623 https://bugzilla.gnome.org/show_bug.cgi?id=763431
This commit is contained in:
parent
c2643ba5ac
commit
f8878ac907
@ -149,6 +149,10 @@ meta_wayland_surface_role_shell_surface_close (MetaWaylandSurfaceRoleShellSurfac
|
|||||||
static void
|
static void
|
||||||
meta_wayland_surface_role_shell_surface_popup_done (MetaWaylandSurfaceRoleShellSurface *shell_surface_role);
|
meta_wayland_surface_role_shell_surface_popup_done (MetaWaylandSurfaceRoleShellSurface *shell_surface_role);
|
||||||
|
|
||||||
|
static void
|
||||||
|
meta_wayland_surface_role_shell_surface_managed (MetaWaylandSurfaceRoleShellSurface *shell_surface_role,
|
||||||
|
MetaWindow *window);
|
||||||
|
|
||||||
gboolean
|
gboolean
|
||||||
meta_wayland_surface_assign_role (MetaWaylandSurface *surface,
|
meta_wayland_surface_assign_role (MetaWaylandSurface *surface,
|
||||||
GType role_type)
|
GType role_type)
|
||||||
@ -1726,6 +1730,16 @@ meta_wayland_surface_popup_done (MetaWaylandSurface *surface)
|
|||||||
meta_wayland_surface_role_shell_surface_popup_done (shell_surface_role);
|
meta_wayland_surface_role_shell_surface_popup_done (shell_surface_role);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
meta_wayland_surface_window_managed (MetaWaylandSurface *surface,
|
||||||
|
MetaWindow *window)
|
||||||
|
{
|
||||||
|
MetaWaylandSurfaceRoleShellSurface *shell_surface_role =
|
||||||
|
META_WAYLAND_SURFACE_ROLE_SHELL_SURFACE (surface->role);
|
||||||
|
|
||||||
|
meta_wayland_surface_role_shell_surface_managed (shell_surface_role, window);
|
||||||
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
meta_wayland_surface_drag_dest_focus_in (MetaWaylandSurface *surface,
|
meta_wayland_surface_drag_dest_focus_in (MetaWaylandSurface *surface,
|
||||||
MetaWaylandDataOffer *offer)
|
MetaWaylandDataOffer *offer)
|
||||||
@ -1939,6 +1953,16 @@ meta_wayland_surface_role_shell_surface_popup_done (MetaWaylandSurfaceRoleShellS
|
|||||||
shell_surface_role_class->popup_done (shell_surface_role);
|
shell_surface_role_class->popup_done (shell_surface_role);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static void
|
||||||
|
meta_wayland_surface_role_shell_surface_managed (MetaWaylandSurfaceRoleShellSurface *shell_surface_role,
|
||||||
|
MetaWindow *window)
|
||||||
|
{
|
||||||
|
MetaWaylandSurfaceRoleShellSurfaceClass *shell_surface_role_class =
|
||||||
|
META_WAYLAND_SURFACE_ROLE_SHELL_SURFACE_GET_CLASS (shell_surface_role);
|
||||||
|
|
||||||
|
shell_surface_role_class->managed (shell_surface_role, window);
|
||||||
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
meta_wayland_surface_queue_pending_frame_callbacks (MetaWaylandSurface *surface)
|
meta_wayland_surface_queue_pending_frame_callbacks (MetaWaylandSurface *surface)
|
||||||
{
|
{
|
||||||
|
@ -94,6 +94,8 @@ struct _MetaWaylandSurfaceRoleShellSurfaceClass
|
|||||||
int new_width,
|
int new_width,
|
||||||
int new_height,
|
int new_height,
|
||||||
MetaWaylandSerial *sent_serial);
|
MetaWaylandSerial *sent_serial);
|
||||||
|
void (*managed) (MetaWaylandSurfaceRoleShellSurface *shell_surface_role,
|
||||||
|
MetaWindow *window);
|
||||||
void (*ping) (MetaWaylandSurfaceRoleShellSurface *shell_surface_role,
|
void (*ping) (MetaWaylandSurfaceRoleShellSurface *shell_surface_role,
|
||||||
uint32_t serial);
|
uint32_t serial);
|
||||||
void (*close) (MetaWaylandSurfaceRoleShellSurface *shell_surface_role);
|
void (*close) (MetaWaylandSurfaceRoleShellSurface *shell_surface_role);
|
||||||
@ -348,4 +350,8 @@ gboolean meta_wayland_surface_begin_grab_op (MetaWaylandSurface *surf
|
|||||||
MetaGrabOp grab_op,
|
MetaGrabOp grab_op,
|
||||||
gfloat x,
|
gfloat x,
|
||||||
gfloat y);
|
gfloat y);
|
||||||
|
|
||||||
|
void meta_wayland_surface_window_managed (MetaWaylandSurface *surface,
|
||||||
|
MetaWindow *window);
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
@ -528,6 +528,12 @@ wl_shell_surface_role_configure (MetaWaylandSurfaceRoleShellSurface *shell_surfa
|
|||||||
new_width, new_height);
|
new_width, new_height);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static void
|
||||||
|
wl_shell_surface_role_managed (MetaWaylandSurfaceRoleShellSurface *shell_surface_role,
|
||||||
|
MetaWindow *window)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
wl_shell_surface_role_ping (MetaWaylandSurfaceRoleShellSurface *shell_surface_role,
|
wl_shell_surface_role_ping (MetaWaylandSurfaceRoleShellSurface *shell_surface_role,
|
||||||
guint32 serial)
|
guint32 serial)
|
||||||
@ -574,6 +580,7 @@ meta_wayland_surface_role_wl_shell_surface_class_init (MetaWaylandSurfaceRoleWlS
|
|||||||
shell_surface_role_class =
|
shell_surface_role_class =
|
||||||
META_WAYLAND_SURFACE_ROLE_SHELL_SURFACE_CLASS (klass);
|
META_WAYLAND_SURFACE_ROLE_SHELL_SURFACE_CLASS (klass);
|
||||||
shell_surface_role_class->configure = wl_shell_surface_role_configure;
|
shell_surface_role_class->configure = wl_shell_surface_role_configure;
|
||||||
|
shell_surface_role_class->managed = wl_shell_surface_role_managed;
|
||||||
shell_surface_role_class->ping = wl_shell_surface_role_ping;
|
shell_surface_role_class->ping = wl_shell_surface_role_ping;
|
||||||
shell_surface_role_class->close = wl_shell_surface_role_close;
|
shell_surface_role_class->close = wl_shell_surface_role_close;
|
||||||
shell_surface_role_class->popup_done = wl_shell_surface_role_popup_done;
|
shell_surface_role_class->popup_done = wl_shell_surface_role_popup_done;
|
||||||
|
@ -625,6 +625,12 @@ xdg_surface_role_configure (MetaWaylandSurfaceRoleShellSurface *shell_surface_ro
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static void
|
||||||
|
xdg_surface_role_managed (MetaWaylandSurfaceRoleShellSurface *shell_surface_role,
|
||||||
|
MetaWindow *window)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
xdg_surface_role_ping (MetaWaylandSurfaceRoleShellSurface *shell_surface_role,
|
xdg_surface_role_ping (MetaWaylandSurfaceRoleShellSurface *shell_surface_role,
|
||||||
uint32_t serial)
|
uint32_t serial)
|
||||||
@ -665,6 +671,7 @@ meta_wayland_surface_role_xdg_surface_class_init (MetaWaylandSurfaceRoleXdgSurfa
|
|||||||
META_WAYLAND_SURFACE_ROLE_SHELL_SURFACE_CLASS (klass);
|
META_WAYLAND_SURFACE_ROLE_SHELL_SURFACE_CLASS (klass);
|
||||||
|
|
||||||
shell_surface_role_class->configure = xdg_surface_role_configure;
|
shell_surface_role_class->configure = xdg_surface_role_configure;
|
||||||
|
shell_surface_role_class->managed = xdg_surface_role_managed;
|
||||||
shell_surface_role_class->ping = xdg_surface_role_ping;
|
shell_surface_role_class->ping = xdg_surface_role_ping;
|
||||||
shell_surface_role_class->close = xdg_surface_role_close;
|
shell_surface_role_class->close = xdg_surface_role_close;
|
||||||
}
|
}
|
||||||
@ -704,6 +711,22 @@ xdg_popup_role_configure (MetaWaylandSurfaceRoleShellSurface *shell_surface_role
|
|||||||
* Just ignore it. */
|
* Just ignore it. */
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static void
|
||||||
|
xdg_popup_role_managed (MetaWaylandSurfaceRoleShellSurface *shell_surface_role,
|
||||||
|
MetaWindow *window)
|
||||||
|
{
|
||||||
|
MetaWaylandSurfaceRole *surface_role =
|
||||||
|
META_WAYLAND_SURFACE_ROLE (shell_surface_role);
|
||||||
|
MetaWaylandSurface *surface =
|
||||||
|
meta_wayland_surface_role_get_surface (surface_role);
|
||||||
|
MetaWaylandSurface *parent = surface->popup.parent;
|
||||||
|
|
||||||
|
g_assert (parent);
|
||||||
|
|
||||||
|
meta_window_set_transient_for (window, parent->window);
|
||||||
|
meta_window_set_type (window, META_WINDOW_DROPDOWN_MENU);
|
||||||
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
xdg_popup_role_ping (MetaWaylandSurfaceRoleShellSurface *shell_surface_role,
|
xdg_popup_role_ping (MetaWaylandSurfaceRoleShellSurface *shell_surface_role,
|
||||||
uint32_t serial)
|
uint32_t serial)
|
||||||
@ -744,6 +767,7 @@ meta_wayland_surface_role_xdg_popup_class_init (MetaWaylandSurfaceRoleXdgPopupCl
|
|||||||
META_WAYLAND_SURFACE_ROLE_SHELL_SURFACE_CLASS (klass);
|
META_WAYLAND_SURFACE_ROLE_SHELL_SURFACE_CLASS (klass);
|
||||||
|
|
||||||
shell_surface_role_class->configure = xdg_popup_role_configure;
|
shell_surface_role_class->configure = xdg_popup_role_configure;
|
||||||
|
shell_surface_role_class->managed = xdg_popup_role_managed;
|
||||||
shell_surface_role_class->ping = xdg_popup_role_ping;
|
shell_surface_role_class->ping = xdg_popup_role_ping;
|
||||||
shell_surface_role_class->popup_done = xdg_popup_role_popup_done;
|
shell_surface_role_class->popup_done = xdg_popup_role_popup_done;
|
||||||
}
|
}
|
||||||
|
@ -68,15 +68,7 @@ meta_window_wayland_manage (MetaWindow *window)
|
|||||||
0);
|
0);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (META_IS_WAYLAND_SURFACE_ROLE_XDG_POPUP (window->surface->role))
|
meta_wayland_surface_window_managed (window->surface, window);
|
||||||
{
|
|
||||||
MetaWaylandSurface *parent = window->surface->popup.parent;
|
|
||||||
|
|
||||||
g_assert (parent);
|
|
||||||
|
|
||||||
meta_window_set_transient_for (window, parent->window);
|
|
||||||
meta_window_set_type (window, META_WINDOW_DROPDOWN_MENU);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
|
Loading…
Reference in New Issue
Block a user