love.mouse.getPosition() inside filedropped or directorydropped callback

Issue #1225 closed
Marco Trosi
created an issue

tested with

OSX 10.8.5

Löve2D 0.10.2

when I call love.mouse.getPosition() inside the filedropped or directorydropped callback then I get the wrong mouse position. I printed the mouse position and I discovered that the mouse position does not get updated as long I hold the mouse button, and when I drop the file or folder and I want to check the position where I dropped it, I get the old mouse position right from where I left the window to get the file/folder.

desired behavior: mouse position gets updated as soon the mouse cursor comes back to the window (with grabbed file/folder) OR filedropped(file,x,y) directorydropped(path,x,y)

best regards


p.s. this was my first issue report ever. sorry if it is not according to some convention.

p.p.s. maybe somebody can confirm that behavior on another system?

Comments (9)

  1. Alex Szpakowski

    What OS are you using? This sounds like platform-specific behaviour that might be able to be worked around in SDL's code (or maybe not), but none of LÖVE's own code will be able to affect this.

  2. Marco Trosi reporter

    see first line of description text

    tested with OSX 10.8.5 , Löve2D 0.10.2

    Thanks for responding so quickly

    do you want me to make a video and upload it somewhere?

  3. Bart van Strien
    • changed status to open

    I've been reading through the SDL code to track this down, and I think the mouse state is updated when handling mouse move events. If you call love.event.pump in the droppedfile callback, do you get the right values afterwards?

  4. Marco Trosi reporter
    function love.filedropped(file)
       print("1", love.mouse.getPosition())
       print("2", love.mouse.getPosition())

    You mean like this? If yes then nope, no change, both prints show the same and wrong position.

  5. Log in to comment