summaryrefslogtreecommitdiff
path: root/Source/3rdParty/SDL2/src/video/wayland/SDL_waylandvideo.c
diff options
context:
space:
mode:
authorchai <chaifix@163.com>2019-01-31 18:38:35 +0800
committerchai <chaifix@163.com>2019-01-31 18:38:35 +0800
commit2ec55fd974a63b705a4777c256d2222c874fa043 (patch)
tree48f1fea59ee9fc713a28a9aac3f05b98dc5ae66f /Source/3rdParty/SDL2/src/video/wayland/SDL_waylandvideo.c
parentc581dfbf1e849f393861d15e82aa6446c0c1c310 (diff)
*SDL project
Diffstat (limited to 'Source/3rdParty/SDL2/src/video/wayland/SDL_waylandvideo.c')
-rw-r--r--Source/3rdParty/SDL2/src/video/wayland/SDL_waylandvideo.c26
1 files changed, 22 insertions, 4 deletions
diff --git a/Source/3rdParty/SDL2/src/video/wayland/SDL_waylandvideo.c b/Source/3rdParty/SDL2/src/video/wayland/SDL_waylandvideo.c
index 8401a08..b6155e7 100644
--- a/Source/3rdParty/SDL2/src/video/wayland/SDL_waylandvideo.c
+++ b/Source/3rdParty/SDL2/src/video/wayland/SDL_waylandvideo.c
@@ -45,6 +45,7 @@
#include "SDL_waylanddyn.h"
#include <wayland-util.h>
+#include "xdg-shell-client-protocol.h"
#include "xdg-shell-unstable-v6-client-protocol.h"
#define WAYLANDVID_DRIVER_NAME "wayland"
@@ -67,10 +68,10 @@ static char *
get_classname()
{
/* !!! FIXME: this is probably wrong, albeit harmless in many common cases. From protocol spec:
- "The surface class identifies the general class of applications
- to which the surface belongs. A common convention is to use the
- file name (or the full path if it is a non-standard location) of
- the application's .desktop file as the class." */
+ "The surface class identifies the general class of applications
+ to which the surface belongs. A common convention is to use the
+ file name (or the full path if it is a non-standard location) of
+ the application's .desktop file as the class." */
char *spot;
#if defined(__LINUX__) || defined(__FREEBSD__)
@@ -328,6 +329,17 @@ static const struct zxdg_shell_v6_listener shell_listener_zxdg = {
static void
+handle_ping_xdg_wm_base(void *data, struct xdg_wm_base *xdg, uint32_t serial)
+{
+ xdg_wm_base_pong(xdg, serial);
+}
+
+static const struct xdg_wm_base_listener shell_listener_xdg = {
+ handle_ping_xdg_wm_base
+};
+
+
+static void
display_handle_global(void *data, struct wl_registry *registry, uint32_t id,
const char *interface, uint32_t version)
{
@@ -339,6 +351,9 @@ display_handle_global(void *data, struct wl_registry *registry, uint32_t id,
Wayland_add_display(d, id);
} else if (strcmp(interface, "wl_seat") == 0) {
Wayland_display_add_input(d, id);
+ } else if (strcmp(interface, "xdg_wm_base") == 0) {
+ d->shell.xdg = wl_registry_bind(d->registry, id, &xdg_wm_base_interface, 1);
+ xdg_wm_base_add_listener(d->shell.xdg, &shell_listener_xdg, NULL);
} else if (strcmp(interface, "zxdg_shell_v6") == 0) {
d->shell.zxdg = wl_registry_bind(d->registry, id, &zxdg_shell_v6_interface, 1);
zxdg_shell_v6_add_listener(d->shell.zxdg, &shell_listener_zxdg, NULL);
@@ -475,6 +490,9 @@ Wayland_VideoQuit(_THIS)
if (data->shell.wl)
wl_shell_destroy(data->shell.wl);
+ if (data->shell.xdg)
+ xdg_wm_base_destroy(data->shell.xdg);
+
if (data->shell.zxdg)
zxdg_shell_v6_destroy(data->shell.zxdg);