Add Qt::WindowDoesNotAcceptFocus to our initial window flags on deco

Qt requests focus on a mouse press event on the QWindow of a QWidget.
This results in our active window losing focus when a mouse press on
the window decoration happens.

Of course we don't need Qt to request focus on the window decoration.
If it's the inactive window we will activate it by ourself. If it's
the active window, well it's already active.

Adding Qt::WindowDoesNotAcceptFocus to the initial window flags
ensures that this behavior in Qt gets disables with the result that
the window no longer loses focus on mouse click on decoration.

I declare this to be the most difficult one line change in my life.
This commit is contained in:
Martin Gräßlin 2013-09-13 10:13:21 +02:00
parent eeb095f1e7
commit e71c921ad2

View file

@ -186,7 +186,7 @@ QWidget* Bridge::initialParentWidget() const
Qt::WindowFlags Bridge::initialWFlags() const
{
return 0;
return Qt::WindowDoesNotAcceptFocus;
}
QRegion Bridge::unobscuredRegion(const QRegion& r) const