Obtain mouse pointer position when dragging over content - Mozilla

This is a discussion on Obtain mouse pointer position when dragging over content - Mozilla ; Hello, We're in a situation where we need to determine the position of the mouse pointer during a drag operation. So far we've discovered the following: - The mousemove event is disabled during a drag operation. - The dragover event ...

+ Reply to Thread
Results 1 to 3 of 3

Thread: Obtain mouse pointer position when dragging over content

  1. Obtain mouse pointer position when dragging over content

    Hello,

    We're in a situation where we need to determine the position of the
    mouse pointer during a drag operation. So far we've discovered the
    following:

    - The mousemove event is disabled during a drag operation.
    - The dragover event is reliable when dragging over XUL content.
    - The dragover event is reliable when dragging external content (say, a
    file) over the HTML content area.

    The problem is that the dragover event is *not* being fired when
    dragging content from an HTML page on top of the same page. There's no
    mousemove event either, so we don't know how to obtain the position of
    the pointer in this case.

    I appreciate any insight in this matter.

    Thanks,

    Jorge

  2. Re: Obtain mouse pointer position when dragging over content

    After some experimentation, we have narrowed down the problem:

    - The dragover and draggesture events are being fired properly, even
    when dragging over the HTML content area.

    - If we try to make an UI update in the code attached to either of these
    events, the update is not performed *if and not before* the pointer is
    moved outside the HTML content area or the drag is canceled.

    - I know my event listeners are being executed because I log to disk
    along with a timestamp. The log is written correctly and at the right
    time. In the same function I try to set a string in the statusbar. The
    string is not set until any of the previous conditions occurs.

    So, what we need to know now is: is there a way to apply these UI
    changes immediately, during a drag operation, just like when dragging on
    top of XUL? Maybe there's a way to force a UI refresh?

    Thank you,

    Jorge

  3. Re: Obtain mouse pointer position when dragging over content

    Some more testing revealed to us that this problem only occurs on Mac
    OS. I opened a bug for it:

    https://bugzilla.mozilla.org/show_bug.cgi?id=393597


    Jorge Villalobos wrote:
    > After some experimentation, we have narrowed down the problem:
    >
    > - The dragover and draggesture events are being fired properly, even
    > when dragging over the HTML content area.
    >
    > - If we try to make an UI update in the code attached to either of these
    > events, the update is not performed *if and not before* the pointer is
    > moved outside the HTML content area or the drag is canceled.
    >
    > - I know my event listeners are being executed because I log to disk
    > along with a timestamp. The log is written correctly and at the right
    > time. In the same function I try to set a string in the statusbar. The
    > string is not set until any of the previous conditions occurs.
    >
    > So, what we need to know now is: is there a way to apply these UI
    > changes immediately, during a drag operation, just like when dragging on
    > top of XUL? Maybe there's a way to force a UI refresh?
    >
    > Thank you,
    >
    > Jorge


+ Reply to Thread