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

OS X: Broken mouse move delivery over non-client area

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Duplicate
    • Icon: P1: Critical P1: Critical
    • None
    • 5.3.2, 5.4.0
    • QPA
    • None
    • OS X 10.10 and 10.9
    • macOS

      • Compile and run the code below
      #include <QWidget>
      #include <QApplication>
      #include <QDebug>
      #include <QMouseEvent>
      
      class W : public QWidget
      {
        void mousePressEvent(QMouseEvent* e)
        {
          qDebug()<<"mousePressEvent"<<e;
        }
        void mouseMoveEvent(QMouseEvent* e)
        {
          qDebug()<<"mouseMove"<<e;
        }
        void mouseReleaseEvent(QMouseEvent* e)
        {
          qDebug()<<"mouseReleaseEvent"<<e;
        }
      
      };
      
      int main(int argc, char *argv[])
      {
        QApplication a(argc, argv);
      
        W w;
      
        w.show();
      
        return a.exec();
      }
      
      
      • press and drag the mouse around. "mouseMove" is printed continuously.
        When you move over the titlebar you will start receiving a stream of mousePressEvent-s instead!

      The bug is surprisingly evil in real life because it breaks almost all mouse interaction which required dragging - content dragging (navigating), widgets dragging ("sliders"), Drag-and-Drop - all.

      Debugging

      Problem is QGuiApplicationPrivate::processMouseEvent receives both
      QWindowSystemInterfacePrivate::FrameStrutMouse and QWindowSystemInterfacePrivate::Mouse for the same event!
      (The Strut is received second, breaking the normal processing of Mouse, most notably because it's buttons are empty, which triggers a special case in processMouseEvent)

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

            sorvig Morten Sørvig
            mnaydenov Mihail Naydenov
            Votes:
            0 Vote for this issue
            Watchers:
            5 Start watching this issue

              Created:
              Updated:
              Resolved:

                There are no open Gerrit changes