diff --git a/ChangeLog b/ChangeLog index 04026c1b02..61c7dd02ff 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,16 @@ +Thu Aug 14 18:25:39 2003 Owen Taylor + + * gtk/gtkfilesel.c (gtk_file_selection_populate): + Don't reposition the cursor when we aren't trying + to complete. (Fixes problems with selection on + startup, #108433, reported by Mark Finlay.) + + * gtk/gtkfilesel.c (gtk_file_selection_populate): Remove + code that tried to position the cursor after the common + prefix when there was one, it wasn't working, and + would be hard to fix. Just always put the cursor + at the end when completing. + Thu Aug 14 17:58:23 2003 Owen Taylor * gtk/gtkfilesel.c (get_current_dir_utf8): If getting diff --git a/ChangeLog.pre-2-10 b/ChangeLog.pre-2-10 index 04026c1b02..61c7dd02ff 100644 --- a/ChangeLog.pre-2-10 +++ b/ChangeLog.pre-2-10 @@ -1,3 +1,16 @@ +Thu Aug 14 18:25:39 2003 Owen Taylor + + * gtk/gtkfilesel.c (gtk_file_selection_populate): + Don't reposition the cursor when we aren't trying + to complete. (Fixes problems with selection on + startup, #108433, reported by Mark Finlay.) + + * gtk/gtkfilesel.c (gtk_file_selection_populate): Remove + code that tried to position the cursor after the common + prefix when there was one, it wasn't working, and + would be hard to fix. Just always put the cursor + at the end when completing. + Thu Aug 14 17:58:23 2003 Owen Taylor * gtk/gtkfilesel.c (get_current_dir_utf8): If getting diff --git a/ChangeLog.pre-2-4 b/ChangeLog.pre-2-4 index 04026c1b02..61c7dd02ff 100644 --- a/ChangeLog.pre-2-4 +++ b/ChangeLog.pre-2-4 @@ -1,3 +1,16 @@ +Thu Aug 14 18:25:39 2003 Owen Taylor + + * gtk/gtkfilesel.c (gtk_file_selection_populate): + Don't reposition the cursor when we aren't trying + to complete. (Fixes problems with selection on + startup, #108433, reported by Mark Finlay.) + + * gtk/gtkfilesel.c (gtk_file_selection_populate): Remove + code that tried to position the cursor after the common + prefix when there was one, it wasn't working, and + would be hard to fix. Just always put the cursor + at the end when completing. + Thu Aug 14 17:58:23 2003 Owen Taylor * gtk/gtkfilesel.c (get_current_dir_utf8): If getting diff --git a/ChangeLog.pre-2-6 b/ChangeLog.pre-2-6 index 04026c1b02..61c7dd02ff 100644 --- a/ChangeLog.pre-2-6 +++ b/ChangeLog.pre-2-6 @@ -1,3 +1,16 @@ +Thu Aug 14 18:25:39 2003 Owen Taylor + + * gtk/gtkfilesel.c (gtk_file_selection_populate): + Don't reposition the cursor when we aren't trying + to complete. (Fixes problems with selection on + startup, #108433, reported by Mark Finlay.) + + * gtk/gtkfilesel.c (gtk_file_selection_populate): Remove + code that tried to position the cursor after the common + prefix when there was one, it wasn't working, and + would be hard to fix. Just always put the cursor + at the end when completing. + Thu Aug 14 17:58:23 2003 Owen Taylor * gtk/gtkfilesel.c (get_current_dir_utf8): If getting diff --git a/ChangeLog.pre-2-8 b/ChangeLog.pre-2-8 index 04026c1b02..61c7dd02ff 100644 --- a/ChangeLog.pre-2-8 +++ b/ChangeLog.pre-2-8 @@ -1,3 +1,16 @@ +Thu Aug 14 18:25:39 2003 Owen Taylor + + * gtk/gtkfilesel.c (gtk_file_selection_populate): + Don't reposition the cursor when we aren't trying + to complete. (Fixes problems with selection on + startup, #108433, reported by Mark Finlay.) + + * gtk/gtkfilesel.c (gtk_file_selection_populate): Remove + code that tried to position the cursor after the common + prefix when there was one, it wasn't working, and + would be hard to fix. Just always put the cursor + at the end when completing. + Thu Aug 14 17:58:23 2003 Owen Taylor * gtk/gtkfilesel.c (get_current_dir_utf8): If getting diff --git a/gtk/gtkfilesel.c b/gtk/gtkfilesel.c index 02d880bf06..5e71abc5c7 100644 --- a/gtk/gtkfilesel.c +++ b/gtk/gtkfilesel.c @@ -301,10 +301,15 @@ static gboolean cmpl_updated_dir (CompletionState* cmpl_state) */ static gchar* cmpl_reference_position (CompletionState* cmpl_state); +#if 0 +/* This doesn't work currently and would require changes + * to fnmatch.c to get working. + */ /* backing up: if cmpl_completion_matches returns NULL, you may query * the index of the last completable character into cmpl_updated_text. */ static gint cmpl_last_valid_char (CompletionState* cmpl_state); +#endif /* When the user selects a non-directory, call cmpl_completion_fullname * to get the full name of the selected file. @@ -2101,7 +2106,6 @@ gtk_file_selection_populate (GtkFileSelection *fs, gchar* sel_text; gint did_recurse = FALSE; gint possible_count = 0; - gint selection_index = -1; g_return_if_fail (GTK_IS_FILE_SELECTION (fs)); @@ -2195,8 +2199,6 @@ gtk_file_selection_populate (GtkFileSelection *fs, } else { - selection_index = cmpl_last_valid_char (cmpl_state) - - (strlen (rel_path) - strlen (rem_path)); if (fs->selection_entry) gtk_entry_set_text (GTK_ENTRY (fs->selection_entry), rem_path); } @@ -2209,9 +2211,8 @@ gtk_file_selection_populate (GtkFileSelection *fs, if (!did_recurse) { - if (fs->selection_entry) - gtk_editable_set_position (GTK_EDITABLE (fs->selection_entry), - selection_index); + if (fs->selection_entry && try_complete) + gtk_editable_set_position (GTK_EDITABLE (fs->selection_entry), -1); if (fs->selection_entry) { @@ -2540,11 +2541,16 @@ cmpl_reference_position (CompletionState *cmpl_state) return cmpl_state->reference_dir->fullname; } +#if 0 +/* This doesn't work currently and would require changes + * to fnmatch.c to get working. + */ static gint cmpl_last_valid_char (CompletionState *cmpl_state) { return cmpl_state->last_valid_char; } +#endif static gchar* cmpl_completion_fullname (const gchar *text,