Can't drag-n-drop link

Bug #1518705 reported by Egmont Koblinger
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Terminator
Fix Released
Undecided
Unassigned

Bug Description

Drag-n-drop a link from your browser (tested with ff & chrome) to terminator. It doesn't work.

(terminator:12345): Vte-WARNING **: Error (Invalid or incomplete multibyte or wide character) converting data for child, dropping.

(even if the URL is plain ASCII)

(See also bug 1498819)

Related branches

Revision history for this message
Egmont Koblinger (egmont-gmail) wrote :

Drag-n-dropping from e.g. Gnome's file manager "Files" works as expected.

From firefox, the data we receive is encoded in UTF-16 wtf??

Looks like a ff bug that we have to workaround.

From gnome-terminal:

    case TARGET_MOZ_URL:
      {
        char *utf8_data, *newline, *text;
        char *uris[2];
        gsize len;

        /* MOZ_URL is in UCS-2 but in format 8. BROKEN!
         *
         * The data contains the URL, a \n, then the
         * title of the web page.
         */
        if (selection_data_format != 8 ||
            selection_data_length == 0 ||
            (selection_data_length % 2) != 0)
          return;

        utf8_data = g_utf16_to_utf8 ((const gunichar2*) selection_data_data,
                                     selection_data_length / 2,
                                     NULL, NULL, NULL);

        ...

Revision history for this message
Egmont Koblinger (egmont-gmail) wrote :
Revision history for this message
Egmont Koblinger (egmont-gmail) wrote :

Note: the dnd text is two lines: one is the URL, the second is the visible text. Process only the first line, as expected.

g-t contains a few safety check (data_format needs to be 8, etc.) which I didn't care porting, but feel free to make it more robust.

Revision history for this message
Stephen Boddy (stephen-j-boddy) wrote :

Affected gtk2 too.

Changed in terminator:
status: New → Fix Committed
summary: - (gtk3) Can't drag-n-drop link
+ Can't drag-n-drop link
Changed in terminator:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Patches

Remote bug watches

Bug watches keep track of this bug in other bug trackers.