[gtk/wip/chergert/remove-get_toplevel] device: remove get_toplevel from surface_at_position vfunc
- From: Christian Hergert <chergert src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk/wip/chergert/remove-get_toplevel] device: remove get_toplevel from surface_at_position vfunc
- Date: Tue, 19 May 2020 19:01:57 +0000 (UTC)
commit 7d0416bbec00fe563db10c8994277b2c2fcd0b96
Author: Christian Hergert <chergert redhat com>
Date: Tue May 19 12:00:32 2020 -0700
device: remove get_toplevel from surface_at_position vfunc
This is not used anymore now that surfaces are always toplevel in the
semantics of GdkWindow where child windows were available. We can drop
that and simplify the vfunc just a bit more.
Fixes #2765
gdk/broadway/gdkdevice-broadway.c | 6 ++----
gdk/gdkdevice.c | 18 ++++++++----------
gdk/gdkdeviceprivate.h | 6 ++----
gdk/gdkdisplay.c | 2 +-
gdk/wayland/gdkdevice-wayland.c | 7 +++----
gdk/win32/gdkdevice-win32.c | 7 +++----
gdk/win32/gdkdevice-win32.h | 7 +++----
gdk/win32/gdkdevice-wintab.c | 7 +++----
gdk/x11/gdkdevice-xi2.c | 16 +++++++---------
9 files changed, 32 insertions(+), 44 deletions(-)
---
diff --git a/gdk/broadway/gdkdevice-broadway.c b/gdk/broadway/gdkdevice-broadway.c
index 837b48b4f0..a936d36d36 100644
--- a/gdk/broadway/gdkdevice-broadway.c
+++ b/gdk/broadway/gdkdevice-broadway.c
@@ -54,8 +54,7 @@ static void gdk_broadway_device_ungrab (GdkDevice *device,
static GdkSurface * gdk_broadway_device_surface_at_position (GdkDevice *device,
gdouble *win_x,
gdouble *win_y,
- GdkModifierType *mask,
- gboolean get_toplevel);
+ GdkModifierType *mask);
G_DEFINE_TYPE (GdkBroadwayDevice, gdk_broadway_device, GDK_TYPE_DEVICE)
@@ -292,8 +291,7 @@ static GdkSurface *
gdk_broadway_device_surface_at_position (GdkDevice *device,
gdouble *win_x,
gdouble *win_y,
- GdkModifierType *mask,
- gboolean get_toplevel)
+ GdkModifierType *mask)
{
GdkSurface *surface = NULL;
diff --git a/gdk/gdkdevice.c b/gdk/gdkdevice.c
index 907c53ce62..8918ee50a3 100644
--- a/gdk/gdkdevice.c
+++ b/gdk/gdkdevice.c
@@ -628,7 +628,7 @@ gdk_device_get_surface_at_position (GdkDevice *device,
g_return_val_if_fail (gdk_device_get_device_type (device) != GDK_DEVICE_TYPE_SLAVE ||
gdk_display_device_is_grabbed (gdk_device_get_display (device), device), NULL);
- surface = _gdk_device_surface_at_position (device, &tmp_x, &tmp_y, NULL, FALSE);
+ surface = _gdk_device_surface_at_position (device, &tmp_x, &tmp_y, NULL);
if (win_x)
*win_x = tmp_x;
@@ -1588,17 +1588,15 @@ _gdk_device_query_state (GdkDevice *device,
}
GdkSurface *
-_gdk_device_surface_at_position (GdkDevice *device,
- gdouble *win_x,
- gdouble *win_y,
- GdkModifierType *mask,
- gboolean get_toplevel)
+_gdk_device_surface_at_position (GdkDevice *device,
+ gdouble *win_x,
+ gdouble *win_y,
+ GdkModifierType *mask)
{
return GDK_DEVICE_GET_CLASS (device)->surface_at_position (device,
- win_x,
- win_y,
- mask,
- get_toplevel);
+ win_x,
+ win_y,
+ mask);
}
/**
diff --git a/gdk/gdkdeviceprivate.h b/gdk/gdkdeviceprivate.h
index ea6b3e1a55..55d4f0beef 100644
--- a/gdk/gdkdeviceprivate.h
+++ b/gdk/gdkdeviceprivate.h
@@ -105,8 +105,7 @@ struct _GdkDeviceClass
GdkSurface * (* surface_at_position) (GdkDevice *device,
double *win_x,
double *win_y,
- GdkModifierType *mask,
- gboolean get_toplevel);
+ GdkModifierType *mask);
};
void _gdk_device_set_associated_device (GdkDevice *device,
@@ -167,8 +166,7 @@ void _gdk_device_query_state (GdkDevice *device,
GdkSurface * _gdk_device_surface_at_position (GdkDevice *device,
gdouble *win_x,
gdouble *win_y,
- GdkModifierType *mask,
- gboolean get_toplevel);
+ GdkModifierType *mask);
void gdk_device_set_seat (GdkDevice *device,
GdkSeat *seat);
diff --git a/gdk/gdkdisplay.c b/gdk/gdkdisplay.c
index 0cbf1476c7..2babfacf65 100644
--- a/gdk/gdkdisplay.c
+++ b/gdk/gdkdisplay.c
@@ -589,7 +589,7 @@ get_current_toplevel (GdkDisplay *display,
gdouble x, y;
GdkModifierType state;
- pointer_surface = _gdk_device_surface_at_position (device, &x, &y, &state, TRUE);
+ pointer_surface = _gdk_device_surface_at_position (device, &x, &y, &state);
if (pointer_surface != NULL &&
GDK_SURFACE_DESTROYED (pointer_surface))
diff --git a/gdk/wayland/gdkdevice-wayland.c b/gdk/wayland/gdkdevice-wayland.c
index 65e556abee..c0708bc8af 100644
--- a/gdk/wayland/gdkdevice-wayland.c
+++ b/gdk/wayland/gdkdevice-wayland.c
@@ -802,10 +802,9 @@ gdk_wayland_device_ungrab (GdkDevice *device,
static GdkSurface *
gdk_wayland_device_surface_at_position (GdkDevice *device,
- gdouble *win_x,
- gdouble *win_y,
- GdkModifierType *mask,
- gboolean get_toplevel)
+ gdouble *win_x,
+ gdouble *win_y,
+ GdkModifierType *mask)
{
GdkWaylandPointerData *pointer;
diff --git a/gdk/win32/gdkdevice-win32.c b/gdk/win32/gdkdevice-win32.c
index dffb8d8c7d..07a1216960 100644
--- a/gdk/win32/gdkdevice-win32.c
+++ b/gdk/win32/gdkdevice-win32.c
@@ -177,10 +177,9 @@ screen_to_client (HWND hwnd, POINT screen_pt, POINT *client_pt)
GdkSurface *
_gdk_device_win32_surface_at_position (GdkDevice *device,
- gdouble *win_x,
- gdouble *win_y,
- GdkModifierType *mask,
- gboolean get_toplevel)
+ gdouble *win_x,
+ gdouble *win_y,
+ GdkModifierType *mask)
{
GdkSurface *window = NULL;
GdkWin32Surface *impl = NULL;
diff --git a/gdk/win32/gdkdevice-win32.h b/gdk/win32/gdkdevice-win32.h
index ff2c94ce5b..b59d775f99 100644
--- a/gdk/win32/gdkdevice-win32.h
+++ b/gdk/win32/gdkdevice-win32.h
@@ -45,10 +45,9 @@ struct _GdkDeviceWin32Class
GType gdk_device_win32_get_type (void) G_GNUC_CONST;
GdkSurface *_gdk_device_win32_surface_at_position (GdkDevice *device,
- gdouble *win_x,
- gdouble *win_y,
- GdkModifierType *mask,
- gboolean get_toplevel);
+ gdouble *win_x,
+ gdouble *win_y,
+ GdkModifierType *mask);
G_END_DECLS
diff --git a/gdk/win32/gdkdevice-wintab.c b/gdk/win32/gdkdevice-wintab.c
index 5aed3e053a..a05b56e2c4 100644
--- a/gdk/win32/gdkdevice-wintab.c
+++ b/gdk/win32/gdkdevice-wintab.c
@@ -188,10 +188,9 @@ gdk_device_wintab_ungrab (GdkDevice *device,
static GdkSurface *
gdk_device_wintab_surface_at_position (GdkDevice *device,
- gdouble *win_x,
- gdouble *win_y,
- GdkModifierType *mask,
- gboolean get_toplevel)
+ gdouble *win_x,
+ gdouble *win_y,
+ GdkModifierType *mask)
{
return NULL;
}
diff --git a/gdk/x11/gdkdevice-xi2.c b/gdk/x11/gdkdevice-xi2.c
index 8ec598f311..04cacfd9a2 100644
--- a/gdk/x11/gdkdevice-xi2.c
+++ b/gdk/x11/gdkdevice-xi2.c
@@ -95,10 +95,9 @@ static void gdk_x11_device_xi2_ungrab (GdkDevice *device,
guint32 time_);
static GdkSurface * gdk_x11_device_xi2_surface_at_position (GdkDevice *device,
- gdouble *win_x,
- gdouble *win_y,
- GdkModifierType *mask,
- gboolean get_toplevel);
+ gdouble *win_x,
+ gdouble *win_y,
+ GdkModifierType *mask);
enum {
@@ -448,10 +447,9 @@ gdk_x11_device_xi2_ungrab (GdkDevice *device,
static GdkSurface *
gdk_x11_device_xi2_surface_at_position (GdkDevice *device,
- gdouble *win_x,
- gdouble *win_y,
- GdkModifierType *mask,
- gboolean get_toplevel)
+ gdouble *win_x,
+ gdouble *win_y,
+ GdkModifierType *mask)
{
GdkX11Surface *impl;
GdkX11DeviceXI2 *device_xi2 = GDK_X11_DEVICE_XI2 (device);
@@ -587,7 +585,7 @@ gdk_x11_device_xi2_surface_at_position (GdkDevice *device,
if (!retval)
break;
- if (get_toplevel && last != root &&
+ if (last != root &&
(surface = gdk_x11_surface_lookup_for_display (display, last)) != NULL)
{
xwindow = last;
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]