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

Wacom tablet input not working in Qt Quick

    XMLWordPrintable

Details

    • Windows
    • 786c58817187bb18552934c807ba7a7ea845f49e (qt/qtbase/5.12)

    Description

      After upgrading from 5.11.1 to 5.12.X QML windows no longer reacted to Wacom tablet input (move, press, release) when in 'Pen mode'. The QML content is placed inside QQuickViews.

      After digging up a bit, I discovered two things:

      1. QQuickWindow's handleMouseEvent() disgards any events, marked as Qt::MouseEventSynthesizedBySystem.

      if (event->source() == Qt::MouseEventSynthesizedBySystem) {
          event->accept();
          return;
      }

      2. As of 5.12.X, the 'qtbase/src/plugins/platforms/windows/qwindowscontext.cpp' seems to have been extended to specifically handle tablet (pointer) input:

      case QtWindows::MouseWheelEvent:
      case QtWindows::MouseEvent:
      case QtWindows::LeaveEvent:
      {
          QWindow *window = platformWindow->window();
          while (window && (window->flags() & Qt::WindowTransparentForInput))
              window = window->parent();
          if (!window)
              return false;
          if (d->m_systemInfo & QWindowsContext::SI_SupportsPointer)
              return sessionManagerInteractionBlocked() || d->m_pointerHandler.translateMouseEvent(window, hwnd, et, msg, result);
          else
              return sessionManagerInteractionBlocked() || d->m_mouseHandler.translateMouseEvent(window, hwnd, et, msg, result);
      }
      break;
      

      That effectively marks all mouse events, synthesized from tablet input, as Qt::MouseEventSynthesizedBySystem. And though it does make sense, it renders all QtQuick.Controls, MouseAreas, etc unoperable.

      In fact, at some point Qt Widgets stopped working for me too. It must have been in 5.12.1 or 5.12.2. No such issue in 5.12.4.

      If it's meant to work that way and there's a misunderstanding from my side, please tell me what am I missing. I did search the web before posting this out. Although the fact that my project worked in 5.11.1 makes me think it's a bug.

       

      To reproduce the bug, simply load any QML file with MouseArea in. It will react to mouse input, but not to the tablet.

       

      Attachments

        Issue Links

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

          Activity

            People

              anrocha André De La Rocha (Inactive)
              nerodsm nerodsm
              Votes:
              2 Vote for this issue
              Watchers:
              8 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Gerrit Reviews

                  There is 1 open Gerrit change