Bug 92668 - KDE doesn't comply with XDND. TARGETS atom is left empty.
Summary: KDE doesn't comply with XDND. TARGETS atom is left empty.
Status: RESOLVED FIXED
Alias: None
Product: kde
Classification: I don't know
Component: general (show other bugs)
Version: unspecified
Platform: openSUSE Linux
: NOR normal
Target Milestone: ---
Assignee: Lubos Lunak
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2004-11-04 09:44 UTC by Gabriel de PErthuis
Modified: 2020-09-29 04:11 UTC (History)
2 users (show)

See Also:
Latest Commit:
Version Fixed In:
Sentry Crash Report:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Gabriel de PErthuis 2004-11-04 09:44:28 UTC
Version:            (using KDE KDE 3.3.1)
Installed from:    SuSE RPMs
OS:                Linux

According to XDND, when drag & dropping, a TARGETS Atom listing all available targets (as a list of other Atom s, generally named after their mime type) is provided.
But, nothing is provided.
Here is how I get targets, using Gtk/Gdk; this works with Gtk, Mozilla, and Motif; but outputs only null strings with KDE.

//in a drag-drop signal handler

  GtkClipboard *cboard =
	gtk_clipboard_get(gdk_drag_get_selection(drag_context));

    gtk_clipboard_request_targets(cboard, print_received_targets, NULL);
//Try it another way:
gtk_clipboard_request_contents(cboard, gdk_atom_intern("TARGETS", FALSE), print_data_from_clipboard, NULL);

//With:
void print_data_from_clipboard(GtkClipboard * clipboard,
			       GtkSelectionData * selection_data,
			       gpointer data)
{
    g_printf("print_data_from_clipboard\n");
    print_gtk_selection_data(selection_data);
}

//And:
void print_gtk_selection_data(GtkSelectionData * seldat)
{
    gchar *as_text = gtk_selection_data_get_text(seldat);
    if (as_text) {
	g_printf("As utf-8 text: %s\n", as_text);
	g_free(as_text);
    }
    g_printf("As raw bytes:\n");

    int i;
    for (i = 0; i < seldat->length; i++) {
	g_printf("%c", seldat->data[i]);
    }
    g_printf("\n");
}
Comment 1 Lubos Lunak 2004-11-04 14:34:30 UTC
It seems TARGETS is really not provided, but I don't see why you don't simply read the DND types normally like everybody else does (XdndTypeList).
Comment 2 Gabriel de PErthuis 2004-11-05 18:34:22 UTC
You're right, the XDND spec doesn't require TARGETS to be set, though it mentions it (http://freedesktop.org/Standards/XDND). So the title is a bit over-alarming.

It would still be a good idea to support it. The underlying object is an X selection in both cases, and these usually support TARGETS. This would make drag and drop consistent with other objects using X selections, like clipboards - drag and dropping is just creating a temporary clipboard.
Comment 3 Stephan Binner 2004-12-04 10:13:32 UTC
*** This bug has been marked as a duplicate of 89451 ***
Comment 4 Lubos Lunak 2004-12-05 14:51:04 UTC
Not really a duplicate of #89451.
Comment 5 Médéric Boquien 2008-11-09 04:21:41 UTC
Hello,

Can you still reproduce the bug with the latest KDE 4 release?

Thanks.
Comment 6 shamousi 2008-12-23 22:16:02 UTC
Maybe this bug is connected to bug 36297 

see http://bugs.kde.org/show_bug.cgi?id=36297



Comment 7 Nate Graham 2020-09-29 04:11:52 UTC
Apparently not. :)