summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorQt Forward Merge Bot <qt_forward_merge_bot@qt-project.org>2019-12-10 03:03:32 +0100
committerQt Forward Merge Bot <qt_forward_merge_bot@qt-project.org>2019-12-10 03:03:32 +0100
commit47c5f14f1f4715a7ae129969ef81649d243a30da (patch)
treee8309c8c90349f6b1b54163308b1ccb362ef0055
parente0ceb66ebb47f693051f079d30d2e5de72fbd5b3 (diff)
parent1d0863049111926e0ff827cf17f3a7087d53c5c3 (diff)
Merge remote-tracking branch 'origin/5.14' into 5.15
-rw-r--r--src/client/qwaylandwindow.cpp3
-rw-r--r--src/hardwareintegration/client/wayland-egl/qwaylandglcontext.cpp2
-rw-r--r--src/hardwareintegration/compositor/linux-dmabuf-unstable-v1/linuxdmabuf.h4
-rw-r--r--tests/auto/client/xdgshell/tst_xdgshell.cpp47
4 files changed, 52 insertions, 4 deletions
diff --git a/src/client/qwaylandwindow.cpp b/src/client/qwaylandwindow.cpp
index 751058d89..a6134cf49 100644
--- a/src/client/qwaylandwindow.cpp
+++ b/src/client/qwaylandwindow.cpp
@@ -426,8 +426,7 @@ void QWaylandWindow::setVisible(bool visible)
// QWaylandShmBackingStore::beginPaint().
} else {
sendExposeEvent(QRect());
- if (window()->type() == Qt::Popup)
- closePopups(this);
+ closePopups(this);
reset();
}
}
diff --git a/src/hardwareintegration/client/wayland-egl/qwaylandglcontext.cpp b/src/hardwareintegration/client/wayland-egl/qwaylandglcontext.cpp
index 5bd2760d0..7679a5fb3 100644
--- a/src/hardwareintegration/client/wayland-egl/qwaylandglcontext.cpp
+++ b/src/hardwareintegration/client/wayland-egl/qwaylandglcontext.cpp
@@ -312,7 +312,7 @@ QWaylandGLContext::QWaylandGLContext(EGLDisplay eglDisplay, QWaylandDisplay *dis
// Create an EGL context for the decorations blitter. By using a dedicated context we don't need to make sure to not
// change the context state and we also use OpenGL ES 2 API independently to what the app is using to draw.
- QVector<EGLint> eglDecorationsContextAttrs = { EGL_CONTEXT_CLIENT_VERSION, 1, EGL_NONE };
+ QVector<EGLint> eglDecorationsContextAttrs = { EGL_CONTEXT_CLIENT_VERSION, 2, EGL_NONE };
m_decorationsContext = eglCreateContext(m_eglDisplay, m_config, m_context, eglDecorationsContextAttrs.constData());
if (m_decorationsContext == EGL_NO_CONTEXT)
qWarning("QWaylandGLContext: Failed to create the decorations EGLContext. Decorations will not be drawn.");
diff --git a/src/hardwareintegration/compositor/linux-dmabuf-unstable-v1/linuxdmabuf.h b/src/hardwareintegration/compositor/linux-dmabuf-unstable-v1/linuxdmabuf.h
index 8554721e1..02b5b6f88 100644
--- a/src/hardwareintegration/compositor/linux-dmabuf-unstable-v1/linuxdmabuf.h
+++ b/src/hardwareintegration/compositor/linux-dmabuf-unstable-v1/linuxdmabuf.h
@@ -58,6 +58,10 @@
#define DRM_FORMAT_MOD_INVALID fourcc_mod_code(NONE, DRM_FORMAT_RESERVED)
#endif
+// Copied from eglmesaext.h
+typedef EGLBoolean (EGLAPIENTRYP PFNEGLBINDWAYLANDDISPLAYWL) (EGLDisplay dpy, struct wl_display *display);
+typedef EGLBoolean (EGLAPIENTRYP PFNEGLUNBINDWAYLANDDISPLAYWL) (EGLDisplay dpy, struct wl_display *display);
+
QT_BEGIN_NAMESPACE
class QWaylandCompositor;
diff --git a/tests/auto/client/xdgshell/tst_xdgshell.cpp b/tests/auto/client/xdgshell/tst_xdgshell.cpp
index ac5c24988..2277bbb80 100644
--- a/tests/auto/client/xdgshell/tst_xdgshell.cpp
+++ b/tests/auto/client/xdgshell/tst_xdgshell.cpp
@@ -46,6 +46,7 @@ private slots:
void popup();
void tooltipOnPopup();
void switchPopups();
+ void hidePopupParent();
void pongs();
void minMaxSize();
void windowGeometry();
@@ -219,8 +220,8 @@ void tst_xdgshell::popup()
p->sendFrame(c);
uint serial = p->sendButton(client(), BTN_LEFT, Pointer::button_state_pressed);
p->sendButton(c, BTN_LEFT, Pointer::button_state_released);
- return serial;
p->sendFrame(c);
+ return serial;
});
QTRY_VERIFY(window.m_popup);
@@ -429,6 +430,50 @@ void tst_xdgshell::switchPopups()
QCOMPOSITOR_TRY_VERIFY(xdgPopup()->m_xdgSurface->m_committedConfigureSerial);
}
+void tst_xdgshell::hidePopupParent()
+{
+ class Window : public QRasterWindow {
+ public:
+ void mousePressEvent(QMouseEvent *event) override
+ {
+ QRasterWindow::mousePressEvent(event);
+ m_popup.reset(new QRasterWindow);
+ m_popup->setTransientParent(this);
+ m_popup->setFlags(Qt::Popup);
+ m_popup->resize(100, 100);
+ m_popup->show();
+ }
+ QScopedPointer<QRasterWindow> m_popup;
+ };
+ Window window;
+ window.resize(200, 200);
+ window.show();
+
+ QCOMPOSITOR_TRY_VERIFY(xdgToplevel());
+ exec([=] { xdgToplevel()->sendCompleteConfigure(); });
+ QCOMPOSITOR_TRY_VERIFY(xdgToplevel()->m_xdgSurface->m_committedConfigureSerial);
+
+ exec([=] {
+ auto *surface = xdgToplevel()->surface();
+ auto *p = pointer();
+ auto *c = client();
+ p->sendEnter(surface, {100, 100});
+ p->sendFrame(c);
+ p->sendButton(c, BTN_LEFT, Pointer::button_state_pressed);
+ p->sendButton(c, BTN_LEFT, Pointer::button_state_released);
+ p->sendFrame(c);
+ });
+ QCOMPOSITOR_TRY_VERIFY(xdgPopup());
+ exec([=] {
+ xdgPopup()->sendConfigure(QRect(100, 100, 100, 100));
+ xdgPopup()->m_xdgSurface->sendConfigure();
+ });
+ QCOMPOSITOR_TRY_VERIFY(xdgPopup()->m_xdgSurface->m_committedConfigureSerial);
+
+ window.hide();
+ QCOMPOSITOR_TRY_VERIFY(!xdgToplevel());
+}
+
void tst_xdgshell::pongs()
{
// Create and show a window to trigger shell integration initialzation,