Drag and drop in linux

You can drag and drop a file from one location to another. I have noticed that it works even outside a desktop environment (icewm) without any daemon running (so no dbus etc...). It works from xfe (a very light filemanager) to emacs (even compiled without dbus). It even works between xfe and an emulated windows in vmware. Does anyone know what is the protocol used? I knew that it existed but I had always assumed that it depended of specific daemons from a specific desktop environment but I am apparently wrong. I have been unable to found anything on this on Google.
Last edited by olive (2011-08-29 07:21:59)

It is part of the X protocols, Xdnd. I have used the Gtk wrappers around it with pygtk. It made things fairly simple.
http://www.pygtk.org/pygtk2tutorial/ch-DragAndDrop.html

Similar Messages

  • Drag-and-drop issue with Linux, KDE

    My application used to work fine, but when i tested it on Linux drag and drop stopped working.
    I used snippet that would take list of supported DataFlavors of Transferable and used for loop to find a javafilelist one. (isJavaFileListType()).
    Well, now, it does that flava scan, but it doesn't find javafilelisttype in the list!
    I tried to retrieve String, serializedobject.. no use. It throws and illegal action exception of DnD or something like that.
    Does anybody know what's wrong, or had similar issues? I use j2 of v 1.5.2
    I shall provide you with more info if it's something totally new.

    I'd be interested in the answer to this too.
    It only just started happening to me a day or so ago, about the time that I think I did an OS upgrade.
    I'm on OSX 10.8.2.
    Its annoying.
    I can drop and drag in Finder but it just affects email.

  • Drag and Drop does not work In Linux

    I have a asimple application that displays the file name and path when a file is dragged and dropped from Windows Explorer to a Java Frame. However, the same operation bombs in Linux. Please advise.

    Hello SixSigma
    I found the way for GNOME but not KDE.
    Here's a little code:
      public boolean importData(JComponent c, Transferable t) {
        if (canImport(c, t.getTransferDataFlavors())) {
          try {
            DataFlavor[] flavors = t.getTransferDataFlavors();
            for (int i = 0; i < flavors.length; i++) {
              // Drop from Windows
              if (DataFlavor.javaFileListFlavor.equals(flavors)) {
    if (t.getTransferData(DataFlavor.javaFileListFlavor) instanceof
    java.util.List) {
    java.util.List fileList = (java.util.List) t.getTransferData(
    DataFlavor.javaFileListFlavor);
    if (fileList.get(0) instanceof File) {
    File f = (File) fileList.get(0);
    // Do whatever with the file
    abrirArchivo(f);
    return true;
    return false;
    return false;
    // Drop from GNOME
    else if (DataFlavor.stringFlavor.equals(flavors[i])) {
    if (t.getTransferData(DataFlavor.stringFlavor) instanceof String) {
    String path = (String) t.getTransferData(DataFlavor.stringFlavor);
    path=dropDesdeGnome(path);
    if (path!=null) {
    File f = new File(path);
    // Do whatever with the file
    abrirArchivo(f);
    return true;
    return false;
    return false;
    catch (UnsupportedFlavorException e) {
    e.printStackTrace();
    return false;
    catch (IOException e) {
    e.printStackTrace();
    return false;
    return false;
      public boolean canImport(JComponent c, DataFlavor[] flavors) {
        for (int i = 0; i < flavors.length; i++) {
          if (DataFlavor.javaFileListFlavor.equals(flavors)) {
    return true;
    else if (DataFlavor.stringFlavor.equals(flavors[i])) {
    return true;
    return false;
      // Take selection's first file and put off the starting "file://" and the "\n"
      private String dropDesdeGnome(String path) {
        if (path.startsWith("file://")) {
          return path.substring(7, path.indexOf("\n")-1);
        return null;
      }Have tested with GNOME 2.2 and 2.6.
    If anyone achieve drop from KDE, please, post it (I love KDE).
    KoKo
    Eneko Nieto
    Universidad Publica de Navarra
    Area de Telematica
    [email protected]

  • File drag and drop from java app to file system - Linux problem

    Hi all,
    I am developing an application for files archiving, with a graphical user interface. The files are showed in a JList, and I implemented drag and drop feature for it. It works well for Windows platform, but not at all for Linux (Ubuntu).
    Under Linux, file export with DND from the archive to file system does not work.
    To extract a file with DND, we can't know the target destination folder, so I create a temp file (file extracted from the archive is wrote to OS tmp dir), and the system is expected to handle the DND action.
    The temp file is correctly created (original data is well retrieved), but Ubuntu does not want to copy or move it via DND.
    I get a system dialog window (while extracting file "test1") :
    Error while moving
    There was an error getting information about "[tmp/60lp1t7egl/test1]".
    Show more details > Operation not supported
    (Cancel, Skip all, Skip, Retry)
    Can it be a rights problem ?
    Any idea ?
    Regards,
    Biibox

    Until the 3rd party image editor developers provide us with the Photos extensions for using their app from within Photo we'll have to export to the Desktop, edit there in the apps and either import the new file into Photos or use it elsewhere.

  • Drag and Drop fails with JDK 7u6 in Linux

    Hi,
    I'm face with a strange bug on JavaFX 2.2 (JDK 7u6, Ubuntu 12); I implemented drag & drop feature of labels in a stage; first time, I open the stage, the drag & drop works well; when I close the stage and reopen it, it fails : I can drag the label but I cannot drop it on the target (the target events are not fired); I can reproduce the bug easily with the class below, you have just to instantiate the class TestDragAndDrop in an application class.
    On window 7, it works well, I cannot reproduce the bug.
    Thank you for your help,
    David
    public class TestDragAndDrop {
        public TestDragAndDrop() {
            Stage stage = new Stage();
            stage.setTitle("Hello Drag And Drop");
            Group root = new Group();
            Scene scene = new Scene(root, 400, 200);
            scene.setFill(Color.LIGHTGREEN);
            final Text source = new Text(50, 100, "DRAG ME");
            source.setScaleX(2.0);
            source.setScaleY(2.0);
            final Text target = new Text(250, 100, "DROP HERE");
            target.setScaleX(2.0);
            target.setScaleY(2.0);
            source.setOnDragDetected(new EventHandler <MouseEvent>() {
                public void handle(MouseEvent event) {
                    /* drag was detected, start drag-and-drop gesture*/
                    System.out.println("onDragDetected");
                    /* allow any transfer mode */
                    Dragboard db = source.startDragAndDrop(TransferMode.ANY);
                    /* put a string on dragboard */
                    ClipboardContent content = new ClipboardContent();
                    content.putString(source.getText());
                    db.setContent(content);
                    event.consume();
            target.setOnDragOver(new EventHandler <DragEvent>() {
                public void handle(DragEvent event) {
                    /* data is dragged over the target */
                    System.out.println("onDragOver");
                    /* accept it only if it is  not dragged from the same node
                     * and if it has a string data */
                    if (event.getGestureSource() != target &&
                            event.getDragboard().hasString()) {
                        /* allow for both copying and moving, whatever user chooses */
                        event.acceptTransferModes(TransferMode.COPY_OR_MOVE);
                    event.consume();
            target.setOnDragEntered(new EventHandler <DragEvent>() {
                public void handle(DragEvent event) {
                    /* the drag-and-drop gesture entered the target */
                    System.out.println("onDragEntered");
                    /* show to the user that it is an actual gesture target */
                    if (event.getGestureSource() != target &&
                            event.getDragboard().hasString()) {
                        target.setFill(Color.GREEN);
                    event.consume();
            target.setOnDragExited(new EventHandler <DragEvent>() {
                public void handle(DragEvent event) {
                    /* mouse moved away, remove the graphical cues */
                    target.setFill(Color.BLACK);
                    event.consume();
            target.setOnDragDropped(new EventHandler <DragEvent>() {
                public void handle(DragEvent event) {
                    /* data dropped */
                    System.out.println("onDragDropped");
                    /* if there is a string data on dragboard, read it and use it */
                    Dragboard db = event.getDragboard();
                    boolean success = false;
                    if (db.hasString()) {
                        target.setText(db.getString());
                        success = true;
                    /* let the source know whether the string was successfully
                     * transferred and used */
                    event.setDropCompleted(success);
                    event.consume();
            source.setOnDragDone(new EventHandler <DragEvent>() {
                public void handle(DragEvent event) {
                    /* the drag-and-drop gesture ended */
                    System.out.println("onDragDone");
                    /* if the data was successfully moved, clear it */
                    if (event.getTransferMode() == TransferMode.MOVE) {
                        source.setText("");
                    event.consume();
            root.getChildren().add(source);
            root.getChildren().add(target);
            stage.setScene(scene);
            stage.show();
        public static void main(String[] args) {
            Application.launch(args);

    DUUUUUUUDE! IT'S WORKING NOW!!!!
    When you originally asked, "What happens if you click on an image and move it to another folder?", I didn't really understand what you were talking about because I almost never have my workspace set up in a way that the folders are showing. I always hide them. So I didn't really understand what you were saying. Just a few minutes ago, I realized that that is what you were asking so I opened up the folder area and tried dragging thumbs into different folders and saw that it does work.
    So then, because of you mentioning that blue line and me know that I did see the blue line on occasion. I went back over into the thumbnails to find out if I always got the blue line or if it was a hit or miss thing. I couldn't believe my eyes when all of the sudden I saw that I no longer was getting that circle with the line through it, and low and behold, the thumbnail dropped right into position like it is supposed to!!!!
    The thing is, I don't know what I've learned from this. I thought, "well, what is different?" The only thing that I can think of is that I now have the folders showing in my workspace so I wondered if that was the secret but I just now hid the folders again like I usually do and the drag and drop into position is STILL WORKING!!!
    All I can figure is that somehow, dragging and dropping a thumbnail into a folder like that for the first time, triggered something so that I can now drag and drop among the thumbnail positions? Not sure. All I know is that for some reason, IT'S WORKING NOW!
    Now, for the second important part, I wonder if I drag and drop everything into the order that I want and then select all of the files and drag them into a new folder, will they stay in that order? I need to go experiment with that.
    If you hadn't kept at it and in turn had me keep trying stuff, it would have never happened because I had pretty much given up.
    Thanks Curt!
    You da man!!!

  • Drag and Drop not working right in IE

    Hi,
    I am using CP8 and created a course that has 2 drag and drop interactions. The first drag and drop works just fine in all browsers, but the second drag and drop isn't releasing the next button (on success) as it should be, but it's only doing that in IE (8 and 11). It works just fine in Safari and Chrome and shows the Next button when the learner gets the answer right.
    Any ideas on why it would be doing that?
    Thanks,
    Kristen

    No-one seems to know jim. Apple don't care about all these bugs in Leopard. They'll release Snow Leopard later this year probably and tell us all to upgrade to that, because it works better.
    Guess I will just have to stick with this flawed OS until I can afford to buy a linux machine.

  • How do I drag and drop an action onto a task flow?

    In How to pass View Object bind variable from ADF page John states that
    You should also consider dragging-and-dropping the executeWithParams operation on your task flow and wiring it to occur before your page instead of putting it in the page definition of the page itself - this way it is more clear what is happening, and is the recommended approach for 11g apps. When you drag-and-drop the operation, you can use the dialog to bind the parameter to your page-flow-scoped variable by supplying the proper EL there.
    How can I drag and drop the executeWithParams method onto a task flow. I am using 11.1.1.5.0 on LINUX?
    I'm presuming I a need a method action in my page flow.
    I have the following action defined in my page def file:
    <action IterBinding="localizedCustomerHierarchyViewIterator"
    id="executeQueryWithParamsForLocalizedCustomerHierarchyView"
    InstanceName="BusinessRulesAMDataControl.LocalizedCustomerHierarchyView"
    DataControl="BusinessRulesAMDataControl" RequiresUpdateModel="true"
    Action="executeWithParams">
    <NamedData NDName="RootEntityId"
    NDValue="#{pageFlowScope.recommendationRule.customerEntityId"
    NDType="java.lang.Long" NDOption="3"/>
    <NamedData NDName="Language"
    NDValue="#{pageFlowScope.recommendationRule.language}"
    NDType="java.lang.String" NDOption="3"/>
    </action>

    In summary, it appears you need the following artifacts in order to initialize a view object from parameters before rendering a .jsff view that relies on that view
    1) a method-call in task flow.xml file:
    <method-call id="executeWithParamsLocalizedCustomerHierarchyView">
    <method id="__5">#{bindings.executeWithParamsLocalizedCustomerHierarchyView.execute}</method>
    <outcome id="__12">
    <fixed-outcome id="__9">initializedLocalizedCustomerHierarchy</fixed-outcome>
    </outcome>
    </method-call>
    2) a control flow rule in the task flow .xml file whose source is (1) and whose destination is the view for which you want to intiialize a view object that supports an iterator that is bound to a list, tree, etc.
    3) an entry for the execute action in the databindings.cpx file
    <page path="/WEB-INF/[email protected]calizedCustomerHierarchyView"
    usageId="oracle_apps_br_view_RecommendationRulePFPageDef"/>
    4) the page def must be defined in the databindings.cpx file
    5) the page def needs to define action and iterator and list (or otherwise) that is used in UI.
    <iterator id="localizedCustomerHierarchyViewIterator"
    Binds="LocalizedCustomerHierarchyView"
    DataControl="BusinessRulesAMDataControl" RangeSize="25" Refresh="never">
    <sortCriteria>
    <sort attribute="Level" ascending="true"/>
    </sortCriteria>
    </iterator>
    <action IterBinding="localizedCustomerHierarchyViewIterator"
    id="executeWithParamsLocalizedCustomerHierarchyView"
    InstanceName="BusinessRulesAMDataControl.LocalizedCustomerHierarchyView"
    DataControl="BusinessRulesAMDataControl" RequiresUpdateModel="true"
    Action="executeWithParams">
    <NamedData NDName="RootEntityId"
    NDValue="#{pageFlowScope.recommendationRule.customerEntityId}"
    NDType="java.lang.Long"/>
    <NamedData NDName="Language"
    NDValue="#{pageFlowScope.recommendationRule.language}"
    NDType="java.lang.String"/>
    </action>
    <list ListOperMode="navigation"
    IterBinding="localizedCustomerHierarchyViewIterator"
    id="customerLocalizedEntityHierarchyList">
    <AttrNames>
    <Item Value="EntityName"/>
    </AttrNames>
    </list>
    6) a backing bean that provides the functions to initialize the parameters for execution
    The easiest way to get most of this is to drag the ExecuteWithParams from within the view in the datacontrols panel right onto the task flow diagram. The downside is that you are left with some pretty poorly named artifacts...
    Did I miss anything?
    -Klaus
    Edited by: klaus gross on Sep 29, 2011 1:00 PM

  • Drag and Drop not Working right

    Since last upgrading to 8.0.2 I have been experiencing problems when trying to Drag and Drop songs into playlists. When I click and hold a song to drag, it will not consistently hold the song. Sometimes it won't hold at all, sometimes when dragging it will bounce the song back to where I clicked on it and sometimes it will just drop wherever it wants to.
    I am also having the same problem when trying to manually drag playlists to my 4GB nano. I have iTunes set to do automatic for my 80 GB iPod Video which works fine, but I set it to manual for the nano.
    When dragging a playlists they sometimes will let go over another playlists as I am moving it and wind up in that one. Other times it will not let me get near the nano and will jump back to where it was. It is very erratic and frustrating.
    Is this an issue with this version og iTunes?
    Thanks,
    Jim

    No-one seems to know jim. Apple don't care about all these bugs in Leopard. They'll release Snow Leopard later this year probably and tell us all to upgrade to that, because it works better.
    Guess I will just have to stick with this flawed OS until I can afford to buy a linux machine.

  • How do I get the student's answers to show on the next slide for drag and drop interaction?

    I'm working with Captivate 7 on a computer running Windows 8.
    I created a simple, one-to-one drag and drop activity using the  Drag and Drop Wizard.
    I want the student's answers to show on the next slide. Specifically, I want the drop source  to show with the drag target that the student connected to the drag source. This way the student can review his/her answers while the program discusses the correct answers.
    Is there anyway to do this?

    * You see the orange (on Linux gray) Firefox button if the Menu Bar is hidden (View > Toolbars > Customize or right-click a toolbar).
    * If you need to access the hidden Menu bar then press F10 or hold down the Alt key to make the Menu Bar appear temporarily.

  • Mousekeys doesn't allow you to Drag and Drop

    I have problems with RSI so I use mousekeys with Linux Gnome Desktop and with Windows. It also works well on my mac but not all features are available.
    Normally the '+' sign corresponds to a double-click and the '0' to holding the mouse key down while you move the mouse (i.e to drag and drop).
    Neither features are (currently) available on the mac (although the help suggests that the '0' can be used for drag and drop).
    Are there any plans to provide full mousekey support in future?
    It would certainly help me.
    mini mac   Mac OS X (10.4.6)  

    The NumPad zero works for me to click-and-hold, please double check that this doesn’t work for you. NumPad zero or five will release whatever you have grabbed with the mouse cursor. Do you need anything else for Drag-and-Drop to work?
    You don’t need a separate key for double-click, just hit the five key twice. You can adjust the double-click activation threshold speed if you are just getting two single clicks in a row rather than a real double-click. People who need Sticky Keys with Mouse Keys tend to use other keyboard shortcuts (like Command-O for open) rather than double-click shortcut.
    For “right” click, hold down (or use Sticky Keys) the Ctrl key with the NumPad five.
    One nice thing about the Mac OS is that double clicking and right clicking are entirely optional. I wish drag and drop was equally superfluous, it is a barrier for VoiceOver users.
    eMac 1.42   Mac OS X (10.4.6)   I paid the going Windows price for a screen reader and got a free computer!

  • SQL Developer - Drag and Drop

    The drag and drop functionality doesn't seem to be working.
    I have it set to Insert in preferences.
    Looks like it is actually dragging the objects (as I see the sheet by the cursor) but once dropped - nothing happens.
    Is there a way to make this work?
    I am on V 2.1.0.63 on Windows 7.
    TIA
    Ant

    I have this intermittently with 2.1: usually drag and drop works. Sometimes not. Sometimes when not changing the preferences can cause it to behave again, sometimes not (so a restart is necessary), sometimes (having given up all hope) it just works again. Mostly it happen on linux X86_64 but windows (32bit) is not immune. If it were not so intermittent and unpredictable I could have submitted a worthwhile bug report by now, but so far I cannot identify any common cause for either nothing happening or the ability to "recover" so I keep looking to the forums and hoping ....

  • Firefox does not allow me to drag and drop files on FTP site anymore. It used to work before.

    Hi. I have a Linux FTP server at a client's office. They used to use IE and I moved them to firefox. They could at one stage, drag and drop (upload) files and documents using only firefox and not a third party software. Somehow this stop working. Is there any setting in firefox that can be changed in order to allow drag and drop without using a third party software? This client is very fussy and does not want to use third party software, as the drag and drop worked before. This is their argument.

    1- of course i know i have to accept the change, i just don't recall specifically whether or not iPhoto itself was one of the recent updates i accepted. lol
    2-this is not true - a few years back, it was a 2 step process. Then it changed with one of the upgrades, and i have been able (as long as i selected 4x3 *book* as opposed to 4x3 *dvd*) to drag between orientations for the past few years - at LEAST 2 years, maybe as many as 4 (I lose track). I remember thinking at the time what a wonderful upgrade that was because it did away with all that needless clicking. Now all of a sudden this month, it has been switched off - am I the only one who has noticed this?
    I have been creating an annual 'family photo album' book via iPhoto for several years now, and i use the 4x3 book sizing specifically for that reason, so I've got lots of experience using this setting. I *know* it used to work the other way.

  • Drag and drop problem On Mac OS

    Hi guys,
    I have a java applet code running well on windows and Linux.it consists of dragging files from a JFileChooser and dropping them to a JTable.
    But the drag and drop feature doesn't work on Mac OS platforms.I don't get any errors log .simply files don't get dropped to JTable.
    In my code i simply use a TableTransferHandler registered on JTable and then setDragEnabled() for JFileChooser.
    What can i do to make my code run correctly on Mac OS ?
    thanks for helping

    For those interested, I got drag and drop working on the Mac. I got some help on the Apple-Dev forums, but basically, if you want to do your own drag and drop on the Mac OSX, you must have your transfer handler support StringFlavor. If it doesn't, it will not work.

  • I want to Sync my iPhone 4 to iTunes however I get an error message from iTunes each time I connect the phone to the PC saying that I should restore to factory settings. Frustrating because it's already annoying enough that I can't drag and drop mp3's!!!

    I have never been so frustrated before in my life with any phone. I find it obnoxious as it is that I cannot simply drag and drop files (especially MP3's) straight from my PC directly into my phone, which I have been used to doing up until now. Everyone who convinced me to get the iPhone has instructed me that my frustration can be fixed by downloading iTunes and syncing it all up via that program (which I have never used before). So, I downloaded the program successfully, however when I connect the iPhone 4 to the PC and iTunes is open, I get an error message that 'iTunes cannot read the content of the iPhone "iPhone" and that I should go to the Preferences tab of the iPhone and select 'restore' to restore this phone to factory settings. First of all, I don't understand why I need to do that. I have already downloaded apps and other important things in the 2 days that I have the phone. I am also scared that it will erase my contacts. This is such a headache. Music is very imporatant to me, but I am getting so frustrated that I don't have freedom over the phone which I thought was supposed to be one of the best out there. I would really appreciate help in this matter. I am sure the phone is great but I am on the verge of taking it back and getting something else.

    Hey joshuafromisr,
    If you resintall iTunes, it should fix the issue. The following document will go over how to remove iTunes fully and then reinstall. Depending on what version of Windows you're running you'll either follow the directions here:
    Removing and Reinstalling iTunes, QuickTime, and other software components for Windows XP
    http://support.apple.com/kb/HT1925
    or here:
    Removing and reinstalling iTunes, QuickTime, and other software components for Windows Vista or Windows 7
    http://support.apple.com/kb/HT1923
    Best,
    David

  • When I drag and drop an icon from the address bar to the desktop is does creat the shortcut but will not display the website icon, only the firefox icon, how can I display website icons?

    When I drag and drop a website icon from the Forefox address bar to the desk top, the short cut is created but the icon that appears is the firefox Icon. I want to disply the icon from the website that the short cut refers to. I have checked all I can think of in my computer to no avail.

    You have to assign the favicon yourself to the desktop shortcut (right-click the shortcut: Properties) after you have dragged the link to the desktop.
    You can usually find the favicon in Tools >Page Info > Media and save the icon there.
    Otherwise use the main domain of the website and add favicon.ico (e.g. mozilla.com/favicon.ico ) to display the favicon in a tab and save that image to a folder.

Maybe you are looking for

  • Home sharing is not working across my network since ios 6 and iTunes upgrades. Any ideas?

    I have updated my IPhone 4, ipad 2, and atv2 to ios6 and my win7 pc to the latest iTunes. I have just noticed homesharing is not working on any devices. I have tried the usual disable re enable etc to no avail. Any help is appreciated.

  • F-54 Balancing field "Profit Center" in line item 002 not filled  Message no. GLT2201

    Hi, During F-54 error "Balancing field "Profit Center" in line item 002 not filled" "Message no. GLT2201"  showing. I have gone through previous posts with  message no. I got below solutions but those applicable belongs to EHP 600 but ours is EHP 605

  • Stack Overflow Exception in EJB Explorer

    Hello everyone! I have correct working EJB which returns in one method and JPA Entity that have bidirectional relationship with other entity. This relationship is @OneToMany and @ManyToOne on other side and all of the related objects are loaded befor

  • Oracle certification study material

    Want to prepare for certification for oracle implementor specialist : GL Exam code 1Z0-516.Please would confirm where will I get study material to preapre for this certification

  • Sequence/update App-v 4.6 package

    Hi, I need to change a bat-file in an existing app.v 4.6 package (add some extra text). Please advise howto do this. I want to create a new package and make it version 2, deploy it and remove current version. J. Jan Hoedt I've found this procedure: h