window: Support pinging Wayland surfaces as well

This commit is contained in:
Jasper St. Pierre 2013-11-21 14:20:52 -05:00
parent aa3643cdde
commit 6d639ac528
3 changed files with 26 additions and 3 deletions

View File

@ -12169,7 +12169,9 @@ meta_window_ping (MetaWindow *window,
meta_topic (META_DEBUG_PING,
"Sending ping with timestamp %u to window %s\n",
timestamp, window->desc);
meta_window_send_icccm_message (window,
display->atom__NET_WM_PING,
timestamp);
if (window->client_type == META_WINDOW_CLIENT_TYPE_X11)
meta_window_send_icccm_message (window, display->atom__NET_WM_PING, timestamp);
else
meta_wayland_surface_ping (window->surface, timestamp);
}

View File

@ -566,6 +566,10 @@ xdg_surface_pong (struct wl_client *client,
struct wl_resource *resource,
guint32 serial)
{
MetaWaylandSurfaceExtension *xdg_surface = wl_resource_get_user_data (resource);
MetaWaylandSurface *surface = wl_container_of (xdg_surface, surface, xdg_surface);
meta_window_pong (surface->window, serial);
}
static gboolean
@ -769,6 +773,10 @@ xdg_popup_pong (struct wl_client *client,
struct wl_resource *resource,
uint32_t serial)
{
MetaWaylandSurfaceExtension *xdg_popup = wl_resource_get_user_data (resource);
MetaWaylandSurface *surface = wl_container_of (xdg_popup, surface, xdg_popup);
meta_window_pong (surface->window, serial);
}
static const struct xdg_popup_interface meta_wayland_xdg_popup_interface = {
@ -940,3 +948,13 @@ meta_wayland_surface_focused_unset (MetaWaylandSurface *surface)
if (surface->xdg_surface.resource)
xdg_surface_send_focused_unset (surface->xdg_surface.resource);
}
void
meta_wayland_surface_ping (MetaWaylandSurface *surface,
guint32 timestamp)
{
if (surface->xdg_surface.resource)
xdg_surface_send_ping (surface->xdg_surface.resource, timestamp);
else if (surface->xdg_popup.resource)
xdg_popup_send_ping (surface->xdg_popup.resource, timestamp);
}

View File

@ -102,4 +102,7 @@ void meta_wayland_surface_configure_notify (MetaWaylandSurface *s
void meta_wayland_surface_focused_set (MetaWaylandSurface *surface);
void meta_wayland_surface_focused_unset (MetaWaylandSurface *surface);
void meta_wayland_surface_ping (MetaWaylandSurface *surface,
guint32 serial);
#endif