]> git.0d.be Git - empathy.git/commitdiff
empathy_roster_view_query_tooltip: set the tooltip next to the right child
authorGuillaume Desmottes <guillaume.desmottes@collabora.co.uk>
Mon, 18 Jun 2012 09:26:48 +0000 (11:26 +0200)
committerGuillaume Desmottes <guillaume.desmottes@collabora.co.uk>
Mon, 18 Jun 2012 10:58:32 +0000 (12:58 +0200)
This ensures that the tooltip is always displayed next to the correct row.

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

libempathy-gtk/empathy-roster-view.c

index b823b71a4227ddb7ef465525a90778df62f51d1d..7ae8052398ae92d2f08defcb3db14f8d80195c51 100644 (file)
@@ -1230,6 +1230,7 @@ empathy_roster_view_query_tooltip (GtkWidget *widget,
   GtkWidget *child;
   EmpathyRosterContact *contact;
   FolksIndividual *individual;
+  gboolean result;
 
   if (self->priv->individual_tooltip_cb == NULL)
     return FALSE;
@@ -1241,8 +1242,18 @@ empathy_roster_view_query_tooltip (GtkWidget *widget,
   contact = EMPATHY_ROSTER_CONTACT (child);
   individual = empathy_roster_contact_get_individual (contact);
 
-  return self->priv->individual_tooltip_cb (self, individual, keyboard_mode,
+  result = self->priv->individual_tooltip_cb (self, individual, keyboard_mode,
       tooltip, self->priv->individual_tooltip_data);
+
+  if (result)
+    {
+      GtkAllocation allocation;
+
+      gtk_widget_get_allocation (child, &allocation);
+      gtk_tooltip_set_tip_area (tooltip, (GdkRectangle *) &allocation);
+    }
+
+  return result;
 }
 
 void