[gtk/wip/matthiasc/popup2] gtk: Stop using gtk_device_get_surface_at_position
- From: Matthias Clasen <matthiasc src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk/wip/matthiasc/popup2] gtk: Stop using gtk_device_get_surface_at_position
- Date: Tue, 26 Mar 2019 00:45:45 +0000 (UTC)
commit e71e593bb99151420c45b5c4f5451d4955f87e3d
Author: Matthias Clasen <mclasen redhat com>
Date: Mon Mar 25 20:37:13 2019 -0400
gtk: Stop using gtk_device_get_surface_at_position
We should always use the double variant of the api.
demos/gtk-demo/changedisplay.c | 2 +-
gtk/gtktooltip.c | 6 +++---
gtk/inspector/inspect-button.c | 2 +-
3 files changed, 5 insertions(+), 5 deletions(-)
---
diff --git a/demos/gtk-demo/changedisplay.c b/demos/gtk-demo/changedisplay.c
index 5f5717c43d..0a963fe157 100644
--- a/demos/gtk-demo/changedisplay.c
+++ b/demos/gtk-demo/changedisplay.c
@@ -71,7 +71,7 @@ find_toplevel_at_pointer (GdkDisplay *display)
GdkSurface *pointer_window;
GtkWidget *widget = NULL;
- pointer_window = gdk_device_get_surface_at_position (gtk_get_current_event_device (), NULL, NULL);
+ pointer_window = gdk_device_get_surface_at_position_double (gtk_get_current_event_device (), NULL, NULL);
if (pointer_window)
widget = GTK_WIDGET (gtk_root_get_for_surface (pointer_window));
diff --git a/gtk/gtktooltip.c b/gtk/gtktooltip.c
index 5337726985..15de828dc4 100644
--- a/gtk/gtktooltip.c
+++ b/gtk/gtktooltip.c
@@ -382,7 +382,7 @@ void
gtk_tooltip_trigger_tooltip_query (GtkWidget *widget)
{
GdkDisplay *display;
- gint x, y;
+ double x, y;
GdkSurface *surface;
GdkDevice *device;
GtkWidget *toplevel;
@@ -394,7 +394,7 @@ gtk_tooltip_trigger_tooltip_query (GtkWidget *widget)
/* Trigger logic as if the mouse moved */
device = gdk_seat_get_pointer (gdk_display_get_default_seat (display));
- surface = gdk_device_get_surface_at_position (device, &x, &y);
+ surface = gdk_device_get_surface_at_position_double (device, &x, &y);
if (!surface)
return;
@@ -403,7 +403,7 @@ gtk_tooltip_trigger_tooltip_query (GtkWidget *widget)
if (gtk_widget_get_surface (toplevel) != surface)
return;
- gtk_widget_translate_coordinates (toplevel, widget, x, y, &dx, &dy);
+ gtk_widget_translate_coordinates (toplevel, widget, round (x), round (y), &dx, &dy);
gtk_tooltip_handle_event_internal (GDK_MOTION_NOTIFY, surface, widget, dx, dy);
}
diff --git a/gtk/inspector/inspect-button.c b/gtk/inspector/inspect-button.c
index 76e52f4df1..83867b8b8d 100644
--- a/gtk/inspector/inspect-button.c
+++ b/gtk/inspector/inspect-button.c
@@ -43,7 +43,7 @@ find_widget_at_pointer (GdkDevice *device)
GtkWidget *widget = NULL;
GdkSurface *pointer_surface;
- pointer_surface = gdk_device_get_surface_at_position (device, NULL, NULL);
+ pointer_surface = gdk_device_get_surface_at_position_double (device, NULL, NULL);
if (pointer_surface)
widget = gtk_root_get_for_surface (pointer_surface);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]