Turn find_widget_under_pointer() into internal API
_gtk_widget_find_at_coords() which is needed for fixing above
bug. This should actually be a public utility function, and will be
moved to another file when its final API has been decided.
(cherry picked from commit c4b1bbf3e2)
This commit was created using a script that searched for all docstrings
containing a parameter and the string 'or %NULL'.
Gdk backends and demos excluded as they are not part of a public API
https://bugzilla.gnome.org/show_bug.cgi?id=610474
Deprecate widget flag macros GTK_WIDGET_STATE, GTK_WIDGET_SAVED_STATE,
GTK_WIDGET_FLAGS, GTK_WIDGET_TOPLEVEL, GTK_WIDGET_NO_WINDOW and
GTK_WIDGET_COMPOSITE_CHILD.
Also deprecate the type macros GTK_WIDGET_TYPE, GTK_OBJECT_TYPE_NAME and
GTK_OBJECT_TYPE which have become redundant.
Instances of GTK_WIDGET_TOPLEVEL are replaced with gtk_widget_is_toplevel,
GTK_WIDGET_TYPE is replaced with G_OBJECT_TYPE, GTK_WIDGET_COMPOSITE_CHILD
is replaced with use of the "composite-child" property and uses of
GTK_WIDGET_NO_WINDOW are adjusted to use gtk_widget_get_has_window.
Uses of GTK_WIDGET_SAVED_STATE and GTK_WIDGET_FLAGS inside GtkWidget are
changed to direct flag usage.
Documentation is updated to refer to gtk_widget_set_has_window and
gtk_widget_get_has_window.
Gail and tests are updated as well.
Fixes: https://bugzilla.gnome.org/show_bug.cgi?id=69872
GtkIconSize is an extensible enumeration (via
gtk_icon_size_register()), so methods that claim to take/return a
GtkIconSize need to actually use "int" to work correctly with bindings
that are strict about enum values.
https://bugzilla.gnome.org/show_bug.cgi?id=604895
_gtk_tooltip_handle_event, which is called for many events in the GTK+
main loop, calls gtk_tooltip_set_last_window, which keeps a weak
reference to the last window we passed through. If the window being
set is the same than the last one there's really no need to update our
weak reference, so add a check for that and exit early.
Make the tooltip code a bit more robust for a case that only occurs when
GTK+ is used from a language binding. It looks like this case appears
because the memory management / ref counting is handled differently in
some of the language bindings. Instead of asserting, we will fail
silently. Also fix a think-o in gtk_tooltip_start_delay(). Patch from
O. Andrieu.
* gtk/gtktooltip.c (gtk_tooltip_trigger_query): Set the root
coordinates in the event correctly. Patch by Kristian Rietveld.
svn path=/trunk/; revision=22277
2008-05-28 Kristian Rietveld <kris@imendio.com>
Bug 504087 - make gtk_tooltip_set_custom a no-op for setting the
current widget again.
* gtk/gtktooltip.c (gtk_tooltip_set_custom),
(gtk_tooltip_reset), (gtk_tooltip_run_requery): use a
custom_was_reset field to check if the custom widget is set again in
the query-tooltip callback; if not, we set it to NULL. Based on a
patch by Xavier Claessens, insightful comments from Jean-Yves Lefort
and Christian Persch.
svn path=/trunk/; revision=20215
2008-02-15 Matthias Clasen <mclasen@redhat.com>
* configure.in: Go back to 2.13.0 as version for now,
as there was no consensus to do the jump.
* many other places: Update Since: tags.
svn path=/trunk/; revision=19586
2007-12-17 Kristian Rietveld <kris@imendio.com>
* gtk/gtktooltip.c (gtk_tooltip_finalize),
(gtk_tooltip_set_last_window): use a weak pointer to set last_window
to NULL as soon as it's destroyed. (#496546, patch from
Benjamin Berg).
svn path=/trunk/; revision=19189
2007-10-08 Kristian Rietveld <kris@imendio.com>
Fix#482841, patch by Karl Tomlinson.
* gtk/gtktooltip.c (gtk_tooltip_display_closed): use g_object_set_data
instead of g_object_set ...
(_gtk_tooltip_toggle_keyboard_mode),
(_gtk_tooltip_handle_event): connect to GdkDisplay::closed after
creating tooltip.
svn path=/trunk/; revision=18890
2007-08-21 Kristian Rietveld <kris@imendio.com>
* gtk/gtktooltip.c (_gtk_tooltip_handle_event): always set
hide_tooltip to TRUE if we are handling a leave notify event. (Fixes
#468245, reported by Dennis Jacobfeuerborn).
svn path=/trunk/; revision=18666
2007-08-21 Kristian Rietveld <kris@imendio.com>
Fix#457642, reported by Christian Persch.
* gtk/gtktooltip.c: added debugging output which can be compiled
in with a #define, annotated all coordinate translations in the
source code,
(find_widget_under_pointer): remove the "no-window correction";
always convert the coordinates from window relative to allocation
relative; after recursing through a container, translate the
coordinates from container allocation relative to child widget
allocation relative;
(find_topmost_widget_from_event): now we get allocation relative
coordinates here we do not have to distinguish no-window and window
widgets.
svn path=/trunk/; revision=18663
2007-07-31 Matthias Clasen <mclasen@redhat.com>
* gtk/gtktooltip.c (gtk_tooltip_init): Make the label
wrap, for compatibility with the old tooltips code. This
fixes absurdly long tooltips in the color selector.
svn path=/trunk/; revision=18558
2007-07-25 Matthias Clasen <mclasen@redhat.com>
* gtk/gtktooltip.c (_gtk_tooltip_handle_event): Call
gtk_tooltip_hide_tooltip() even if the tooltip is not
visible yet. This fixes annoying dangling tooltips
on systray icons.
svn path=/trunk/; revision=18544
2007-07-20 Matthias Clasen <mclasen@redhat.com>
* gtk/gtktooltip.c (gtk_tooltip_position): Don't pop up
under the cursor.
svn path=/trunk/; revision=18512
2007-07-17 Kristian Rietveld <kris@imendio.com>
* gtk/gtktooltip.c (find_widget_under_pointer): only do the
coordinate check if tmp is not NULL.
svn path=/trunk/; revision=18486
2007-07-16 Kristian Rietveld <kris@imendio.com>
* gtk/gtktooltip.c (find_topmost_widget_coords_from_event): check
if the pointer is really over the returned widget, since the
coordinate check may not always be hit in find_widget_under_pointer().
svn path=/trunk/; revision=18478
2007-07-13 Kristian Rietveld <kris@imendio.com>
#408327, improve tooltip positioning.
* gtk/gtk.symbols: updated.
* gtk/gtktooltip.[ch] (gtk_tooltip_position): factor out
positioning code in here,
(gtk_tooltip_set_tip_area): new function to set the tooltip
area,
(gtk_tooltip_reset), (_gtk_tooltip_handle_event): hide tooltip
once the pointer leaves the tip area.
* gtk/gtktreeview.[ch] (gtk_tree_view_set_tooltip_row),
(gtk_tree_view_set_tooltip_cell): convenience functions to set
tip area for row/column/cell.
* tests/testtooltips.c (query_tooltip_tree_view_cb): use
gtk_tree_view_set_tooltip_row.
svn path=/trunk/; revision=18464
2007-07-10 Kristian Rietveld <kris@imendio.com>
* gtk/gtktooltip.c (find_widget_under_pointer),
(child_location_foreach): use gtk_container_forall, instead of
gtk_container_foreach(). Makes tooltips on notebook tabs work. (Fixes
bug reported by Christian Persch).
svn path=/trunk/; revision=18436
2007-07-09 Johan Dahlin <jdahlin@async.com.br>
* gtk/gtktooltip.c:
* gtk/gtktooltip.h: Make the GTK_TOOLTIP and GTK_IS_TOOLTIP macros public.
svn path=/trunk/; revision=18410
2007-06-15 Mathias Hasselmann <mathias.hasselmann@gmx.de>
* docs/reference/gtk/gtk-sections.txt, gtk/gtk.symbols,
gtk/gtkwidget.c, gtk/gtkwidget.h, tests/testtooltips.c: Introduce
convenience property "GtkWidget:tooltip-text" taking care of escaping
it for unwanted markup entities. Add functions to set tooltip text:
gtk_widget_set_tooltip_text(), gtk_widget_set_tooltip_markup(),
gtk_widget_get_tooltip_text(), gtk_widget_get_tooltip_markup().
* gtk/gtktooltip.c, gtk/gtktooltip.h: Add gtk_tooltip_set_text()
to set the tooltip text without using markup.
Patches from Emmanuele Bassi (#447643).
svn path=/trunk/; revision=18142
2007-06-06 Kristian Rietveld <kris@imendio.com>
* gtk/gtktooltip.c (gtk_tooltip_paint_window): remove unused
call to gtk_widget_size_request(). (Reported by Carlos
Garnacho).
svn path=/trunk/; revision=18052