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

Missing 'mouseMoveEvent' with native widgets on Wayland

    XMLWordPrintable

Details

    • Bug
    • Resolution: Unresolved
    • P2: Important
    • None
    • 5.14.0 Alpha
    • QPA: Wayland
    • None
    • Linux/Wayland

    Description

      When using native widgets on Wayland, 'mouseMoveEvents' are not triggered when moving the mouse over a widget that is set as the central widget of a QMainWindow unless a mouse button is pressed.

      To reproduce:

      1) compile attached sample program "main.cpp"
      2) run the program under Wayland
      3) move the mouse over the widget without pressing any button
      4) observe the qDebug output

      Result: No output is generated. The "mouseMoveEvent" is not triggered while moving the mouse cursor.

      Expected result: The position of the mouse should be printed while moving the mouse cursor.

      Notes:

      • The "mouseMoveEvent" is triggered as expected when pressing a mouse button while moving the mouse cursor.
      • It works as expected when using "alien widgets" instead of "native widgets" (s. [1]), i.e. removing the call to 'setAttribute(Qt::WA_NativeWindow);' in line 18 of the sample program.
      • This works as expected on X11, also with native widgets" in use.
      • This was originally reported against LibreOffice, where this is an issue when the new Qt 5 integration is used on Wayland, s. [2].

      [1] https://doc.qt.io/qt-5/qwidget.html#native-widgets-vs-alien-widgets
      [2] https://bugs.documentfoundation.org/show_bug.cgi?id=122293

      Attachments

        1. main.cpp
          0.9 kB
          Michael Weghorn
        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

        Activity

          People

            johanhelsing Johan Helsing
            michaelweghorn Michael Weghorn
            Votes:
            2 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

              Created:
              Updated:

              Gerrit Reviews

                There are no open Gerrit changes