~canonical-dx-team/ubuntu/maverick/gtk+2.0/menuproxy

« back to all changes in this revision

Viewing changes to gtk/gtktooltip.c

  • Committer: Bazaar Package Importer
  • Author(s): Sebastien Bacher
  • Date: 2010-06-02 15:59:27 UTC
  • mfrom: (72.1.15 experimental)
  • Revision ID: james.westby@ubuntu.com-20100602155927-uwh99v2582rw3r8z
Tags: 2.21.1-1ubuntu1
* debian/patches/070_mandatory-relibtoolize.patch:
  - refreshed
* debian/patches/072_indicator_menu_update.patch:
  - change by Cody Russell to send an update event on menu changes,
    should make the bluetooth indicator refresh correctly (lp: #558841)
* debian/patches/091_bugzilla_tooltip_refresh.patch:
  - refreshed

Show diffs side-by-side

added added

removed removed

Lines of Context:
647
647
/* Translates coordinates from window relative (x, y) to
648
648
 * allocation relative (x, y) of the returned widget.
649
649
 */
650
 
static GtkWidget *
651
 
find_widget_under_pointer (GdkWindow *window,
652
 
                           gint      *x,
653
 
                           gint      *y)
 
650
GtkWidget *
 
651
_gtk_widget_find_at_coords (GdkWindow *window,
 
652
                            gint       window_x,
 
653
                            gint       window_y,
 
654
                            gint      *widget_x,
 
655
                            gint      *widget_y)
654
656
{
655
657
  GtkWidget *event_widget;
656
658
  struct ChildLocation child_loc = { NULL, NULL, 0, 0 };
657
659
 
 
660
  g_return_val_if_fail (GDK_IS_WINDOW (window), NULL);
 
661
 
658
662
  gdk_window_get_user_data (window, (void **)&event_widget);
659
663
 
660
664
  if (!event_widget)
663
667
#ifdef DEBUG_TOOLTIP
664
668
  g_print ("event window %p (belonging to %p (%s))  (%d, %d)\n",
665
669
           window, event_widget, gtk_widget_get_name (event_widget),
666
 
           *x, *y);
 
670
           window_x, window_y);
667
671
#endif
668
672
 
669
673
  /* Coordinates are relative to event window */
670
 
  child_loc.x = *x;
671
 
  child_loc.y = *y;
 
674
  child_loc.x = window_x;
 
675
  child_loc.y = window_y;
672
676
 
673
677
  /* We go down the window hierarchy to the widget->window,
674
678
   * coordinates stay relative to the current window.
725
729
      gtk_widget_translate_coordinates (container, event_widget,
726
730
                                        child_loc.x, child_loc.y,
727
731
                                        &child_loc.x, &child_loc.y);
728
 
 
729
732
    }
730
733
 
731
734
  /* We return (x, y) relative to the allocation of event_widget. */
732
 
  if (x)
733
 
    *x = child_loc.x;
734
 
  if (y)
735
 
    *y = child_loc.y;
 
735
  if (widget_x)
 
736
    *widget_x = child_loc.x;
 
737
  if (widget_y)
 
738
    *widget_y = child_loc.y;
736
739
 
737
740
  return event_widget;
738
741
}
750
753
  GtkWidget *tmp;
751
754
 
752
755
  gdk_event_get_coords (event, &dx, &dy);
753
 
  tx = dx;
754
 
  ty = dy;
755
756
 
756
757
  /* Returns coordinates relative to tmp's allocation. */
757
 
  tmp = find_widget_under_pointer (event->any.window, &tx, &ty);
 
758
  tmp = _gtk_widget_find_at_coords (event->any.window, dx, dy, &tx, &ty);
758
759
 
759
760
  if (!tmp)
760
761
    return NULL;
1007
1008
      tooltip->last_x = tx;
1008
1009
      tooltip->last_y = ty;
1009
1010
 
1010
 
      pointer_widget = tooltip_widget = find_widget_under_pointer (window,
1011
 
                                                                   &x, &y);
 
1011
      pointer_widget = tooltip_widget = _gtk_widget_find_at_coords (window,
 
1012
                                                                    x, y,
 
1013
                                                                    &x, &y);
1012
1014
    }
1013
1015
 
1014
1016
  if (!tooltip_widget)