Fl_File_Chooser: set insert position to end of string (#1004)

... after filename "expansion" with current directory.

Backported from 1.4: commit ecb3c9c6fc.
Code modified to work with 1.3.x.

Updated CHANGES.
This commit is contained in:
Albrecht Schlosser 2024-07-04 16:22:56 +02:00
parent 20e2879ea8
commit f34719851e
2 changed files with 7 additions and 1 deletions

View File

@ -17,6 +17,10 @@ Details:
Albrecht Schlosser:
Add missing FL_EXPORT of class Fl_XFont_On_Demand (#922)
Fix a bunch of compiler warnings (backported from 'master')
Bump version numbers from 1.3.9 to 1.3.10
Update bundled libraries
Fl_File_Chooser: set insert position to end of string (#1004)
... after filename "expansion" with current directory.
ManoloFLTK:
Fix "FLTK on NetBSD very slow on X11 with Unicode locale" (#935)

View File

@ -838,7 +838,9 @@ Fl_File_Chooser::fileNameCB()
#endif /* WIN32 || __EMX__ */
fl_filename_absolute(pathname, sizeof(pathname), filename);
value(pathname);
fileName->mark(fileName->position()); // no selection after expansion
int flen = (int)strlen(pathname); // issue #1004
fileName->position(flen); // issue #1004
fileName->mark(flen); // no selection after expansion
} else if (filename != pathname) {
// Finally, make sure that we have a writable copy...
strlcpy(pathname, filename, sizeof(pathname));