cpw.qulogic.gtk3: 11ba7dbc: make the buddy list tooltips work again

malu at pidgin.im malu at pidgin.im
Sun Nov 28 16:50:42 EST 2010


----------------------------------------------------------------------
Revision: 11ba7dbcb558106a4503cbf20c8d11e4ce8747c1
Parent:   468186432c4b7f4f4ec05d7de9d90cbb2d7542ff
Author:   malu at pidgin.im
Date:     11/28/10 16:48:26
Branch:   im.pidgin.cpw.qulogic.gtk3
URL: http://d.pidgin.im/viewmtn/revision/info/11ba7dbcb558106a4503cbf20c8d11e4ce8747c1

Changelog: 

make the buddy list tooltips work again

Changes against parent 468186432c4b7f4f4ec05d7de9d90cbb2d7542ff

  patched  pidgin/gtkblist.c
  patched  pidgin/pidgintooltip.c

-------------- next part --------------
============================================================
--- pidgin/gtkblist.c	e369530595d54c8c7e914c03a1a92128235d4c68
+++ pidgin/gtkblist.c	b24e2fbd521d7d637e8df8ba86bef92bd487a2d8
@@ -3028,7 +3028,7 @@ pidgin_blist_paint_tip(GtkWidget *widget
 	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))
 		{
============================================================
--- pidgin/pidgintooltip.c	814fa6050c208fe40ef75560687b21af8c871469
+++ pidgin/pidgintooltip.c	9188d1e2f991317491fce31d4c4acc133d5555fe
@@ -101,15 +101,17 @@ static gboolean
 }
 
 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 @@ setup_tooltip_window_position(gpointer d
 	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);


More information about the Commits mailing list