From 1cd5e6da94f7e56c3a6e7792b1a5cc882e4b9e84 Mon Sep 17 00:00:00 2001 From: werner Date: Sat, 2 Jan 2010 15:47:46 +0000 Subject: [PATCH] Canvas tooltips now work. The problem was that expose events set the paint region to only cover the newly exposed area. This prevented the general redrawing from clearing areas that still contained hovering and dragging items. However,the paint region has no effect on reading from the drawable. Thus when rebuilding the hover and drag stack, the still tainted image was stored. This issue could be solved by either introducing a separate mode where the stack is redrawn instead of rebuilt, or by turning off double-buffering. The former would complicate the already fickle logic of overlays, and not having double-buffering doesn't seem to cause any ill effects. - gui_canvas.c (make_canvas): disable double-buffering of canvas so that the paint region is not restricted in expose events - gui_tool.c (tool_tip): enabled canvas tooltips git-svn-id: http://svn.openmoko.org/trunk/eda/fped@5770 99fdad57-331a-0410-800a-d7fa5415bdb3 --- gui_canvas.c | 2 ++ gui_tool.c | 8 -------- 2 files changed, 2 insertions(+), 8 deletions(-) diff --git a/gui_canvas.c b/gui_canvas.c index fb5c2a2..b529f5c 100644 --- a/gui_canvas.c +++ b/gui_canvas.c @@ -522,6 +522,8 @@ GtkWidget *make_canvas(void) GDK_SCROLL | GDK_POINTER_MOTION_MASK); + gtk_widget_set_double_buffered(canvas, FALSE); + draw_ctx.widget = canvas; return canvas; diff --git a/gui_tool.c b/gui_tool.c index 3655b15..d42781b 100644 --- a/gui_tool.c +++ b/gui_tool.c @@ -848,14 +848,6 @@ const char *tool_tip(struct coord pos) if (!inst) return NULL; - /* - * Tooltips don't work properly yet, so we return NULL here. The - * tooltips themselves are fine, but the expose event generated when - * removing the tooltip window upsets the overlay logic for some yet - * unknown reason. - */ - return NULL; - /* * The logic below follows exactly what happens in get_hover_inst. */