[gtk+/wip/carlosg/event-delivery: 12/24] gtkbutton: Handle crossing events without the event window
- From: Carlos Garnacho <carlosg src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk+/wip/carlosg/event-delivery: 12/24] gtkbutton: Handle crossing events without the event window
- Date: Fri, 31 Mar 2017 17:34:51 +0000 (UTC)
commit 04df4bf0f0290aefbd206d5f381068962b908ea3
Author: Carlos Garnacho <carlosg gnome org>
Date: Fri Mar 31 17:59:43 2017 +0200
gtkbutton: Handle crossing events without the event window
The event shall no longer be "directed" to the event window, but the
widget. Getting a enter/leave event is enough now to know whether the
pointer is inside or outside the widget.
gtk/gtkbutton.c | 16 ++++------------
1 files changed, 4 insertions(+), 12 deletions(-)
---
diff --git a/gtk/gtkbutton.c b/gtk/gtkbutton.c
index df8e455..cb4cb95 100644
--- a/gtk/gtkbutton.c
+++ b/gtk/gtkbutton.c
@@ -971,12 +971,8 @@ gtk_button_enter_notify (GtkWidget *widget,
GtkButton *button = GTK_BUTTON (widget);
GtkButtonPrivate *priv = button->priv;
- if ((event->window == button->priv->event_window) &&
- (event->detail != GDK_NOTIFY_INFERIOR))
- {
- priv->in_button = TRUE;
- gtk_button_update_state (button);
- }
+ priv->in_button = TRUE;
+ gtk_button_update_state (button);
return FALSE;
}
@@ -988,12 +984,8 @@ gtk_button_leave_notify (GtkWidget *widget,
GtkButton *button = GTK_BUTTON (widget);
GtkButtonPrivate *priv = button->priv;
- if ((event->window == button->priv->event_window) &&
- (event->detail != GDK_NOTIFY_INFERIOR))
- {
- priv->in_button = FALSE;
- gtk_button_update_state (button);
- }
+ priv->in_button = FALSE;
+ gtk_button_update_state (button);
return FALSE;
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]