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

QCursor::pos stuck at (0, 0) until mouse click/move (wayland, kwin)

    XMLWordPrintable

Details

    • Linux/Wayland
    • f6cdb37f6 (dev), 304bf0ef6 (6.9), 4c8a7a77b (6.8)

    Description

      On wayland (kde), `QCursor::pos()` always returns `(0,0)`, until the first mouse click or mouse move.

      Running the program with `WAYLAND_DEBUG=1`, I can verify that `wl_pointer enter` is generated with the correct cursor position. Tabbing in and tabbing out, I see the correct `wl_pointer` enter and leave events, but `QCursor::pos()` still reports `(0, 0)`. The correct cursor positions are reported after mouse press, or mouse move.

      Example code is attached.

      I did not test on earlier Qt versions.

      Attachments

        1. Main.qml
          0.1 kB
          Yifan Zhu
        2. main.cpp
          0.8 kB
          Yifan Zhu
        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

        Activity

          People

            srutledg Shawn Rutledge
            fanzhuyifan Yifan Zhu
            Votes:
            1 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes