[gtk+] wayland: Update to new xdg-shell pinging standards
- From: Jasper St. Pierre <jstpierre src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk+] wayland: Update to new xdg-shell pinging standards
- Date: Tue, 18 Feb 2014 21:48:22 +0000 (UTC)
commit 6845eade491d9ca5159fcaf89a4a90ba3995b7a1
Author: Jasper St. Pierre <jstpierre mecheye net>
Date: Sun Feb 16 10:25:22 2014 -0500
wayland: Update to new xdg-shell pinging standards
gdk/wayland/gdkdisplay-wayland.c | 17 +++++++++++
gdk/wayland/gdkwindow-wayland.c | 31 --------------------
gdk/wayland/protocol/xdg-shell.xml | 56 +++++++++++++++---------------------
3 files changed, 40 insertions(+), 64 deletions(-)
---
diff --git a/gdk/wayland/gdkdisplay-wayland.c b/gdk/wayland/gdkdisplay-wayland.c
index b7de77b..3df219d 100644
--- a/gdk/wayland/gdkdisplay-wayland.c
+++ b/gdk/wayland/gdkdisplay-wayland.c
@@ -145,6 +145,22 @@ wait_for_roundtrip(GdkWaylandDisplay *display)
}
static void
+xdg_shell_ping (void *data,
+ struct xdg_shell *xdg_shell,
+ uint32_t serial)
+{
+ GdkWaylandDisplay *wayland_display = data;
+
+ _gdk_wayland_display_update_serial (wayland_display, serial);
+
+ xdg_shell_pong (xdg_shell, serial);
+}
+
+static const struct xdg_shell_listener xdg_shell_listener = {
+ xdg_shell_ping,
+};
+
+static void
gdk_registry_handle_global(void *data, struct wl_registry *registry, uint32_t id,
const char *interface, uint32_t version)
{
@@ -167,6 +183,7 @@ gdk_registry_handle_global(void *data, struct wl_registry *registry, uint32_t id
display_wayland->xdg_shell =
wl_registry_bind(display_wayland->wl_registry, id, &xdg_shell_interface, 1);
xdg_shell_use_unstable_version(display_wayland->xdg_shell, XDG_SHELL_VERSION_CURRENT);
+ xdg_shell_add_listener(display_wayland->xdg_shell, &xdg_shell_listener, display_wayland);
} else if (strcmp(interface, "gtk_shell") == 0) {
display_wayland->gtk_shell =
wl_registry_bind(display_wayland->wl_registry, id, >k_shell_interface, 1);
diff --git a/gdk/wayland/gdkwindow-wayland.c b/gdk/wayland/gdkwindow-wayland.c
index ab5953f..b799803 100644
--- a/gdk/wayland/gdkwindow-wayland.c
+++ b/gdk/wayland/gdkwindow-wayland.c
@@ -924,21 +924,6 @@ gdk_wayland_window_create_surface (GdkWindow *window)
}
static void
-xdg_surface_ping (void *data,
- struct xdg_surface *xdg_surface,
- uint32_t serial)
-{
-
- GdkWindow *window = GDK_WINDOW (data);
- GdkWaylandDisplay *wayland_display =
- GDK_WAYLAND_DISPLAY (gdk_window_get_display (window));
-
- _gdk_wayland_display_update_serial (wayland_display, serial);
-
- xdg_surface_pong (xdg_surface, serial);
-}
-
-static void
xdg_surface_configure (void *data,
struct xdg_surface *xdg_surface,
int32_t width,
@@ -1024,7 +1009,6 @@ xdg_surface_delete (void *data,
}
static const struct xdg_surface_listener xdg_surface_listener = {
- xdg_surface_ping,
xdg_surface_configure,
xdg_surface_request_set_fullscreen,
xdg_surface_request_unset_fullscreen,
@@ -1050,20 +1034,6 @@ gdk_wayland_window_create_xdg_surface (GdkWindow *window)
}
static void
-xdg_popup_ping (void *data,
- struct xdg_popup *xdg_popup,
- uint32_t serial)
-{
- GdkWindow *window = GDK_WINDOW (data);
- GdkWaylandDisplay *wayland_display =
- GDK_WAYLAND_DISPLAY (gdk_window_get_display (window));
-
- _gdk_wayland_display_update_serial (wayland_display, serial);
-
- xdg_popup_pong (xdg_popup, serial);
-}
-
-static void
xdg_popup_done (void *data,
struct xdg_popup *xdg_popup,
uint32_t serial)
@@ -1078,7 +1048,6 @@ xdg_popup_done (void *data,
}
static const struct xdg_popup_listener xdg_popup_listener = {
- xdg_popup_ping,
xdg_popup_done,
};
diff --git a/gdk/wayland/protocol/xdg-shell.xml b/gdk/wayland/protocol/xdg-shell.xml
index f0d04aa..ef755b7 100644
--- a/gdk/wayland/protocol/xdg-shell.xml
+++ b/gdk/wayland/protocol/xdg-shell.xml
@@ -43,7 +43,7 @@
Use this enum to check the protocol version, and it will be updated
automatically.
</description>
- <entry name="current" value="1" summary="Always the latest version"/>
+ <entry name="current" value="2" summary="Always the latest version"/>
</enum>
@@ -84,6 +84,28 @@
<arg name="y" type="int"/>
<arg name="flags" type="uint"/>
</request>
+
+ <event name="ping">
+ <description summary="check if the client is alive">
+ The ping event asks the client if it's still alive. Pass the
+ serial specified in the event back to the compositor by sending
+ a "pong" request back with the specified serial.
+
+ Compositors can use this to determine if the client is still
+ alive. It's unspecified what will happen if the client doesn't
+ respond to the ping request, or in what timeframe. Clients should
+ try to respond in a reasonable amount of time.
+ </description>
+ <arg name="serial" type="uint" summary="pass this to the callback"/>
+ </event>
+
+ <request name="pong">
+ <description summary="respond to a ping event">
+ A client must respond to a ping event with a pong request or
+ the client may be deemed unresponsive.
+ </description>
+ <arg name="serial" type="uint" summary="serial of the ping event"/>
+ </request>
</interface>
<interface name="xdg_surface" version="1">
@@ -176,22 +198,6 @@
<arg name="app_id" type="string"/>
</request>
- <request name="pong">
- <description summary="respond to a ping event">
- A client must respond to a ping event with a pong request or
- the client may be deemed unresponsive.
- </description>
- <arg name="serial" type="uint" summary="serial of the ping event"/>
- </request>
-
- <event name="ping">
- <description summary="ping client">
- Ping a client to check if it is receiving events and sending
- requests. A client is expected to reply with a pong request.
- </description>
- <arg name="serial" type="uint"/>
- </event>
-
<request name="move">
<description summary="start an interactive move">
Start a pointer-driven move of the surface.
@@ -447,22 +453,6 @@
</description>
</request>
- <request name="pong">
- <description summary="respond to a ping event">
- A client must respond to a ping event with a pong request or
- the client may be deemed unresponsive.
- </description>
- <arg name="serial" type="uint" summary="serial of the ping event"/>
- </request>
-
- <event name="ping">
- <description summary="ping client">
- Ping a client to check if it is receiving events and sending
- requests. A client is expected to reply with a pong request.
- </description>
- <arg name="serial" type="uint"/>
- </event>
-
<event name="popup_done">
<description summary="popup interaction is done">
The popup_done event is sent out when a popup grab is broken,
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]