[gtk/wip/carlosg/input-cleanups: 4/26] gdk: Drop supports_multidevice API
- From: Carlos Garnacho <carlosg src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk/wip/carlosg/input-cleanups: 4/26] gdk: Drop supports_multidevice API
- Date: Wed, 24 Jun 2020 18:36:49 +0000 (UTC)
commit 59a8106373ac59649a29f94edc67488226115e24
Author: Carlos Garnacho <carlosg gnome org>
Date: Mon Jun 22 23:34:34 2020 +0200
gdk: Drop supports_multidevice API
Crossing events are now detached from widget state, all tricky consequences
from getting multiple crossing events are now somewhat moot. Resort to sending
all generated crossing events, and drop this barely (ever?) used API.
docs/reference/gdk/gdk4-sections.txt | 2 --
docs/reference/gtk/gtk4-sections.txt | 2 --
gdk/gdksurface.c | 47 ---------------------------
gdk/gdksurface.h | 6 ----
gdk/gdksurfaceprivate.h | 1 -
gtk/gtkmain.c | 21 ++----------
gtk/gtkwidget.c | 62 ------------------------------------
gtk/gtkwidget.h | 8 -----
gtk/gtkwidgetprivate.h | 1 -
9 files changed, 2 insertions(+), 148 deletions(-)
---
diff --git a/docs/reference/gdk/gdk4-sections.txt b/docs/reference/gdk/gdk4-sections.txt
index 23af3ca51b..8b72b2ddb2 100644
--- a/docs/reference/gdk/gdk4-sections.txt
+++ b/docs/reference/gdk/gdk4-sections.txt
@@ -207,8 +207,6 @@ GdkModifierType
GDK_MODIFIER_MASK
<SUBSECTION>
-gdk_surface_get_support_multidevice
-gdk_surface_set_support_multidevice
gdk_surface_get_device_cursor
gdk_surface_set_device_cursor
diff --git a/docs/reference/gtk/gtk4-sections.txt b/docs/reference/gtk/gtk4-sections.txt
index 163a964973..36983f7864 100644
--- a/docs/reference/gtk/gtk4-sections.txt
+++ b/docs/reference/gtk/gtk4-sections.txt
@@ -4501,8 +4501,6 @@ gtk_widget_has_visible_focus
gtk_widget_is_drawable
gtk_widget_set_receives_default
gtk_widget_get_receives_default
-gtk_widget_set_support_multidevice
-gtk_widget_get_support_multidevice
gtk_widget_get_realized
gtk_widget_get_mapped
gtk_widget_device_is_shadowed
diff --git a/gdk/gdksurface.c b/gdk/gdksurface.c
index df2327951f..93662b8b63 100644
--- a/gdk/gdksurface.c
+++ b/gdk/gdksurface.c
@@ -2186,53 +2186,6 @@ gdk_surface_beep (GdkSurface *surface)
gdk_display_beep (surface->display);
}
-/**
- * gdk_surface_set_support_multidevice:
- * @surface: a #GdkSurface.
- * @support_multidevice: %TRUE to enable multidevice support in @surface.
- *
- * This function will enable multidevice features in @surface.
- *
- * Multidevice aware surfaces will need to handle properly multiple,
- * per device enter/leave events, device grabs and grab ownerships.
- **/
-void
-gdk_surface_set_support_multidevice (GdkSurface *surface,
- gboolean support_multidevice)
-{
- g_return_if_fail (GDK_IS_SURFACE (surface));
-
- if (GDK_SURFACE_DESTROYED (surface))
- return;
-
- if (surface->support_multidevice == support_multidevice)
- return;
-
- surface->support_multidevice = support_multidevice;
-
- /* FIXME: What to do if called when some pointers are inside the surface ? */
-}
-
-/**
- * gdk_surface_get_support_multidevice:
- * @surface: a #GdkSurface.
- *
- * Returns %TRUE if the surface is aware of the existence of multiple
- * devices.
- *
- * Returns: %TRUE if the surface handles multidevice features.
- **/
-gboolean
-gdk_surface_get_support_multidevice (GdkSurface *surface)
-{
- g_return_val_if_fail (GDK_IS_SURFACE (surface), FALSE);
-
- if (GDK_SURFACE_DESTROYED (surface))
- return FALSE;
-
- return surface->support_multidevice;
-}
-
void
_gdk_display_set_surface_under_pointer (GdkDisplay *display,
GdkDevice *device,
diff --git a/gdk/gdksurface.h b/gdk/gdksurface.h
index 09278a1d69..5b10920291 100644
--- a/gdk/gdksurface.h
+++ b/gdk/gdksurface.h
@@ -213,12 +213,6 @@ void gdk_surface_freeze_updates (GdkSurface *surface);
GDK_AVAILABLE_IN_ALL
void gdk_surface_thaw_updates (GdkSurface *surface);
-GDK_AVAILABLE_IN_ALL
-void gdk_surface_set_support_multidevice (GdkSurface *surface,
- gboolean support_multidevice);
-GDK_AVAILABLE_IN_ALL
-gboolean gdk_surface_get_support_multidevice (GdkSurface *surface);
-
GDK_AVAILABLE_IN_ALL
GdkFrameClock* gdk_surface_get_frame_clock (GdkSurface *surface);
diff --git a/gdk/gdksurfaceprivate.h b/gdk/gdksurfaceprivate.h
index e93fe4f625..2aa1828a35 100644
--- a/gdk/gdksurfaceprivate.h
+++ b/gdk/gdksurfaceprivate.h
@@ -70,7 +70,6 @@ struct _GdkSurface
guint destroyed : 2;
- guint support_multidevice : 1;
guint in_update : 1;
guint frame_clock_events_paused : 1;
guint autohide : 1;
diff --git a/gtk/gtkmain.c b/gtk/gtkmain.c
index fd43c9eb77..1f85565361 100644
--- a/gtk/gtkmain.c
+++ b/gtk/gtkmain.c
@@ -1885,32 +1885,15 @@ synth_crossing_for_grab_notify (GtkWidget *from,
GdkDevice *device = devices[i];
GdkSurface *from_surface, *to_surface;
- /* Do not propagate events more than once to
- * the same surfaces if non-multidevice aware.
- */
if (!from)
from_surface = NULL;
else
- {
- from_surface = _gtk_widget_get_device_surface (from, device);
-
- if (from_surface &&
- !gdk_surface_get_support_multidevice (from_surface) &&
- g_list_find (info->notified_surfaces, from_surface))
- from_surface = NULL;
- }
+ from_surface = _gtk_widget_get_device_surface (from, device);
if (!to)
to_surface = NULL;
else
- {
- to_surface = _gtk_widget_get_device_surface (to, device);
-
- if (to_surface &&
- !gdk_surface_get_support_multidevice (to_surface) &&
- g_list_find (info->notified_surfaces, to_surface))
- to_surface = NULL;
- }
+ to_surface = _gtk_widget_get_device_surface (to, device);
if (from_surface || to_surface)
{
diff --git a/gtk/gtkwidget.c b/gtk/gtkwidget.c
index 8cb6a6c2f3..ffe6a0dc28 100644
--- a/gtk/gtkwidget.c
+++ b/gtk/gtkwidget.c
@@ -3355,13 +3355,6 @@ gtk_widget_realize (GtkWidget *widget)
g_signal_emit (widget, widget_signals[REALIZE], 0);
- if (priv->multidevice)
- {
- GdkSurface *surface = gtk_widget_get_surface (widget);
-
- gdk_surface_set_support_multidevice (surface, TRUE);
- }
-
if (priv->context)
gtk_style_context_set_scale (priv->context, gtk_widget_get_scale_factor (widget));
else
@@ -7746,13 +7739,6 @@ gtk_widget_propagate_state (GtkWidget *widget,
device = devices[i];
surface = _gtk_widget_get_device_surface (widget, device);
- /* Do not propagate more than once to the
- * same surface if non-multidevice aware.
- */
- if (!gdk_surface_get_support_multidevice (surface) &&
- g_list_find (event_surfaces, surface))
- continue;
-
if (!gtk_widget_is_sensitive (widget))
_gtk_widget_synthesize_crossing (widget, NULL, device,
GDK_CROSSING_STATE_CHANGED);
@@ -10220,54 +10206,6 @@ gtk_widget_get_allocated_baseline (GtkWidget *widget)
return priv->baseline - margin.top - border.top - padding.top;
}
-/**
- * gtk_widget_get_support_multidevice:
- * @widget: a #GtkWidget
- *
- * Returns %TRUE if @widget is multiple pointer aware. See
- * gtk_widget_set_support_multidevice() for more information.
- *
- * Returns: %TRUE if @widget is multidevice aware.
- **/
-gboolean
-gtk_widget_get_support_multidevice (GtkWidget *widget)
-{
- GtkWidgetPrivate *priv = gtk_widget_get_instance_private (widget);
-
- g_return_val_if_fail (GTK_IS_WIDGET (widget), FALSE);
-
- return priv->multidevice;
-}
-
-/**
- * gtk_widget_set_support_multidevice:
- * @widget: a #GtkWidget
- * @support_multidevice: %TRUE to support input from multiple devices.
- *
- * Enables or disables multiple pointer awareness. If this setting is %TRUE,
- * @widget will start receiving multiple, per device enter/leave events. Note
- * that if custom #GdkSurfaces are created in #GtkWidget::realize,
- * gdk_surface_set_support_multidevice() will have to be called manually on them.
- **/
-void
-gtk_widget_set_support_multidevice (GtkWidget *widget,
- gboolean support_multidevice)
-{
- GtkWidgetPrivate *priv = gtk_widget_get_instance_private (widget);
-
- g_return_if_fail (GTK_IS_WIDGET (widget));
-
- priv->multidevice = (support_multidevice == TRUE);
-
- if (_gtk_widget_get_realized (widget))
- {
- GdkSurface *surface = gtk_widget_get_surface (widget);
-
- if (surface)
- gdk_surface_set_support_multidevice (surface, support_multidevice);
- }
-}
-
/**
* gtk_widget_set_opacity:
* @widget: a #GtkWidget
diff --git a/gtk/gtkwidget.h b/gtk/gtkwidget.h
index 06e829d62b..6a1e52f6b7 100644
--- a/gtk/gtkwidget.h
+++ b/gtk/gtkwidget.h
@@ -596,14 +596,6 @@ GDK_AVAILABLE_IN_ALL
gboolean gtk_widget_compute_expand (GtkWidget *widget,
GtkOrientation orientation);
-
-/* Multidevice support */
-GDK_AVAILABLE_IN_ALL
-gboolean gtk_widget_get_support_multidevice (GtkWidget *widget);
-GDK_AVAILABLE_IN_ALL
-void gtk_widget_set_support_multidevice (GtkWidget *widget,
- gboolean support_multidevice);
-
/* Accessibility support */
GDK_AVAILABLE_IN_ALL
void gtk_widget_class_set_accessible_type (GtkWidgetClass *widget_class,
diff --git a/gtk/gtkwidgetprivate.h b/gtk/gtkwidgetprivate.h
index d281dd0f43..b93ca063e6 100644
--- a/gtk/gtkwidgetprivate.h
+++ b/gtk/gtkwidgetprivate.h
@@ -84,7 +84,6 @@ struct _GtkWidgetPrivate
guint has_grab : 1;
guint shadowed : 1;
guint child_visible : 1;
- guint multidevice : 1;
guint can_target : 1;
/* Queue-resize related flags */
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]