[nautilus/wip/antoniof/gtk4-preparation-step-event-controllers: 4/29] floating-bar: Don't use gdk_window_get_position()
- From: António Fernandes <antoniof src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [nautilus/wip/antoniof/gtk4-preparation-step-event-controllers: 4/29] floating-bar: Don't use gdk_window_get_position()
- Date: Tue, 14 Dec 2021 02:43:14 +0000 (UTC)
commit 5f5e805ead543552c543b6f6b74da06f63a389de
Author: António Fernandes <antoniof gnome org>
Date: Thu Aug 5 20:16:45 2021 +0100
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.
src/nautilus-floating-bar.c | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
---
diff --git a/src/nautilus-floating-bar.c b/src/nautilus-floating-bar.c
index 662c808c9..21106eab9 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;
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]