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

QWindow::mapToGlobal calculate global point incorrect

    XMLWordPrintable

Details

    • Linux/Wayland

    Description

      void QWaylandInputDevice::Pointer::pointer_motion(uint32_t time, wl_fixed_t surface_x, wl_fixed_t surface_y)
      Unknown macro: { QWaylandWindow *window = focusWindow(); if (!window) Unknown macro}
      QPointF pos(wl_fixed_to_double(surface_x), wl_fixed_to_double(surface_y));
      QPointF delta = pos - pos.toPoint();
      QPointF global = window->window()->mapToGlobal(pos.toPoint());
      global += delta;

      mSurfacePos = pos;
      mGlobalPos = global;
      mParent->mTime = time;

      QWaylandWindow *grab = QWaylandWindow::mouseGrab();
      if (grab && grab != window)
      Unknown macro:

      Unknown macro: { // We can't know the true position since we're getting events for another surface, // so we just set it outside of the window boundaries. pos = QPointF(-1, -1); global = grab->window()->mapToGlobal(pos.toPoint()); window = grab; }

      setFrameEvent(new MotionEvent(window, time, pos, global, mButtons, mParent->modifiers()));
      }

      Which line is marked in red, isn't considered QWindow's devicePixelsRatio. If QT_SCALE_FACTOR > 1.0, the global point will be incorrect and we use QCursor::pos() function to get global point also be incorrect.

      Attachments

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

        Activity

          People

            michealchen Chen Gong
            michealchen Chen Gong
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes