stop using gtk_widget_get_pointer()
authorGuillaume Desmottes <guillaume.desmottes@collabora.co.uk>
Thu, 10 Nov 2011 09:23:08 +0000 (10:23 +0100)
committerGuillaume Desmottes <guillaume.desmottes@collabora.co.uk>
Fri, 11 Nov 2011 08:29:44 +0000 (09:29 +0100)
It has been deprecated. I asked on #gtk+ and that seems to be the right way to
do this. See
http://git.gnome.org/browse/gtk+/commit/?id=2783158f8d9ca69e5a8fc4a903bfbcc3871a1b02

All these APIs are available since GTK+ 3.0 so we're good.

https://bugzilla.gnome.org/show_bug.cgi?id=662903

libempathy-gtk/empathy-chat-text-view.c
libempathy-gtk/empathy-chat.c

index f52ad28d5a6f073781b14b2f5410e20fe7db7d9a..c251f1f423d560ff2f1ba2fc7212f0764ea3c7f8 100644 (file)
@@ -286,7 +286,9 @@ chat_text_view_populate_popup (EmpathyChatTextView *view,
        table = gtk_text_buffer_get_tag_table (priv->buffer);
        tag = gtk_text_tag_table_lookup (table, EMPATHY_CHAT_TEXT_VIEW_TAG_LINK);
 
-       gtk_widget_get_pointer (GTK_WIDGET (view), &x, &y);
+       gdk_window_get_device_position (gtk_widget_get_window (GTK_WIDGET (view)),
+               gdk_device_manager_get_client_pointer (gdk_display_get_device_manager (
+                       gtk_widget_get_display (GTK_WIDGET (view)))), &x, &y, NULL);
 
        gtk_text_view_window_to_buffer_coords (GTK_TEXT_VIEW (view),
                                               GTK_TEXT_WINDOW_WIDGET,
index 09146d896633905842391e49c3254f2395fb95cf..307ecf3e1d15bc4fcd34cd04ba1377c96d21f365 100644 (file)
@@ -2331,7 +2331,10 @@ chat_input_populate_popup_cb (GtkTextView *view,
        switch (priv->most_recent_event_type) {
            case GDK_BUTTON_PRESS:
                /* get the location from the pointer */
-               gtk_widget_get_pointer (GTK_WIDGET (view), &x, &y);
+               gdk_window_get_device_position (gtk_widget_get_window (GTK_WIDGET (view)),
+                       gdk_device_manager_get_client_pointer (gdk_display_get_device_manager (
+                               gtk_widget_get_display (GTK_WIDGET (view)))), &x, &y, NULL);
+
                gtk_text_view_window_to_buffer_coords (GTK_TEXT_VIEW (view),
                                                       GTK_TEXT_WINDOW_WIDGET,
                                                       x, y,