[gtk+/wip/carlosg/event-delivery: 248/261] gtkwidget: Add private set_pass_through() call
- From: Carlos Garnacho <carlosg src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk+/wip/carlosg/event-delivery: 248/261] gtkwidget: Add private set_pass_through() call
- Date: Mon, 8 May 2017 21:05:30 +0000 (UTC)
commit 44d1c1d0bc165a18bb1911cac05caa3d445524f2
Author: Carlos Garnacho <carlosg gnome org>
Date: Thu Apr 6 13:55:35 2017 +0200
gtkwidget: Add private set_pass_through() call
We could eventually support pointer-event in CSS here, in the mean
time add this call to replace the GdkWindow API.
gtk/gtkmain.c | 3 ++-
gtk/gtkwidget.c | 13 +++++++++++++
gtk/gtkwidgetprivate.h | 4 ++++
3 files changed, 19 insertions(+), 1 deletions(-)
---
diff --git a/gtk/gtkmain.c b/gtk/gtkmain.c
index bc26057..55e1ceb 100644
--- a/gtk/gtkmain.c
+++ b/gtk/gtkmain.c
@@ -2586,7 +2586,8 @@ _gtk_toplevel_pick (GtkWindow *toplevel,
{
gdouble tx = x, ty = y;
- if (!gtk_widget_is_sensitive (child) ||
+ if (gtk_widget_get_pass_through (child) ||
+ !gtk_widget_is_sensitive (child) ||
!gtk_widget_is_drawable (child))
continue;
diff --git a/gtk/gtkwidget.c b/gtk/gtkwidget.c
index dd4c1a2..0a9a6a9 100644
--- a/gtk/gtkwidget.c
+++ b/gtk/gtkwidget.c
@@ -15612,3 +15612,16 @@ gtk_widget_get_cursor (GtkWidget *widget)
{
return widget->priv->cursor;
}
+
+void
+gtk_widget_set_pass_through (GtkWidget *widget,
+ gboolean pass_through)
+{
+ widget->priv->pass_through = !!pass_through;
+}
+
+gboolean
+gtk_widget_get_pass_through (GtkWidget *widget)
+{
+ return widget->priv->pass_through;
+}
diff --git a/gtk/gtkwidgetprivate.h b/gtk/gtkwidgetprivate.h
index 422969a..8763278 100644
--- a/gtk/gtkwidgetprivate.h
+++ b/gtk/gtkwidgetprivate.h
@@ -70,6 +70,7 @@ struct _GtkWidgetPrivate
guint child_visible : 1;
guint multidevice : 1;
guint has_shape_mask : 1;
+ guint pass_through : 1;
/* Queue-resize related flags */
guint resize_needed : 1; /* queue_resize() has been called but no get_preferred_size() yet */
@@ -323,6 +324,9 @@ void gtk_widget_set_cursor (GtkWidget *widget,
GdkCursor *cursor);
GdkCursor * gtk_widget_get_cursor (GtkWidget *widget);
+void gtk_widget_set_pass_through (GtkWidget *widget,
+ gboolean pass_through);
+gboolean gtk_widget_get_pass_through (GtkWidget *widget);
/* inline getters */
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]