summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAntónio Fernandes <antoniof@gnome.org>2021-08-05 20:16:45 +0100
committerAntónio Fernandes <antoniojpfernandes@gmail.com>2021-12-22 01:38:47 +0000
commit79c4d849d4086d9d85ef27d05cb97aa1027cc09f (patch)
treed2995765a9ea4cd89b00f2b476038ce3866159c0
parent48c083e909a13a85f16e1c776ec225b73a0fadea (diff)
downloadnautilus-79c4d849d4086d9d85ef27d05cb97aa1027cc09f.tar.gz
floating-bar: Don't use gdk_window_get_position()
It's gone in GTK4. Instead, translate to parent widget coordinates, which is the same coordinate system we get from the event controller.
-rw-r--r--src/nautilus-floating-bar.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/nautilus-floating-bar.c b/src/nautilus-floating-bar.c
index 8f6393cf8..bd148eea3 100644
--- a/src/nautilus-floating-bar.c
+++ b/src/nautilus-floating-bar.c
@@ -244,6 +244,7 @@ on_event_controller_motion_enter (GtkEventControllerMotion *controller,
gpointer user_data)
{
NautilusFloatingBar *self = NAUTILUS_FLOATING_BAR (user_data);
+ GtkWidget *parent;
CheckPointerData *data;
gint y_pos;
@@ -254,7 +255,9 @@ on_event_controller_motion_enter (GtkEventControllerMotion *controller,
return;
}
- gdk_window_get_position (gtk_widget_get_window (GTK_WIDGET (self)), NULL, &y_pos);
+ parent = gtk_event_controller_get_widget (GTK_EVENT_CONTROLLER (controller));
+ gtk_widget_translate_coordinates (GTK_WIDGET (self), parent, 0, 0, NULL, &y_pos);
+
if (y < y_pos)
{
return;