From 9cd2e9ec8fc0127393dfce9c0359d500c8c238be Mon Sep 17 00:00:00 2001
From: Edward Rudd <urkle@outoforder.cc>
Date: Tue, 09 Apr 2019 02:22:50 +0000
Subject: [PATCH] updae source to 2.0.9 source

---
 source/src/video/wayland/SDL_waylandvideo.c |   26 ++++++++++++++++++++++----
 1 files changed, 22 insertions(+), 4 deletions(-)

diff --git a/source/src/video/wayland/SDL_waylandvideo.c b/source/src/video/wayland/SDL_waylandvideo.c
index 8401a08..b6155e7 100644
--- a/source/src/video/wayland/SDL_waylandvideo.c
+++ b/source/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 @@
 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 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 @@
         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 @@
     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);
 

--
Gitblit v1.9.3