Overview
Examples
Screenshots
Comparisons
Applications
Download
Documentation
Tutorials
Bazaar
Status & Roadmap
FAQ
Authors & License
Forums
Funding Ultimate++
Search on this site
Search in forums












SourceForge.net Logo
Home » Extra libraries, Code snippets, applications etc. » OS Problems etc., Win32, POSIX, MacOS, FreeBSD, X11 etc » Clipboard and DnD issues on Linux Mint
Clipboard and DnD issues on Linux Mint [message #50407] Thu, 18 October 2018 13:37
Tom1
Messages: 1212
Registered: March 2007
Senior Contributor
Hi,

I do not seem to be able to drop/paste files dragged/copied from an U++ application to the destop on Linux Mint 19 Cinnamon 64-bit. The other way around, i.e. from Cinnamon desktop to the U++ application, it works fine.

For copy, the desktop context menu does not allow Paste.

For dropping the files, it complains with the following dialog contents:

"Error while copying. 
There was an error getting information about ".".

Show more details
Operation not supported

[Cancel] [Skip All] [Skip] [Retry]


I have tested with this modified version of reference/Dropfiles:
#include <CtrlLib/CtrlLib.h>

using namespace Upp;

struct DndTest : public TopWindow {
	virtual void Paint(Draw &w);
	virtual void DragAndDrop(Point p, PasteClip& d);
	virtual bool Key(dword key, int count);
	virtual void LeftDrag(Point p, dword keyflags);

	Vector<String> files;

	DndTest();
};

void DndTest::Paint(Draw &w)
{
	w.DrawRect(GetSize(), SColorPaper());
	if(files.GetCount())
		for(int i = 0; i < files.GetCount(); i++)
			w.DrawText(2, 2 + i * Draw::GetStdFontCy(), files[i]);
	else
		w.DrawText(2, 2, "None");
}

void DndTest::DragAndDrop(Point p, PasteClip& d)
{
	if(IsDragAndDropSource())
		return;
	if(AcceptFiles(d)) {
		files = GetFiles(d);
		Refresh();
	}
}

bool DndTest::Key(dword key, int count)
{
	if(key == K_CTRL_V) {
		files = GetFiles(Ctrl::Clipboard());
		Refresh();
		return true;
	}
	else if(key == K_CTRL_C) {
		ClearClipboard();
		VectorMap<String, ClipData> data;
		AppendFiles(data, files);
		AppendClipboard(data);
		Refresh();
		return true;
	}
	return false;
}

void DndTest::LeftDrag(Point p, dword keyflags)
{
	if(files.GetCount()) {
		VectorMap<String, ClipData> data;
		AppendFiles(data, files);
		DoDragAndDrop(data, Null, DND_COPY);
	}
}

DndTest::DndTest()
{
	Title("I need files!");
}

GUI_APP_MAIN
{
	DndTest().Run();
}


Note that on Windows this all works well. (CTRL+C, CTRL+V and DnD in both directions.)

Best regards,

Tom
Previous Topic: [Solved] "There were errors"
Next Topic: Building Upp in Solaris 11.4 (x86)
Goto Forum:
  


Current Time: Wed Apr 24 13:34:09 CEST 2024

Total time taken to generate the page: 0.03284 seconds