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

QWindowsContext::findPlatformWindowAt stuck in infinite loop

    XMLWordPrintable

Details

    • Windows
    • cb51ab41e8 (qt/qtbase/dev) cb51ab41e8 (qt/tqtc-qtbase/dev) 85d22b0c61 (qt/tqtc-qtbase/6.2) c241a206df (qt/qtbase/6.3) c241a206df (qt/tqtc-qtbase/6.3) c8cdc3eb96 (qt/qtbase/6.4) c8cdc3eb96 (qt/tqtc-qtbase/6.4) 964ba25ff8 (qt/tqtc-qtbase/5.15)

    Description

      \qtbase\src\plugins\platforms\windows\qwindowscontext.cpp

      There is this line of code that causes an infinite loop if "parent"is not updated.

      while (findPlatformWindowHelper(screenPoint, cwex_flags, this, &parent, &result)) {}

      This is what happens if the line:

      const HWND nonTransparentChild = ChildWindowFromPointEx(*hwnd, point, cwexFlags | CWP_SKIPTRANSPARENT);

      returns 'nonTransparentChild' == *hwnd
      (that is, the function returns the parent, and not null, and not a child. This is legal, according to the Microsoft ChildWindowFromPointEx description).

      I have a case where this happens: the top-level window is a transparent window.

      Possible solution that works for me: changing:

      *result = nonTransparentWindow;
      *hwnd = nonTransparentChild;
      

      To

      *result = nonTransparentWindow;
      if (*hwnd == nonTransparentChild)
      	return false;
      *hwnd = nonTransparentChild;
      

      Attachments

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

        Activity

          People

            vestbo Tor Arne Vestbø
            jirauser26727 user-04d21 (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: