diff --git a/src/core/display.c b/src/core/display.c index 67efd2c9c..287f1f565 100644 --- a/src/core/display.c +++ b/src/core/display.c @@ -4701,12 +4701,7 @@ meta_display_ping_window (MetaWindow *window, "Sending ping with timestamp %u to window %s\n", timestamp, window->desc); - 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); + META_WINDOW_GET_CLASS (window)->ping (window, timestamp); } static void diff --git a/src/core/window-private.h b/src/core/window-private.h index 82bfbdebf..c6e4adc8c 100644 --- a/src/core/window-private.h +++ b/src/core/window-private.h @@ -471,6 +471,8 @@ struct _MetaWindowClass void (*manage) (MetaWindow *window); void (*unmanage) (MetaWindow *window); + void (*ping) (MetaWindow *window, + guint32 serial); void (*delete) (MetaWindow *window, guint32 timestamp); void (*kill) (MetaWindow *window); diff --git a/src/wayland/window-wayland.c b/src/wayland/window-wayland.c index eea45f31e..32c511e40 100644 --- a/src/wayland/window-wayland.c +++ b/src/wayland/window-wayland.c @@ -75,6 +75,13 @@ meta_window_wayland_unmanage (MetaWindow *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 meta_window_wayland_delete (MetaWindow *window, guint32 timestamp) @@ -189,6 +196,7 @@ meta_window_wayland_class_init (MetaWindowWaylandClass *klass) window_class->manage = meta_window_wayland_manage; window_class->unmanage = meta_window_wayland_unmanage; + window_class->ping = meta_window_wayland_ping; window_class->delete = meta_window_wayland_delete; window_class->kill = meta_window_wayland_kill; window_class->move_resize_internal = meta_window_wayland_move_resize_internal; diff --git a/src/x11/window-x11.c b/src/x11/window-x11.c index e95fdec3a..a7e438145 100644 --- a/src/x11/window-x11.c +++ b/src/x11/window-x11.c @@ -322,6 +322,17 @@ meta_window_x11_unmanage (MetaWindow *window) 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 meta_window_x11_delete (MetaWindow *window, guint32 timestamp) @@ -797,6 +808,7 @@ meta_window_x11_class_init (MetaWindowX11Class *klass) window_class->manage = meta_window_x11_manage; window_class->unmanage = meta_window_x11_unmanage; + window_class->ping = meta_window_x11_ping; window_class->delete = meta_window_x11_delete; window_class->kill = meta_window_x11_kill; window_class->move_resize_internal = meta_window_x11_move_resize_internal;