summaryrefslogtreecommitdiffstats
path: root/src/client
diff options
context:
space:
mode:
authorLiang Qi <liang.qi@qt.io>2017-08-17 10:48:22 +0200
committerLiang Qi <liang.qi@qt.io>2017-08-17 10:48:28 +0200
commite99dae74353e5652794d7bcbcd3d79b1478debbc (patch)
tree6d0ab88f8aa6f464e66429899418f1adf63b0651 /src/client
parente3feecfd96d8fcd65556d325c806153a3495d5b3 (diff)
parent7f70da6a644bc5b690066f0ab4814e1358f57e81 (diff)
Merge remote-tracking branch 'origin/5.9' into dev
Conflicts: .qmake.conf Change-Id: Ia0f9d099e92a40cae7ec506781f70c56415bcf89
Diffstat (limited to 'src/client')
-rw-r--r--src/client/configure.json3
-rw-r--r--src/client/qwaylandinputcontext.cpp6
-rw-r--r--src/client/qwaylandwindow.cpp6
-rw-r--r--src/client/qwaylandxdgshellv6.cpp10
-rw-r--r--src/client/qwaylandxdgshellv6_p.h2
5 files changed, 18 insertions, 9 deletions
diff --git a/src/client/configure.json b/src/client/configure.json
index d216960e1..b11416f68 100644
--- a/src/client/configure.json
+++ b/src/client/configure.json
@@ -28,7 +28,8 @@
"test": "wayland_egl",
"sources": [
{ "type": "pkgConfig", "args": "wayland-egl" },
- "-lwayland-egl"
+ "-lwayland-egl",
+ "-lEGL"
]
},
"xcomposite": {
diff --git a/src/client/qwaylandinputcontext.cpp b/src/client/qwaylandinputcontext.cpp
index dcc4ad5c7..fac5fb840 100644
--- a/src/client/qwaylandinputcontext.cpp
+++ b/src/client/qwaylandinputcontext.cpp
@@ -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);
}
diff --git a/src/client/qwaylandwindow.cpp b/src/client/qwaylandwindow.cpp
index 5bfa158ae..9cc673c0c 100644
--- a/src/client/qwaylandwindow.cpp
+++ b/src/client/qwaylandwindow.cpp
@@ -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;
}
diff --git a/src/client/qwaylandxdgshellv6.cpp b/src/client/qwaylandxdgshellv6.cpp
index 947940213..cd81778c7 100644
--- a/src/client/qwaylandxdgshellv6.cpp
+++ b/src/client/qwaylandxdgshellv6.cpp
@@ -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)
diff --git a/src/client/qwaylandxdgshellv6_p.h b/src/client/qwaylandxdgshellv6_p.h
index 12f7301d5..769f19837 100644
--- a/src/client/qwaylandxdgshellv6_p.h
+++ b/src/client/qwaylandxdgshellv6_p.h
@@ -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;