changeset 32633:6487dbfd9b6b

make the buddy list tooltips work again
author Marcus Lundblad <ml@update.uu.se>
date Sun, 28 Nov 2010 21:48:26 +0000
parents 63181cbb941c
children 866ef8552606
files pidgin/gtkblist.c pidgin/pidgintooltip.c
diffstat 2 files changed, 10 insertions(+), 8 deletions(-) [+]
line wrap: on
line diff
--- a/pidgin/gtkblist.c	Sun Nov 28 21:00:42 2010 +0000
+++ b/pidgin/gtkblist.c	Sun Nov 28 21:48:26 2010 +0000
@@ -3028,7 +3028,7 @@
 	for(l = gtkblist->tooltipdata; l; l = l->next)
 	{
 		struct tooltip_data *td = l->data;
-    cairo_t *cr = gdk_cairo_create(GDK_DRAWABLE(gtkblist->tipwindow));
+    cairo_t *cr = gdk_cairo_create(GDK_DRAWABLE(gtk_widget_get_window(gtkblist->tipwindow)));
       
 		if (td->avatar && pidgin_gdk_pixbuf_is_opaque(td->avatar))
 		{
--- a/pidgin/pidgintooltip.c	Sun Nov 28 21:00:42 2010 +0000
+++ b/pidgin/pidgintooltip.c	Sun Nov 28 21:48:26 2010 +0000
@@ -101,15 +101,17 @@
 }
 
 static gboolean
-pidgin_tooltip_expose_event(GtkWidget *widget, GdkEventExpose *event, gpointer data)
+pidgin_tooltip_draw_cb(GtkWidget *widget, cairo_t *cr, gpointer data)
 {
+	GtkAllocation allocation;
+
+	gtk_widget_get_allocation(widget, &allocation);
+
 	if (pidgin_tooltip.paint_tooltip) {
-    cairo_t *cr = gdk_cairo_create(GDK_DRAWABLE(gtk_widget_get_window(widget)));
 		gtk_paint_flat_box(gtk_widget_get_style(widget), cr,
-        GTK_STATE_NORMAL, GTK_SHADOW_OUT,
-				widget, "tooltip", 0, 0, -1, -1);
+			GTK_STATE_NORMAL, GTK_SHADOW_OUT,
+			widget, "tooltip", 0, 0, allocation.width, allocation.height);
 		pidgin_tooltip.paint_tooltip(widget, data);
-    cairo_destroy(cr);
 	}
 	return FALSE;
 }
@@ -182,8 +184,8 @@
 	gtk_window_move(GTK_WINDOW(tipwindow), x, y);
 	gtk_widget_show(tipwindow);
 
-	g_signal_connect(G_OBJECT(tipwindow), "expose_event",
-			G_CALLBACK(pidgin_tooltip_expose_event), data);
+	g_signal_connect(G_OBJECT(tipwindow), "draw",
+			G_CALLBACK(pidgin_tooltip_draw_cb), data);
 
 	/* Hide the tooltip when the widget is destroyed */
 	sig = g_signal_connect(G_OBJECT(pidgin_tooltip.widget), "destroy", G_CALLBACK(pidgin_tooltip_destroy), NULL);