[gtk+] GtkExpander: avoid use of gtk_get_event_widget()



commit 56d5b454431f00ba043c289bc75f4579a6a25696
Author: Javier Jardón <jjardon gnome org>
Date:   Fri Oct 22 18:14:10 2010 +0200

    GtkExpander: avoid use of gtk_get_event_widget()
    
    We can compare the window to the window instead of the widget to the widget.

 gtk/gtkexpander.c |   10 ++--------
 1 files changed, 2 insertions(+), 8 deletions(-)
---
diff --git a/gtk/gtkexpander.c b/gtk/gtkexpander.c
index 9554ec1..53eae8c 100644
--- a/gtk/gtkexpander.c
+++ b/gtk/gtkexpander.c
@@ -970,11 +970,8 @@ gtk_expander_enter_notify (GtkWidget        *widget,
 			   GdkEventCrossing *event)
 {
   GtkExpander *expander = GTK_EXPANDER (widget);
-  GtkWidget *event_widget;
 
-  event_widget = gtk_get_event_widget ((GdkEvent *) event);
-
-  if (event_widget == widget &&
+  if (event->window == expander->priv->event_window &&
       event->detail != GDK_NOTIFY_INFERIOR)
     {
       expander->priv->prelight = TRUE;
@@ -993,11 +990,8 @@ gtk_expander_leave_notify (GtkWidget        *widget,
 			   GdkEventCrossing *event)
 {
   GtkExpander *expander = GTK_EXPANDER (widget);
-  GtkWidget *event_widget;
-
-  event_widget = gtk_get_event_widget ((GdkEvent *) event);
 
-  if (event_widget == widget &&
+  if (event->window == expander->priv->event_window &&
       event->detail != GDK_NOTIFY_INFERIOR)
     {
       expander->priv->prelight = FALSE;



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]