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

Windows: QApplication::widgetAt fails to handle applications with non-square shapped windows

    XMLWordPrintable

Details

    • 0f417efe0fb37d03d2c1e98958d4213d263c90c0 (qtbase/5.12, 29.5.2019, 5.12.5)

    Description

      If you install an application, like Jing http://www.techsmith.com/jing.html, QApplication::widgetAt fails to accurately find a Qt application beneath it.

      The Jing application creates a 150 by 150 pixel window but only draws in parts of it and everything beneath is transparent. When mouse hit testing, only when the mouse is over the visible parts, should QApplication::widgetAt not return the QT app beneath. This is again due to fundamental differences in the Win32 API's used to determine a window. WindowFromPoint does very different hit testing and a deeper search then ChildWindowAt which is what is currently being used. The fix for https://bugreports.qt-project.org/browse/QTBUG-40555 does not fix this issue here. Qt 4.8.x used WindowFromPoint and it seems that this is the only API of the window picking API's that can properly detect a window with accuracy.

      I created a sample Win32 app to compare the API's side by side and sure enough the WindowFromPoint is far more accurate.

      See this blog http://blogs.msdn.com/b/oldnewthing/archive/2010/12/30/10110077.aspx

      Attachments

        1. qtbug40815_wfp.diff
          0.8 kB
        2. qtbug40815_workaround.diff
          1 kB
        3. qtbug40815.zip
          3 kB

        Issue Links

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

          Activity

            People

              kleint Friedemann Kleint
              nteeuwentableau Nicolas Teeuwen
              Votes:
              0 Vote for this issue
              Watchers:
              6 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Gerrit Reviews

                  There are no open Gerrit changes