Move ping to be a vfunc

This commit is contained in:
Jasper St. Pierre 2014-03-20 15:12:44 -04:00
parent 9debd2fb0d
commit 14f424cd02
4 changed files with 23 additions and 6 deletions

View File

@ -4701,12 +4701,7 @@ meta_display_ping_window (MetaWindow *window,
"Sending ping with timestamp %u to window %s\n", "Sending ping with timestamp %u to window %s\n",
timestamp, window->desc); timestamp, window->desc);
if (window->client_type == META_WINDOW_CLIENT_TYPE_X11) META_WINDOW_GET_CLASS (window)->ping (window, timestamp);
meta_window_send_icccm_message (window,
display->atom__NET_WM_PING,
timestamp);
else
meta_wayland_surface_ping (window->surface, timestamp);
} }
static void static void

View File

@ -471,6 +471,8 @@ struct _MetaWindowClass
void (*manage) (MetaWindow *window); void (*manage) (MetaWindow *window);
void (*unmanage) (MetaWindow *window); void (*unmanage) (MetaWindow *window);
void (*ping) (MetaWindow *window,
guint32 serial);
void (*delete) (MetaWindow *window, void (*delete) (MetaWindow *window,
guint32 timestamp); guint32 timestamp);
void (*kill) (MetaWindow *window); void (*kill) (MetaWindow *window);

View File

@ -75,6 +75,13 @@ meta_window_wayland_unmanage (MetaWindow *window)
meta_display_unregister_wayland_window (window->display, window); meta_display_unregister_wayland_window (window->display, window);
} }
static void
meta_window_wayland_ping (MetaWindow *window,
guint32 serial)
{
meta_wayland_surface_ping (window->surface, serial);
}
static void static void
meta_window_wayland_delete (MetaWindow *window, meta_window_wayland_delete (MetaWindow *window,
guint32 timestamp) guint32 timestamp)
@ -189,6 +196,7 @@ meta_window_wayland_class_init (MetaWindowWaylandClass *klass)
window_class->manage = meta_window_wayland_manage; window_class->manage = meta_window_wayland_manage;
window_class->unmanage = meta_window_wayland_unmanage; window_class->unmanage = meta_window_wayland_unmanage;
window_class->ping = meta_window_wayland_ping;
window_class->delete = meta_window_wayland_delete; window_class->delete = meta_window_wayland_delete;
window_class->kill = meta_window_wayland_kill; window_class->kill = meta_window_wayland_kill;
window_class->move_resize_internal = meta_window_wayland_move_resize_internal; window_class->move_resize_internal = meta_window_wayland_move_resize_internal;

View File

@ -322,6 +322,17 @@ meta_window_x11_unmanage (MetaWindow *window)
meta_error_trap_pop (window->display); meta_error_trap_pop (window->display);
} }
static void
meta_window_x11_ping (MetaWindow *window,
guint32 serial)
{
MetaDisplay *display = window->display;
meta_window_send_icccm_message (window,
display->atom__NET_WM_PING,
serial);
}
static void static void
meta_window_x11_delete (MetaWindow *window, meta_window_x11_delete (MetaWindow *window,
guint32 timestamp) guint32 timestamp)
@ -797,6 +808,7 @@ meta_window_x11_class_init (MetaWindowX11Class *klass)
window_class->manage = meta_window_x11_manage; window_class->manage = meta_window_x11_manage;
window_class->unmanage = meta_window_x11_unmanage; window_class->unmanage = meta_window_x11_unmanage;
window_class->ping = meta_window_x11_ping;
window_class->delete = meta_window_x11_delete; window_class->delete = meta_window_x11_delete;
window_class->kill = meta_window_x11_kill; window_class->kill = meta_window_x11_kill;
window_class->move_resize_internal = meta_window_x11_move_resize_internal; window_class->move_resize_internal = meta_window_x11_move_resize_internal;