Details
-
Bug
-
Resolution: Invalid
-
P2: Important
-
4.6.2
-
None
-
linux - framebuffer
Description
If a child of a widget obscures a parent widget, and that parent has the attribute WA_TransparentForMouseEvents set, mouse events that should be handled by the child widget are not directed to the child widget.
I believe the issue is that WA_TransparentForMouseEvents is checked too soon in QWidgetPrivate::childAt_helper. Here is a context diff for a tested fix.
***************
-
-
- 9580,9587 ****
)) {
if (ignoreChildrenInDestructor && w->data->in_destructor)
continue;
- 9580,9587 ****
-
- if (w->testAttribute(Qt::WA_TransparentForMouseEvents))
- continue;
QPoint childPoint = w->mapFromParent(p);
#ifdef Q_WS_MAC
if (includeFrame && !w->geometry().contains(p))-
- 9580,9585 ----
***************
- 9589,9594 ****
- 9587,9594 ----
#endif
if (QWidget *t = w->d_func()->childAt_helper(childPoint, ignoreChildrenInDestructor))
return t;
+ if (w->testAttribute(Qt::WA_TransparentForMouseEvents))
+ continue;
// if WMouseNoMask is set the widget mask is ignored, if
// the widget has no mask then the WMouseNoMask flag has no
// effect
- 9580,9585 ----
-