diff options
| author | ManoloFLTK <41016272+ManoloFLTK@users.noreply.github.com> | 2023-03-06 11:08:04 +0100 |
|---|---|---|
| committer | ManoloFLTK <41016272+ManoloFLTK@users.noreply.github.com> | 2023-03-06 11:08:04 +0100 |
| commit | f89a9f9efcdcecb5a5789ec930425e32ac9cb9ee (patch) | |
| tree | 772f99e25b09e767593aa93167361be88ba5f135 /documentation/src | |
| parent | a52811567ebcd8c9ad96aded3c7581b9cfd78caa (diff) | |
DnD of filenames: make Wayland behave as Windows and macOS
and also add more detailed documentation of platform-specific behaviors.
Diffstat (limited to 'documentation/src')
| -rw-r--r-- | documentation/src/events.dox | 25 | ||||
| -rw-r--r-- | documentation/src/wayland.dox | 3 |
2 files changed, 16 insertions, 12 deletions
diff --git a/documentation/src/events.dox b/documentation/src/events.dox index 26a3cda83..2dc1c7b25 100644 --- a/documentation/src/events.dox +++ b/documentation/src/events.dox @@ -268,16 +268,7 @@ selection indication. Most modern programs ignore this. FLTK supports drag and drop of text and files from any application on the desktop to an FLTK widget. Text is transferred -using UTF-8 encoding. Files are received as a list of full path -and file names, separated by newline. - -On some X11 platforms and with Wayland, files are received as a URL-encoded UTF-8 string, -that is, non-ASCII bytes (and a few others such as space and %) are -replaced by the 3 bytes "%XY" where XY are the byte's hexadecimal value. -The \ref fl_decode_uri() function can be used to transform in-place -the received string into a proper UTF-8 string. On these platforms, -strings corresponding to dropped files are further prepended -by <tt>file://</tt> (or other prefixes such as <tt>computer://</tt>). +using UTF-8 encoding. See Fl::dnd() for drag and drop from an FLTK widget. @@ -290,6 +281,20 @@ depends on the protocol used on each platform. \p FL_DND_* events cannot be used in widgets derived from Fl_Group or Fl_Window. +\subsection events_fl_dnd_files Dropped filenames +Files are received as a list of full path and file names. +- On some X11 platforms, files are received as a URL-encoded UTF-8 string, +that is, non-ASCII bytes (and a few others such as space and %) are +replaced by the 3 bytes "%XY" where XY are the byte's hexadecimal value. +The \ref fl_decode_uri() function can be used to transform in-place +the received string into a proper UTF-8 string. On these platforms, +strings corresponding to dropped files are further prepended +by <tt>file://</tt> (or other prefixes such as <tt>computer://</tt>). +- Other X11 situations put all dropped filenames in a single line, separated by +spaces. +- On non-X11 platforms, including Wayland, files dropped are received one +pathname per line, with no <tt>'\\n'</tt> after the last pathname. + \subsection events_fl_dnd_enter FL_DND_ENTER The mouse has been moved to point at this widget. A widget that is diff --git a/documentation/src/wayland.dox b/documentation/src/wayland.dox index 3dfa4d733..0b6b9aca0 100644 --- a/documentation/src/wayland.dox +++ b/documentation/src/wayland.dox @@ -763,8 +763,7 @@ FLTK can copy or paste plain UTF-8 text or image data to/from the clipboard. Ima clipboard as \c image/bmp mime type. Images in \c image/bmp or \c image/png mime types from the clipboard can be pasted to FLTK apps. -Files dropped are received one per line with URL-encoded UTF-8 names prepended by -<tt>file://</tt> (see \ref events_dnd). +Files dropped are received one pathname per line, with no '\n' after the last pathname. \section wayland-egl EGL as support for OpenGL |
