Uploaded image for project: 'Qt'
  1. Qt
  2. QTBUG-57129

Mouse event coordinates wrong on drag release (Mac only)

    XMLWordPrintable

Details

    • Bug
    • Resolution: Done
    • P2: Important
    • 5.8.0
    • 5.5.1, 5.6.2, 5.7.0
    • GUI: Drag and Drop
    • None
    • OS X El Capitan 10.11.6
      MacBook Pro (Retina, 13-inch, Early 2015)
      Qt 5.6.2
    • macOS

    Description

      When a drag terminates in macOS / OS X, the combined mouse move and button state change events are unpacked and processed as two separate events. These two events have coordinates that are completely unexpected, and incur problems in apps where inadvertent mouse events are handled and the coordinates are taken as being correct.

      I have attached a sample project that demonstrates this using both a pure QML drag operation, and a drag operation that's initiated in C++. Both of them, on mouse release (no matter where), emit the two processed events with incorrect coordinates : mouse move & button state change.

      Example output starts with a normal mouse move location, and we initiate a drag:

      ---------------------- 
       MOUSE MOVE 
      local  :  72.0781 ,  209.148
      global :  1433 ,  -490
      window :  72.0781 ,  209.148
      ---------------------- 
      qml: Cpp Source Rectangle : starting drag
      qml: Cpp Source Rectangle : drag ended
      

      … this will be followed by two events, both with incorrect / unexpected coordinates:

      ---------------------- 
       MOUSE MOVE 
      local  :  1367 ,  -962
      global :  2728 ,  -1661
      window :  1367 ,  -962
      ---------------------- 
      ---------------------- 
       MOUSE RELEASE 
      local  :  1367 ,  -962
      global :  2728 ,  -1661
      window :  1367 ,  -962
      ---------------------- 
      

      Subsequent events now resume to expected coordinates:

      ---------------------- 
       MOUSE MOVE 
      local  :  72 ,  209
      global :  1433 ,  -490
      window :  72 ,  209
      ---------------------- 
      

      Attachments

        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

        Activity

          People

            wearyinside Oleg Yadrov
            dan.erik.petersen Dan Erik Petersen
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes