Commit 65b9fc3e authored by Javier Jardón's avatar Javier Jardón
Browse files

gtk/gtkmain.c: Use accessor functions to access GtkWindowGroup

parent 6eae25e0
...@@ -1606,8 +1606,8 @@ gtk_main_do_event (GdkEvent *event) ...@@ -1606,8 +1606,8 @@ gtk_main_do_event (GdkEvent *event)
if (device) if (device)
grab_widget = gtk_window_group_get_current_device_grab (window_group, device); grab_widget = gtk_window_group_get_current_device_grab (window_group, device);
if (!grab_widget && window_group->grabs) if (!grab_widget)
grab_widget = window_group->grabs->data; grab_widget = gtk_window_group_get_current_grab (window_group);
/* If the grab widget is an ancestor of the event widget /* If the grab widget is an ancestor of the event widget
* then we send the event to the original event widget. * then we send the event to the original event widget.
...@@ -1650,7 +1650,8 @@ gtk_main_do_event (GdkEvent *event) ...@@ -1650,7 +1650,8 @@ gtk_main_do_event (GdkEvent *event)
case GDK_DELETE: case GDK_DELETE:
g_object_ref (event_widget); g_object_ref (event_widget);
if ((!window_group->grabs || gtk_widget_get_toplevel (window_group->grabs->data) == event_widget) && grab_widget = gtk_window_group_get_current_grab (window_group);
if ((!grab_widget || gtk_widget_get_toplevel (grab_widget) == event_widget) &&
!gtk_widget_event (event_widget, event)) !gtk_widget_event (event_widget, event))
gtk_widget_destroy (event_widget); gtk_widget_destroy (event_widget);
g_object_unref (event_widget); g_object_unref (event_widget);
...@@ -2013,13 +2014,10 @@ gtk_grab_add (GtkWidget *widget) ...@@ -2013,13 +2014,10 @@ gtk_grab_add (GtkWidget *widget)
group = gtk_main_get_window_group (widget); group = gtk_main_get_window_group (widget);
if (group->grabs) old_grab_widget = gtk_window_group_get_current_grab (group);
old_grab_widget = (GtkWidget *)group->grabs->data;
else
old_grab_widget = NULL;
g_object_ref (widget); g_object_ref (widget);
group->grabs = g_slist_prepend (group->grabs, widget); //group->grabs = g_slist_prepend (group->grabs, widget);
gtk_grab_notify (group, NULL, old_grab_widget, widget, TRUE); gtk_grab_notify (group, NULL, old_grab_widget, widget, TRUE);
} }
...@@ -2032,9 +2030,7 @@ gtk_grab_get_current (void) ...@@ -2032,9 +2030,7 @@ gtk_grab_get_current (void)
group = gtk_main_get_window_group (NULL); group = gtk_main_get_window_group (NULL);
if (group->grabs) return gtk_window_group_get_current_grab (group);
return GTK_WIDGET (group->grabs->data);
return NULL;
} }
void void
...@@ -2050,12 +2046,9 @@ gtk_grab_remove (GtkWidget *widget) ...@@ -2050,12 +2046,9 @@ gtk_grab_remove (GtkWidget *widget)
_gtk_widget_set_has_grab (widget, FALSE); _gtk_widget_set_has_grab (widget, FALSE);
group = gtk_main_get_window_group (widget); group = gtk_main_get_window_group (widget);
group->grabs = g_slist_remove (group->grabs, widget); //group->grabs = g_slist_remove (group->grabs, widget);
if (group->grabs) new_grab_widget = gtk_window_group_get_current_grab (group);
new_grab_widget = (GtkWidget *)group->grabs->data;
else
new_grab_widget = NULL;
gtk_grab_notify (group, NULL, widget, new_grab_widget, FALSE); gtk_grab_notify (group, NULL, widget, new_grab_widget, FALSE);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment