diff -u --exclude='*.bak*' trunk/panel-plugin/datetime.c bug4141/panel-plugin/datetime.c --- trunk/panel-plugin/datetime.c 2008-06-08 19:17:04.000000000 -0700 +++ bug4141/panel-plugin/datetime.c 2008-06-22 12:07:51.000000000 -0700 @@ -186,6 +186,8 @@ gchar *utf8str; gchar *format = NULL; + DBG("enter (%d,%d) (%d)", x, y, keyboard_mode); + switch(datetime->layout) { case LAYOUT_TIME: @@ -205,6 +207,7 @@ current = localtime((time_t *)&timeval.tv_sec); utf8str = datetime_do_utf8strftime(format, current); + DBG("%ld.%06ld (%s)", timeval.tv_sec, timeval.tv_usec, utf8str); gtk_tooltip_set_text(tooltip, utf8str); g_free(utf8str); @@ -219,6 +222,12 @@ (GSourceFunc) datetime_tooltip_timer, datetime); } +#if USE_GTK_TOOLTIP_POSITION_WORKAROUND + if (x < 0 || y < 0) { + return FALSE; + } +#endif + return TRUE; } #endif diff -u --exclude='*.bak*' trunk/panel-plugin/datetime.h bug4141/panel-plugin/datetime.h --- trunk/panel-plugin/datetime.h 2008-06-21 08:10:18.000000000 -0700 +++ bug4141/panel-plugin/datetime.h 2008-06-22 11:16:48.000000000 -0700 @@ -23,6 +23,14 @@ #define DATETIME_H #define USE_GTK_TOOLTIP_API GTK_CHECK_VERSION(2,12,0) +#if USE_GTK_TOOLTIP_API +/* + * Workaround for bug 4141, which reports + * that the tooltip sometimes appears in the upper left corner of the display + * instead of over the datetime button widget. + */ +#define USE_GTK_TOOLTIP_POSITION_WORKAROUND 1 +#endif /* enums */ enum {