Latest LQ Deal: Complete CCNA, CCNP & Red Hat Certification Training Bundle
Go Back > Forums > Non-*NIX Forums > Programming
User Name
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.


  Search this Thread
Old 07-03-2008, 11:53 PM   #1
Registered: Sep 2005
Posts: 47

Rep: Reputation: 15
Question Handling File Drag & Drop in simple XLIB or OpenGL App (C++)

Can anyone point me in the right direction for allowing my application to be able to receive a file dragged onto it from a the desktop or a file browser.

I need to know the following ...
1) That a file has been dropped (obviously)
2) The path and filename of the file(s)
3) If possible, the screen/window co-ordinates of where the file(s) were dropped

Other Information:
* Application is written in C++, on Linux, and I'm using the Gnome desktop, but want to support other desktops as well.
* Application is either OpenGL, or just displaying a bitmap, where the bitmap occupies the entire window.
* It would be beneficial to avoid the use of other libraries designed to manage buttons, and other GUI controls, since my application is drawing and managing it's own controls.

Later on, I would also like to allow the user to drag a file out of my application onto the desktop, or a file browser, but this is not critical for now.

Any help on this would be greatly appreciated (I mostly need to receive file drops, but any information on dragging files out would also be helpful).

- Stephen Fraser
Old 07-05-2008, 10:29 AM   #2
Registered: Jun 2007
Location: Bavaria
Distribution: slackware, xubuntu
Posts: 143

Rep: Reputation: 22
There's basically only the XDND protocol, which seems to be widely used.

I haven't used it myself yet, but I'm already certain to implement it into my own private xplatform (X11, WIN32) gui framework when time permits (one of the things that didn't have much priority in my case and hence had to wait ).

A quick google should reveal some more infos, providing links like e.g.


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
Drag & Drop problems. mickeyboa Fedora 5 12-30-2007 02:39 PM
xfce4 drag&drop behaviour nilleso Linux - Software 3 04-18-2007 09:54 PM
Drag & Drop STARHARVEST Slackware 1 12-03-2006 01:35 AM
Any way to disable firefox 1.5 drag & drop tabs? fannymites Linux - Software 1 12-24-2005 01:16 AM
Drag & Drop into KView digitalhead Linux - Software 1 03-31-2005 10:59 PM > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 02:40 PM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration