[gtk/wip/synthetic-motion2: 15/30] wayland: Stop using the query_state vfunc




commit e760d4a5bd04c7417fbf634e0a07a30af54eab5b
Author: Matthias Clasen <mclasen redhat com>
Date:   Wed Aug 26 16:04:25 2020 -0400

    wayland: Stop using the query_state vfunc
    
    Just call the backend implementation directly.

 gdk/wayland/gdkdevice-wayland-private.h | 14 ++++++++++++++
 gdk/wayland/gdkdevice-wayland.c         |  4 ++--
 gdk/wayland/gdksurface-wayland.c        |  5 ++---
 3 files changed, 18 insertions(+), 5 deletions(-)
---
diff --git a/gdk/wayland/gdkdevice-wayland-private.h b/gdk/wayland/gdkdevice-wayland-private.h
new file mode 100644
index 0000000000..a1942fbe38
--- /dev/null
+++ b/gdk/wayland/gdkdevice-wayland-private.h
@@ -0,0 +1,14 @@
+#ifndef __GDK_DEVICE_WAYLAND_PRIVATE_H__
+#define __GDK_DEVICE_WAYLAND_PRIVATE_H__
+
+#include "gdkwaylanddevice.h"
+
+void
+gdk_wayland_device_query_state (GdkDevice        *device,
+                                GdkSurface       *surface,
+                                GdkSurface      **child_surface,
+                                double           *win_x,
+                                double           *win_y,
+                                GdkModifierType  *mask);
+
+#endif
diff --git a/gdk/wayland/gdkdevice-wayland.c b/gdk/wayland/gdkdevice-wayland.c
index 4436269217..f55a593ba4 100644
--- a/gdk/wayland/gdkdevice-wayland.c
+++ b/gdk/wayland/gdkdevice-wayland.c
@@ -35,6 +35,7 @@
 #include "gdkdeviceprivate.h"
 #include "gdkdevicepadprivate.h"
 #include "gdkdevicetoolprivate.h"
+#include "gdkdevice-wayland-private.h"
 #include "gdkdropprivate.h"
 #include "gdkprimary-wayland.h"
 #include "gdkseatprivate.h"
@@ -517,7 +518,7 @@ device_get_modifiers (GdkDevice *device)
   return mask;
 }
 
-static void
+void
 gdk_wayland_device_query_state (GdkDevice        *device,
                                 GdkSurface       *surface,
                                 GdkSurface      **child_surface,
@@ -796,7 +797,6 @@ gdk_wayland_device_class_init (GdkWaylandDeviceClass *klass)
   GdkDeviceClass *device_class = GDK_DEVICE_CLASS (klass);
 
   device_class->set_surface_cursor = gdk_wayland_device_set_surface_cursor;
-  device_class->query_state = gdk_wayland_device_query_state;
   device_class->grab = gdk_wayland_device_grab;
   device_class->ungrab = gdk_wayland_device_ungrab;
   device_class->surface_at_position = gdk_wayland_device_surface_at_position;
diff --git a/gdk/wayland/gdksurface-wayland.c b/gdk/wayland/gdksurface-wayland.c
index a444a4ee44..b6ff57a5b0 100644
--- a/gdk/wayland/gdksurface-wayland.c
+++ b/gdk/wayland/gdksurface-wayland.c
@@ -36,6 +36,7 @@
 #include "gdkseat-wayland.h"
 #include "gdksurfaceprivate.h"
 #include "gdktoplevelprivate.h"
+#include "gdkdevice-wayland-private.h"
 
 #include <wayland/xdg-shell-unstable-v6-client-protocol.h>
 
@@ -3179,9 +3180,7 @@ gdk_wayland_surface_get_device_state (GdkSurface       *surface,
     {
       GdkSurface *child;
 
-      GDK_DEVICE_GET_CLASS (device)->query_state (device, surface,
-                                                  &child,
-                                                  x, y, mask);
+      gdk_wayland_device_query_state (device, surface, &child, x, y, mask);
       return_val = (child != NULL);
     }
 


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]