mirror of
https://gitlab.gnome.org/GNOME/gtk.git
synced 2024-11-05 16:20:10 +00:00
GtkButton: avoid use of gtk_get_event_widget()
We can compare the window to the window instead of the widget to the widget.
This commit is contained in:
parent
56d2590b49
commit
c7e1f567b6
@ -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);
|
||||
|
Loading…
Reference in New Issue
Block a user