diff --git a/gnome/ChangeLog b/gnome/ChangeLog index 84647fd0c..bfd1aa7e2 100644 --- a/gnome/ChangeLog +++ b/gnome/ChangeLog @@ -1,3 +1,9 @@ +1999-03-08 Federico Mena Quintero + + * gscreen.c (can_drop_on_clist): New function to figure out if the + user is trying to drop on a valid region of a GtkCList. It sucks + to have to poke into its internal geometry, though. + 1999-03-08 Miguel de Icaza * gnome-file-property-dialog.c (apply_metadata_change): only set diff --git a/gnome/gscreen.c b/gnome/gscreen.c index e902ceaeb..fd1a11b72 100644 --- a/gnome/gscreen.c +++ b/gnome/gscreen.c @@ -1089,6 +1089,25 @@ panel_clist_scroll (gpointer data) return TRUE; } +/* Convenience function to return whether we are on a valid drop area in a + * GtkCList. + */ +static int +can_drop_on_clist (WPanel *panel, int x, int y) +{ + GtkCList *clist; + int border_width; + + clist = CLIST_FROM_SW (panel->list); + + border_width = GTK_CONTAINER (clist)->border_width; + + if (y < border_width + clist->column_title_area.y + clist->column_title_area.height) + return FALSE; + else + return TRUE; +} + /* Callback used for drag motion events over the clist. We set up * auto-scrolling and validate the drop to present the user with the correct * feedback. @@ -1105,8 +1124,7 @@ panel_clist_drag_motion (GtkWidget *widget, GdkDragContext *context, gint x, gin panel = data; - if (context->dest_window != GTK_CLIST (widget)->clist_window) { - printf ("squick\n"); + if (!can_drop_on_clist (panel, x, y)) { gdk_drag_status (context, 0, time); return TRUE; }