[gtk/wip/baedert/transforms6: 6/31] inspect-button: Remove custom pick() implementation
- From: Timm Bäder <baedert src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk/wip/baedert/transforms6: 6/31] inspect-button: Remove custom pick() implementation
- Date: Thu, 29 Nov 2018 08:08:54 +0000 (UTC)
commit 7c020bfaaa95e903b4c4a0ddbaa8aa37e85dfda6
Author: Timm Bäder <mail baedert org>
Date: Sun Aug 12 13:30:15 2018 +0200
inspect-button: Remove custom pick() implementation
This was added to work around the fact that pick() does not look at
insensitive widgets at all, but the replacement didn't properly work
either.
gtk/inspector/inspect-button.c | 45 +-----------------------------------------
1 file changed, 1 insertion(+), 44 deletions(-)
---
diff --git a/gtk/inspector/inspect-button.c b/gtk/inspector/inspect-button.c
index 2ce9ca2d02..489acb3286 100644
--- a/gtk/inspector/inspect-button.c
+++ b/gtk/inspector/inspect-button.c
@@ -37,49 +37,6 @@
#include "gtkeventcontrollermotion.h"
#include "gtkeventcontrollerkey.h"
-static gboolean
-inspector_contains (GtkWidget *widget,
- double x,
- double y)
-{
- g_return_val_if_fail (GTK_IS_WIDGET (widget), FALSE);
-
- if (!gtk_widget_is_drawable (widget))
- return FALSE;
-
- return GTK_WIDGET_GET_CLASS (widget)->contains (widget, x, y);
-}
-
-static GtkWidget *
-inspector_pick (GtkWidget *widget,
- double x,
- double y)
-{
- /* Like gtk_widget_pick and gtk_widget_contains,
- * but we need to consider insensitive widgets as well. */
- GtkWidget *child;
-
- for (child = _gtk_widget_get_last_child (widget);
- child;
- child = _gtk_widget_get_prev_sibling (child))
- {
- GtkWidget *picked;
- int dx, dy;
-
- gtk_widget_get_origin_relative_to_parent (child, &dx, &dy);
-
- picked = GTK_WIDGET_GET_CLASS (child)->pick (child, x - dx, y - dy);
- if (picked)
- return picked;
- }
-
-
- if (!inspector_contains (widget, x, y))
- return NULL;
-
- return widget;
-}
-
static GtkWidget *
find_widget_at_pointer (GdkDevice *device)
{
@@ -122,7 +79,7 @@ find_widget_at_pointer (GdkDevice *device)
gdk_surface_get_device_position_double (gtk_widget_get_surface (widget),
device, &x, &y, NULL);
- widget = inspector_pick (widget, x, y);
+ widget = gtk_widget_pick (widget, x, y);
}
return widget;
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]