[Panel-devel] Plasma::PushButton behaviour

Jason Stubbs jasonbstubbs at gmail.com
Thu Nov 15 17:41:20 CET 2007


On Thursday 15 November 2007 04:33:38 Aaron J. Seigo wrote:
> On Wednesday 14 November 2007, Jason Stubbs wrote:
> > I've also discovered that this still doesn't fix the problem completely.
> > After giving focus to the system tray by clicking on it, a click on a
> > toolbox button will generate a mousePressEvent but no subsequent
> > mouseMoveEvents or mouseReleaseEvent. This happens with or without my
> > patch.
> >
> > I can't see anything in the Qt documentation to explain the above.
> > Perhaps a Qt bug?
>
> could be =/

I've taken the liberty of looking a little further into the above issue. The 
series of events that happen when pressing the button are:

QGraphicsView - WindowActivate
QGraphicsView (viewport) - WindowActivate
SystemTrayWidget - WindowDeactivate
SystemTrayWidget - ActivationChange
QGraphicsView - FocusIn
QGraphicsView - WindowActivate
QGraphicsView (viewport) - WindowActivate
QGraphicsView (viewport) - MouseButtonPress
PushButton::mousePressEvent()
QGraphicsView (viewport) - UpdateRequest
QGraphicsView (viewport) - Paint
SystemTrayWidget - UpdateRequest
SystemTrayWidget - Paint
QGraphicsView - WindowDeactivate
QGraphicsView (viewport) - WindowDeactivate
QGraphicsView - FocusOut
QGraphicsView (viewport) - UpdateRequest
QGraphicsView (viewport) - Paint

In QGraphicsView::viewportEvent(QEvent *event), there is:

    case QEvent::WindowDeactivate:
        // ### This is a temporary fix for until we get proper mouse
        // grab events. mouseGrabberItem should be set to 0 if we lose
        // the mouse grab.
        d->scene->d_func()->mouseGrabberItem = 0;
        break;

Removing that fixes the issue, but I don't know enough about why that's there 
and what removing would break. I think the real issue is that the 
WindowDeactivate is occuring at all. Somewhere during the above events, kwin 
is also doing something although I'm not sure if it's related:

KWin::Workspace::allowClientActivation: Activation: No client active, allowing

If anyone has pointers on how to debug where the WindowDeactivate is being 
generated, I'd be glad to look into it a little further.

--
Jason Stubbs


More information about the Panel-devel mailing list