summaryrefslogtreecommitdiff
path: root/gdk
diff options
context:
space:
mode:
authorBenjamin Otte <otte@redhat.com>2023-04-01 01:57:25 +0200
committerBenjamin Otte <otte@redhat.com>2023-04-01 02:22:21 +0200
commit9d99259cbdb11d6697b5126a0c0a518616abf2bc (patch)
tree77c6b13b753350d72c809b34ab33facfbd61c041 /gdk
parent55b5c847f7efcc8d3de3088999aa47fd7386c0f2 (diff)
downloadgtk+-9d99259cbdb11d6697b5126a0c0a518616abf2bc.tar.gz
wayland: Use wl_data_device_manager_get_version()
Diffstat (limited to 'gdk')
-rw-r--r--gdk/wayland/gdkdisplay-wayland.c3
-rw-r--r--gdk/wayland/gdkdisplay-wayland.h1
-rw-r--r--gdk/wayland/gdkdrag-wayland.c2
-rw-r--r--gdk/wayland/gdkdrop-wayland.c5
4 files changed, 4 insertions, 7 deletions
diff --git a/gdk/wayland/gdkdisplay-wayland.c b/gdk/wayland/gdkdisplay-wayland.c
index 36474c39da..f20f84ad0f 100644
--- a/gdk/wayland/gdkdisplay-wayland.c
+++ b/gdk/wayland/gdkdisplay-wayland.c
@@ -422,10 +422,9 @@ gdk_registry_handle_global (void *data,
}
else if (strcmp (interface, "wl_data_device_manager") == 0)
{
- display_wayland->data_device_manager_version = MIN (version, 3);
display_wayland->data_device_manager =
wl_registry_bind (display_wayland->wl_registry, id, &wl_data_device_manager_interface,
- display_wayland->data_device_manager_version);
+ MIN (version, 3));
}
else if (strcmp (interface, "wl_subcompositor") == 0)
{
diff --git a/gdk/wayland/gdkdisplay-wayland.h b/gdk/wayland/gdkdisplay-wayland.h
index 80a3ef503c..78fe1fbee4 100644
--- a/gdk/wayland/gdkdisplay-wayland.h
+++ b/gdk/wayland/gdkdisplay-wayland.h
@@ -134,7 +134,6 @@ struct _GdkWaylandDisplay
GSource *event_source;
int seat_version;
- int data_device_manager_version;
int gtk_shell_version;
int pointer_gestures_version;
diff --git a/gdk/wayland/gdkdrag-wayland.c b/gdk/wayland/gdkdrag-wayland.c
index 4af9d65e88..a9a618b5c6 100644
--- a/gdk/wayland/gdkdrag-wayland.c
+++ b/gdk/wayland/gdkdrag-wayland.c
@@ -387,7 +387,7 @@ _gdk_wayland_surface_drag_begin (GdkSurface *surface,
gdk_wayland_drag_create_data_source (drag);
- if (GDK_WAYLAND_DISPLAY (display)->data_device_manager_version >= WL_DATA_SOURCE_SET_ACTIONS_SINCE_VERSION)
+ if (wl_data_device_manager_get_version (GDK_WAYLAND_DISPLAY (display)->data_device_manager) >= WL_DATA_SOURCE_SET_ACTIONS_SINCE_VERSION)
wl_data_source_set_actions (drag_wayland->data_source, gdk_to_wl_actions (actions));
gdk_wayland_seat_set_drag (seat, drag);
diff --git a/gdk/wayland/gdkdrop-wayland.c b/gdk/wayland/gdkdrop-wayland.c
index 10b6271cdd..b85cf3683b 100644
--- a/gdk/wayland/gdkdrop-wayland.c
+++ b/gdk/wayland/gdkdrop-wayland.c
@@ -128,7 +128,7 @@ gdk_wayland_drop_commit_status (GdkWaylandDrop *wayland_drop,
display = gdk_drop_get_display (GDK_DROP (wayland_drop));
- if (GDK_WAYLAND_DISPLAY (display)->data_device_manager_version >=
+ if (wl_data_device_manager_get_version (GDK_WAYLAND_DISPLAY (display)->data_device_manager) >=
WL_DATA_OFFER_SET_ACTIONS_SINCE_VERSION)
{
uint32_t dnd_actions;
@@ -159,13 +159,12 @@ gdk_wayland_drop_finish (GdkDrop *drop,
{
GdkWaylandDrop *wayland_drop = GDK_WAYLAND_DROP (drop);
GdkDisplay *display = gdk_drop_get_display (drop);
- GdkWaylandDisplay *display_wayland = GDK_WAYLAND_DISPLAY (display);
if (action)
{
gdk_wayland_drop_commit_status (wayland_drop, action, action);
- if (display_wayland->data_device_manager_version >=
+ if (wl_data_device_manager_get_version (GDK_WAYLAND_DISPLAY (display)->data_device_manager) >=
WL_DATA_OFFER_FINISH_SINCE_VERSION)
wl_data_offer_finish (wayland_drop->offer);
}