[gtk+] GtkButton: avoid use of gtk_get_event_widget()
- From: Ryan Lortie <ryanl src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk+] GtkButton: avoid use of gtk_get_event_widget()
- Date: Wed, 20 Oct 2010 23:24:23 +0000 (UTC)
commit c7e1f567b6124b1f99b17ca0de1985a7f39f4eae
Author: Ryan Lortie <desrt desrt ca>
Date: Thu Oct 21 00:37:29 2010 +0200
GtkButton: avoid use of gtk_get_event_widget()
We can compare the window to the window instead of the widget to the
widget.
gtk/gtkbutton.c | 10 +++-------
1 files changed, 3 insertions(+), 7 deletions(-)
---
diff --git a/gtk/gtkbutton.c b/gtk/gtkbutton.c
index 940b2cc..2b766e3 100644
--- a/gtk/gtkbutton.c
+++ b/gtk/gtkbutton.c
@@ -1725,12 +1725,10 @@ gtk_button_enter_notify (GtkWidget *widget,
GdkEventCrossing *event)
{
GtkButton *button;
- GtkWidget *event_widget;
button = GTK_BUTTON (widget);
- event_widget = gtk_get_event_widget ((GdkEvent*) event);
- if ((event_widget == widget) &&
+ if ((event->window == button->event_window) &&
(event->detail != GDK_NOTIFY_INFERIOR))
{
button->in_button = TRUE;
@@ -1745,14 +1743,12 @@ gtk_button_leave_notify (GtkWidget *widget,
GdkEventCrossing *event)
{
GtkButton *button;
- GtkWidget *event_widget;
button = GTK_BUTTON (widget);
- event_widget = gtk_get_event_widget ((GdkEvent*) event);
- if ((event_widget == widget) &&
+ if ((event->window == button->event_window) &&
(event->detail != GDK_NOTIFY_INFERIOR) &&
- (gtk_widget_get_sensitive (event_widget)))
+ (gtk_widget_get_sensitive (widget)))
{
button->in_button = FALSE;
gtk_button_leave (button);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]