[declarative/core] Use BypassWindowManagerHint only on platform X11

BypassWindowManagerHint is a flag which is X11 specific. Because of
that for example QtWayland doesn't create a real window for QWindows
with this flag.

Using such a window will eventually result in a freeze of the whole
application. If one renders with QtQuick to such a window, mesa will
request a frame callback from the compositor. Just the compositor
will never deliver the frame rendered callback as it doesn't know the
window exists in the first place and by that doesn't render it and
will never ever deliver the frame rendered callback.

If now one tries to render another frame, mesa notices that it hasn't
got the frame callback and will block the thread till that happens.
With the setup described: that's until eternity.

See Qt Bug: https://bugreports.qt.io/browse/QTBUG-49272

REVIEW: 125961
This commit is contained in:
Martin Gräßlin 2015-11-05 16:33:12 +01:00
parent 0233a7d571
commit ae4ba8920e
3 changed files with 22 additions and 2 deletions

View File

@ -15,6 +15,8 @@ else()
add_definitions(-DHAVE_XCB_SHAPE=0)
endif()
configure_file(config-x11.h.cmake ${CMAKE_CURRENT_BINARY_DIR}/config-x11.h)
set(corebindings_SRCS
corebindingsplugin.cpp
colorscope.cpp

View File

@ -0,0 +1 @@
#cmakedefine01 HAVE_X11

View File

@ -26,6 +26,11 @@
#include <kdeclarative/qmlobjectsharedengine.h>
#include <config-x11.h>
#if HAVE_X11
#include <QX11Info>
#endif
ToolTipDialog::ToolTipDialog(QQuickItem *parent)
: Dialog(parent),
m_qmlObject(0),
@ -35,7 +40,13 @@ ToolTipDialog::ToolTipDialog(QQuickItem *parent)
m_animationsEnabled(true),
m_owner(Q_NULLPTR)
{
setFlags(Qt::ToolTip | Qt::BypassWindowManagerHint);
Qt::WindowFlags flags = Qt::ToolTip;
#if HAVE_X11
if (QX11Info::isPlatformX11()) {
flags = flags | Qt::BypassWindowManagerHint;
}
#endif
setFlags(flags);
setLocation(Plasma::Types::Floating);
m_animation = new QPropertyAnimation(this);
@ -107,7 +118,13 @@ bool ToolTipDialog::event(QEvent *e)
}
bool ret = Dialog::event(e);
setFlags(Qt::ToolTip | Qt::WindowDoesNotAcceptFocus | Qt::WindowStaysOnTopHint | Qt::BypassWindowManagerHint);
Qt::WindowFlags flags = Qt::ToolTip | Qt::WindowDoesNotAcceptFocus | Qt::WindowStaysOnTopHint;
#if HAVE_X11
if (QX11Info::isPlatformX11()) {
flags = flags | Qt::BypassWindowManagerHint;
}
#endif
setFlags(flags);
return ret;
}