Merge remote-tracking branch 'origin/5.9' into dev

Conflicts:
	.qmake.conf

Change-Id: Ia0f9d099e92a40cae7ec506781f70c56415bcf89
This commit is contained in:
Liang Qi 2017-08-17 10:48:22 +02:00
commit 70044654d3
5 changed files with 18 additions and 9 deletions

View File

@ -28,7 +28,8 @@
"test": "wayland_egl",
"sources": [
{ "type": "pkgConfig", "args": "wayland-egl" },
"-lwayland-egl"
"-lwayland-egl",
"-lEGL"
]
},
"xcomposite": {

View File

@ -541,8 +541,10 @@ void QWaylandInputContext::setFocusObject(QObject *)
if (window && window->handle() && inputMethodAccepted()) {
if (mCurrentWindow.data() != window) {
struct ::wl_surface *surface = static_cast<QWaylandWindow *>(window->handle())->object();
textInput()->enable(surface);
mCurrentWindow = window;
if (surface) {
textInput()->enable(surface);
mCurrentWindow = window;
}
}
textInput()->updateState(Qt::ImQueryAll, QtWayland::zwp_text_input_v2::update_state_enter);
}

View File

@ -256,8 +256,10 @@ void QWaylandWindow::reset(bool sendDestroyEvent)
if (isInitialized())
destroy();
if (mFrameCallback)
if (mFrameCallback) {
wl_callback_destroy(mFrameCallback);
mFrameCallback = nullptr;
}
}
QWaylandWindow *QWaylandWindow::fromWlSurface(::wl_surface *surface)
@ -725,6 +727,8 @@ QWaylandWindow *QWaylandWindow::transientParent() const
// events.
if (auto transientParent = window()->transientParent())
return static_cast<QWaylandWindow *>(topLevelWindow(transientParent)->handle());
else if (QGuiApplication::focusWindow() && (window()->type() == Qt::ToolTip || window()->type() == Qt::Popup))
return static_cast<QWaylandWindow *>(topLevelWindow(QGuiApplication::focusWindow())->handle());
return nullptr;
}

View File

@ -163,8 +163,8 @@ void QWaylandXdgSurfaceV6::setAppId(const QString &appId)
void QWaylandXdgSurfaceV6::setType(Qt::WindowType type, QWaylandWindow *transientParent)
{
if (type == Qt::Popup && transientParent) {
setPopup(transientParent, m_window->display()->lastInputDevice(), m_window->display()->lastInputSerial());
if ((type == Qt::Popup || type == Qt::ToolTip) && transientParent) {
setPopup(transientParent, m_window->display()->lastInputDevice(), m_window->display()->lastInputSerial(), type == Qt::Popup);
} else {
setToplevel();
if (transientParent) {
@ -189,7 +189,7 @@ void QWaylandXdgSurfaceV6::setToplevel()
m_toplevel = new Toplevel(this);
}
void QWaylandXdgSurfaceV6::setPopup(QWaylandWindow *parent, QWaylandInputDevice *device, int serial)
void QWaylandXdgSurfaceV6::setPopup(QWaylandWindow *parent, QWaylandInputDevice *device, int serial, bool grab)
{
Q_ASSERT(!m_toplevel && !m_popup);
@ -209,7 +209,9 @@ void QWaylandXdgSurfaceV6::setPopup(QWaylandWindow *parent, QWaylandInputDevice
m_popup = new Popup(this, parentXdgSurface, positioner);
positioner->destroy();
delete positioner;
m_popup->grab(device->wl_seat(), serial);
if (grab) {
m_popup->grab(device->wl_seat(), serial);
}
}
void QWaylandXdgSurfaceV6::zxdg_surface_v6_configure(uint32_t serial)

View File

@ -121,7 +121,7 @@ private:
};
void setToplevel();
void setPopup(QWaylandWindow *parent, QWaylandInputDevice *device, int serial);
void setPopup(QWaylandWindow *parent, QWaylandInputDevice *device, int serial, bool grab);
QWaylandXdgShellV6 *m_shell;
QWaylandWindow *m_window;