Comment 1 for bug 1518705

Revision history for this message
Egmont Koblinger (egmont-gmail) wrote : Re: (gtk3) Can't drag-n-drop link

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);

        ...