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

QWindow::nativeEvent filters away too much messages/events on win32

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Done
    • Icon: P2: Important P2: Important
    • 5.0.0 Beta 2
    • 5.0.0 Beta 1
    • GUI: Window management
    • None
    • Windows 7 x64
    • dcc2e84fd0cdc90d633d2e5992ab1fc03e2aa861

      Hi,

      I'm trying to extend my Qt-based application with the new taskbar features which have been introduced in Windows 7 (IID_ITaskbarList3) based on the blog posting at http://nicug.blogspot.nl/2011/01/windows-7-taskbar-extensions-in-qt.html

      The blog posting is based on Qt4 (which uses QWindow::winEvent to catch messages sent to the window). To get this working with Qt5 I replaced QWindow::winEvent with QWindow::nativeEvent.

      After testing I've found out that the window messages which I'm interested in ("TaskbarButtonCreated") doesn't get delivered to the QWindow::nativeEvent function.

      I think the cause for this lies in src/plugins/platforms/windows/qwindowscontext.cpp in the function QWindowsContext::windowsProc. This function contains this snippet of code:

      bool QWindowsContext::windowsProc(HWND hwnd, UINT message,
      QtWindows::WindowsEventType et,
      WPARAM wParam, LPARAM lParam, LRESULT *result)
      <snip>
      switch (et) {
      <snip>
      case QtWindows::UnknownEvent:
      return false;
      <snip>
      filterResult = 0;
      if (QWindowSystemInterface::handleNativeEvent(platformWindow->window(), d->m_eventType, &msg, &filterResult))

      { *result = LRESULT(filterResult); return true; }

      The message I'm interested in isn't known by Qt so therefore the et variable will be set to QtWindows::UnknownEvent. This causes the QWindow::nativeEvent to never get triggered for unknown messages.

      Can this behaviour be changed so that unknown messages/events will also get propagated to the QWindow::nativeEvent function ?

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

            kleint Friedemann Kleint
            epienbroek Erik van Pienbroek
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated:
              Resolved:

                There are no open Gerrit changes