forked from AuroraMiddleware/gtk
Fix problem with selecting a new focus child.
Sun Aug 5 09:48:08 2001 Owen Taylor <otaylor@redhat.com> * gtk/gtklist.c (gtk_list_clear_items): Fix problem with selecting a new focus child. * gtk/gtklist.c (gtk_list_clear_items): Clear list->undo/list_focus_child after unparenting child, since unparenting the child can result in list->last_focus_child being set. (#58024) * Makefile.am (SUBDIRS): Add target specific pc files to DISTCLEANFILES. * gtk/Makefile.am: add @GTK_DEBUG_FLAGS@ (58327, Matthias Clasen)
This commit is contained in:
parent
9166ba51a1
commit
42cf380d36
@ -137,6 +137,12 @@ gdk-$(GDKTARGET)-2.0-uninstalled.pc: gdk-2.0-uninstalled.pc
|
|||||||
pkgconfigdir = $(libdir)/pkgconfig
|
pkgconfigdir = $(libdir)/pkgconfig
|
||||||
pkgconfig_DATA= gdk-pixbuf-2.0.pc gdk-$(GDKTARGET)-2.0.pc gtk+-$(GDKTARGET)-2.0.pc
|
pkgconfig_DATA= gdk-pixbuf-2.0.pc gdk-$(GDKTARGET)-2.0.pc gtk+-$(GDKTARGET)-2.0.pc
|
||||||
|
|
||||||
|
DISTCLEANFILES = \
|
||||||
|
gtk+-$(GDKTARGET)-2.0.pc \
|
||||||
|
gdk-$(GDKTARGET)-2.0.pc \
|
||||||
|
gtk+-$(GDKTARGET)-2.0-uninstalled.pc \
|
||||||
|
gdk-$(GDKTARGET)-2.0-uninstalled.pc
|
||||||
|
|
||||||
## symlink gdk-2.0.pc and gtk+-2.0.pc to default target for the platform
|
## symlink gdk-2.0.pc and gtk+-2.0.pc to default target for the platform
|
||||||
DEFAULT_GDKTARGET=x11
|
DEFAULT_GDKTARGET=x11
|
||||||
install-data-local:
|
install-data-local:
|
||||||
|
@ -16,6 +16,7 @@ INCLUDES = @STRIP_BEGIN@ \
|
|||||||
-I$(top_srcdir) -I../gdk \
|
-I$(top_srcdir) -I../gdk \
|
||||||
-I$(top_srcdir)/gdk \
|
-I$(top_srcdir)/gdk \
|
||||||
-I$(top_srcdir)/gdk-pixbuf -I../gdk-pixbuf \
|
-I$(top_srcdir)/gdk-pixbuf -I../gdk-pixbuf \
|
||||||
|
@GTK_DEBUG_FLAGS@ \
|
||||||
@GTK_DEP_CFLAGS@ \
|
@GTK_DEP_CFLAGS@ \
|
||||||
@STRIP_END@
|
@STRIP_END@
|
||||||
|
|
||||||
|
@ -1180,7 +1180,7 @@ gtk_list_clear_items (GtkList *list,
|
|||||||
if (start_list->prev)
|
if (start_list->prev)
|
||||||
new_focus_child = start_list->prev->data;
|
new_focus_child = start_list->prev->data;
|
||||||
else if (list->children)
|
else if (list->children)
|
||||||
new_focus_child = list->children->prev->data;
|
new_focus_child = list->children->data;
|
||||||
|
|
||||||
if (GTK_WIDGET_HAS_FOCUS (container->focus_child))
|
if (GTK_WIDGET_HAS_FOCUS (container->focus_child))
|
||||||
grab_focus = TRUE;
|
grab_focus = TRUE;
|
||||||
@ -1193,16 +1193,20 @@ gtk_list_clear_items (GtkList *list,
|
|||||||
widget = tmp_list->data;
|
widget = tmp_list->data;
|
||||||
tmp_list = tmp_list->next;
|
tmp_list = tmp_list->next;
|
||||||
|
|
||||||
|
gtk_widget_ref (widget);
|
||||||
|
|
||||||
if (widget->state == GTK_STATE_SELECTED)
|
if (widget->state == GTK_STATE_SELECTED)
|
||||||
gtk_list_unselect_child (list, widget);
|
gtk_list_unselect_child (list, widget);
|
||||||
|
|
||||||
|
gtk_signal_disconnect_by_data (GTK_OBJECT (widget), (gpointer) list);
|
||||||
|
gtk_widget_unparent (widget);
|
||||||
|
|
||||||
if (widget == list->undo_focus_child)
|
if (widget == list->undo_focus_child)
|
||||||
list->undo_focus_child = NULL;
|
list->undo_focus_child = NULL;
|
||||||
if (widget == list->last_focus_child)
|
if (widget == list->last_focus_child)
|
||||||
list->last_focus_child = NULL;
|
list->last_focus_child = NULL;
|
||||||
|
|
||||||
gtk_signal_disconnect_by_data (GTK_OBJECT (widget), (gpointer) list);
|
gtk_widget_unref (widget);
|
||||||
gtk_widget_unparent (widget);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
g_list_free (start_list);
|
g_list_free (start_list);
|
||||||
@ -1310,6 +1314,7 @@ gtk_list_remove_items_internal (GtkList *list,
|
|||||||
widget = tmp_list->data;
|
widget = tmp_list->data;
|
||||||
tmp_list = tmp_list->next;
|
tmp_list = tmp_list->next;
|
||||||
|
|
||||||
|
gtk_widget_ref (widget);
|
||||||
if (no_unref)
|
if (no_unref)
|
||||||
gtk_widget_ref (widget);
|
gtk_widget_ref (widget);
|
||||||
|
|
||||||
@ -1328,14 +1333,16 @@ gtk_list_remove_items_internal (GtkList *list,
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
gtk_signal_disconnect_by_data (GTK_OBJECT (widget), (gpointer) list);
|
||||||
|
list->children = g_list_remove (list->children, widget);
|
||||||
|
gtk_widget_unparent (widget);
|
||||||
|
|
||||||
if (widget == list->undo_focus_child)
|
if (widget == list->undo_focus_child)
|
||||||
list->undo_focus_child = NULL;
|
list->undo_focus_child = NULL;
|
||||||
if (widget == list->last_focus_child)
|
if (widget == list->last_focus_child)
|
||||||
list->last_focus_child = NULL;
|
list->last_focus_child = NULL;
|
||||||
|
|
||||||
gtk_signal_disconnect_by_data (GTK_OBJECT (widget), (gpointer) list);
|
gtk_widget_unref (widget);
|
||||||
list->children = g_list_remove (list->children, widget);
|
|
||||||
gtk_widget_unparent (widget);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (new_focus_child && new_focus_child != old_focus_child)
|
if (new_focus_child && new_focus_child != old_focus_child)
|
||||||
|
Loading…
Reference in New Issue
Block a user