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", "test": "wayland_egl",
"sources": [ "sources": [
{ "type": "pkgConfig", "args": "wayland-egl" }, { "type": "pkgConfig", "args": "wayland-egl" },
"-lwayland-egl" "-lwayland-egl",
"-lEGL"
] ]
}, },
"xcomposite": { "xcomposite": {

View File

@ -541,9 +541,11 @@ void QWaylandInputContext::setFocusObject(QObject *)
if (window && window->handle() && inputMethodAccepted()) { if (window && window->handle() && inputMethodAccepted()) {
if (mCurrentWindow.data() != window) { if (mCurrentWindow.data() != window) {
struct ::wl_surface *surface = static_cast<QWaylandWindow *>(window->handle())->object(); struct ::wl_surface *surface = static_cast<QWaylandWindow *>(window->handle())->object();
if (surface) {
textInput()->enable(surface); textInput()->enable(surface);
mCurrentWindow = window; mCurrentWindow = window;
} }
}
textInput()->updateState(Qt::ImQueryAll, QtWayland::zwp_text_input_v2::update_state_enter); 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()) if (isInitialized())
destroy(); destroy();
if (mFrameCallback) if (mFrameCallback) {
wl_callback_destroy(mFrameCallback); wl_callback_destroy(mFrameCallback);
mFrameCallback = nullptr;
}
} }
QWaylandWindow *QWaylandWindow::fromWlSurface(::wl_surface *surface) QWaylandWindow *QWaylandWindow::fromWlSurface(::wl_surface *surface)
@ -725,6 +727,8 @@ QWaylandWindow *QWaylandWindow::transientParent() const
// events. // events.
if (auto transientParent = window()->transientParent()) if (auto transientParent = window()->transientParent())
return static_cast<QWaylandWindow *>(topLevelWindow(transientParent)->handle()); 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; return nullptr;
} }

View File

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

View File

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