1 diff -NaurBb gtk+-2.6.10.old/gtk/Makefile.am gtk+-2.6.10/gtk/Makefile.am
2 --- gtk+-2.6.10.old/gtk/Makefile.am 2005-08-18 16:10:56.000000000 +0200
3 +++ gtk+-2.6.10/gtk/Makefile.am 2005-12-29 01:23:52.000000000 +0100
12 diff -NaurBb gtk+-2.6.10.old/gtk/gpe-what.c gtk+-2.6.10/gtk/gpe-what.c
13 --- gtk+-2.6.10.old/gtk/gpe-what.c 1970-01-01 01:00:00.000000000 +0100
14 +++ gtk+-2.6.10/gtk/gpe-what.c 2005-12-29 00:59:26.000000000 +0100
17 + * Copyright (C) 2002, 2003 Philip Blundell <philb@gnu.org>
19 + * This library is free software; you can redistribute it and/or
20 + * modify it under the terms of the GNU Lesser General Public
21 + * License as published by the Free Software Foundation; either
22 + * version 2 of the License, or (at your option) any later version.
24 + * This library is distributed in the hope that it will be useful,
25 + * but WITHOUT ANY WARRANTY; without even the implied warranty of
26 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
27 + * Lesser General Public License for more details.
29 + * You should have received a copy of the GNU Lesser General Public
30 + * License along with this library; if not, write to the
31 + * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
32 + * Boston, MA 02111-1307, USA.
39 +#include <X11/Xlib.h>
40 +#include <X11/Xatom.h>
42 +#ifdef GDK_WINDOWING_X11
46 +#include "gtkwidget.h"
47 +#include "gtktooltips.h"
48 +#include "x11/gdkx.h"
53 +#define _(x) dgettext(GETTEXT_PACKAGE, x)
55 +static GdkAtom help_atom;
56 +static gboolean gpe_what_initialised;
58 +static GSList *widgets;
61 +send_text (Display *dpy, Window w, char *text)
63 + Atom help_xatom = gdk_x11_atom_to_xatom (help_atom);
65 + gdk_error_trap_push ();
67 + XChangeProperty (dpy, w, help_xatom, XA_STRING, 8, PropModeReplace, text, strlen (text));
71 + gdk_error_trap_pop ();
74 +static GdkFilterReturn
75 +filter_func (GdkXEvent *xev, GdkEvent *ev, gpointer p)
77 + XClientMessageEvent *xc = (XClientMessageEvent *)xev;
79 + Window sender = xc->data.l[0];
81 + for (list = widgets; list; list = list->next)
83 + GtkWidget *widget = GTK_WIDGET (list->data);
84 + int x = xc->data.l[1], y = xc->data.l[2];
87 + if (!GTK_WIDGET_DRAWABLE (widget)) continue;
89 + if (GTK_WIDGET_NO_WINDOW (widget))
91 + ax = widget->allocation.x;
92 + ay = widget->allocation.y;
100 + if (widget->window == ev->any.window
101 + && x >= ax && x < ax + widget->allocation.width
102 + && y >= ay && y < ay + widget->allocation.height)
104 + GtkTooltipsData *data = gtk_tooltips_data_get (widget);
107 + send_text (GDK_WINDOW_XDISPLAY (widget->window), sender,
108 + data->tip_private ? data->tip_private : data->tip_text);
109 + return GDK_FILTER_CONTINUE;
114 + send_text (GDK_WINDOW_XDISPLAY (ev->any.window), sender, _("No help available."));
116 + return GDK_FILTER_CONTINUE;
120 +gpe_what_mark_widget (GtkWidget *widget)
122 + if (!gpe_what_initialised)
124 + help_atom = gdk_atom_intern ("_GPE_INTERACTIVE_HELP", FALSE);
126 + gdk_add_client_message_filter (help_atom, filter_func, NULL);
128 + gpe_what_initialised = TRUE;
131 + if (widget->window)
133 + widgets = g_slist_prepend (widgets, widget);
135 + gdk_property_change (widget->window,
139 + GDK_PROP_MODE_REPLACE,
146 diff -NaurBb gtk+-2.6.10.old/gtk/gtkwidget.c gtk+-2.6.10/gtk/gtkwidget.c
147 --- gtk+-2.6.10.old/gtk/gtkwidget.c 2005-08-18 16:10:59.000000000 +0200
148 +++ gtk+-2.6.10/gtk/gtkwidget.c 2005-12-29 00:59:26.000000000 +0100
149 @@ -2285,6 +2285,9 @@
151 g_signal_emit (widget, widget_signals[REALIZE], 0);
153 + extern void gpe_what_mark_widget (GtkWidget *widget);
154 + gpe_what_mark_widget (widget);
156 if (GTK_WIDGET_HAS_SHAPE_MASK (widget))
158 shape_info = g_object_get_qdata (G_OBJECT (widget), quark_shape_info);