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

Expose functionality of QWidgetPrivate::grabMouseWhileInWindow through public API

XMLWordPrintable

    • Icon: Suggestion Suggestion
    • Resolution: Unresolved
    • Icon: P2: Important P2: Important
    • None
    • None
    • GUI: Drag and Drop
    • None

      For a long time we have had reports about drag&drop freezing the Windows desktop in Bauhaus on Windows.

      Turns out that this is a known issue inside Qt:

      From qwidget.cpp:

      /* Works only as long as pointer is inside the application's window,
      which is good enough for QDockWidget.
      
      Doesn't call SetWindowsHookEx() - this function causes a system-wide
      freeze if any other app on the system installs a hook and fails to
      process events. */
      void QWidgetPrivate::grabMouseWhileInWindow()
      ...
      

      and e.g. qdockwidget.cpp then does

      #ifdef Q_OS_WIN
                grabMouseWhileInWindow()
      #else
                grabMouse()
      #endif
      

      Interestingly, e.g. widgets/resizehandler.cpp again uses grabMouse(), even on Windows, which probably might lead to freezes there too ...

      We should allow customers (& QtCreator) to do the very same 'tricks' we do internally to avoid lock-ups, and expose grabMouseWhileInWindow(). I'd even go for making it the default behavior on Windows, since 'misbehaving' programs that causes these freezes seems to be very common.

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

            Unassigned Unassigned
            kkohne Kai Köhne
            Votes:
            3 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:

                There are no open Gerrit changes