diff options
author | David Edmundson <davidedmundson@kde.org> | 2020-08-12 14:42:41 +0100 |
---|---|---|
committer | David Edmundson <davidedmundson@kde.org> | 2020-08-26 16:43:35 +0100 |
commit | 26bcfde0aa102205f70f3f4959bfbe9166f93885 (patch) | |
tree | 510b792515397e651736a0d8264d1edb5e45be62 /tests/auto | |
parent | 8f27bf64fe0a944bccd7bb5a920abc12a112762f (diff) | |
download | qtwayland-26bcfde0aa102205f70f3f4959bfbe9166f93885.tar.gz |
Client: Expose XdgShell native resources
Many new specifications now rely on passing xdg_surface/xdg_toplevel as
arguments to other protocols.
wl_shell is currently exposed through native resources but xdg-shell
related classes were not.
Fixes: QTBUG-81479
Change-Id: I2023f39ad6813ff58e8a86d739f307d791794b16
Reviewed-by: Paul Olav Tvete <paul.tvete@qt.io>
Diffstat (limited to 'tests/auto')
-rw-r--r-- | tests/auto/client/xdgshell/tst_xdgshell.cpp | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/tests/auto/client/xdgshell/tst_xdgshell.cpp b/tests/auto/client/xdgshell/tst_xdgshell.cpp index 3007fb32..891bc0b2 100644 --- a/tests/auto/client/xdgshell/tst_xdgshell.cpp +++ b/tests/auto/client/xdgshell/tst_xdgshell.cpp @@ -51,6 +51,7 @@ private slots: void minMaxSize(); void windowGeometry(); void foreignSurface(); + void nativeResources(); }; void tst_xdgshell::showMinimized() @@ -563,5 +564,23 @@ void tst_xdgshell::foreignSurface() wl_surface_destroy(foreignSurface); } +void tst_xdgshell::nativeResources() +{ + QRasterWindow window; + window.resize(400, 320); + window.show(); + QCOMPOSITOR_TRY_VERIFY(xdgToplevel()); + + auto *ni = QGuiApplication::platformNativeInterface(); + auto *xdg_surface_proxy = static_cast<::wl_proxy *>(ni->nativeResourceForWindow("xdg_surface", &window)); + QCOMPARE(wl_proxy_get_class(xdg_surface_proxy), "xdg_surface"); + + auto *xdg_toplevel_proxy = static_cast<::wl_proxy *>(ni->nativeResourceForWindow("xdg_toplevel", &window)); + QCOMPARE(wl_proxy_get_class(xdg_toplevel_proxy), "xdg_toplevel"); + + auto *xdg_popup_proxy = static_cast<::wl_proxy *>(ni->nativeResourceForWindow("xdg_popup", &window)); + QCOMPARE(xdg_popup_proxy, nullptr); +} + QCOMPOSITOR_TEST_MAIN(tst_xdgshell) #include "tst_xdgshell.moc" |