Hello community,

here is the log from the commit of package kwayland for openSUSE:Factory 
checked in at 2017-08-24 17:58:53
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/kwayland (Old)
 and      /work/SRC/openSUSE:Factory/.kwayland.new (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Package is "kwayland"

Thu Aug 24 17:58:53 2017 rev:39 rq:516702 version:5.37.0

Changes:
--------
--- /work/SRC/openSUSE:Factory/kwayland/kwayland.changes        2017-07-17 
10:26:05.590520615 +0200
+++ /work/SRC/openSUSE:Factory/.kwayland.new/kwayland.changes   2017-08-24 
17:58:57.592978347 +0200
@@ -1,0 +2,20 @@
+Sat Aug 12 09:23:39 UTC 2017 - christo...@krop.fr
+
+- Update to 5.37.0
+  * New feature release
+  * For more details please see:
+  * https://www.kde.org/announcements/kde-frameworks-5.37.0.php
+- Changes since 5.36.0 :
+  * Make unittest independent from the location of the executable.
+  * autotests: prepare for CMAKE_RUNTIME_OUTPUT_DIRECTORY being set
+  * Destroy all kwayland objects created by registry when it is destroyed
+  * Emit connectionDied if the QPA is destroyed
+  * [client] Track all created ConnectionThreads and add API to access them
+  * [server] Send text input leave if focused surface gets unbound
+  * [server] Send pointer leave if focused surface gets unbound
+  * Drop unused variable
+  * [client] Properly track enteredSurface in Keyboard
+  * [server] Send keyboard leave when client destroys the focused surface 
(kde#382280)
+  * check Buffer validity (kde#381953)
+
+-------------------------------------------------------------------

Old:
----
  kwayland-5.36.0.tar.xz

New:
----
  kwayland-5.37.0.tar.xz

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Other differences:
------------------
++++++ kwayland.spec ++++++
--- /var/tmp/diff_new_pack.utSUmP/_old  2017-08-24 17:58:58.656828504 +0200
+++ /var/tmp/diff_new_pack.utSUmP/_new  2017-08-24 17:58:58.660827941 +0200
@@ -16,9 +16,9 @@
 #
 
 
-%define _tar_path 5.36
+%define _tar_path 5.37
 Name:           kwayland
-Version:        5.36.0
+Version:        5.37.0
 Release:        0
 Summary:        KDE Wayland library
 License:        LGPL-2.1+

++++++ kwayland-5.36.0.tar.xz -> kwayland-5.37.0.tar.xz ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/kwayland-5.36.0/CMakeLists.txt 
new/kwayland-5.37.0/CMakeLists.txt
--- old/kwayland-5.36.0/CMakeLists.txt  2017-07-01 17:01:18.000000000 +0200
+++ new/kwayland-5.37.0/CMakeLists.txt  2017-08-06 18:55:14.000000000 +0200
@@ -1,11 +1,11 @@
 cmake_minimum_required(VERSION 3.0)
 
-set(KF5_VERSION "5.36.0") # handled by release scripts
+set(KF5_VERSION "5.37.0") # handled by release scripts
 project(KWayland VERSION ${KF5_VERSION})
 
 # ECM setup
 include(FeatureSummary)
-find_package(ECM 5.36.0  NO_MODULE)
+find_package(ECM 5.37.0  NO_MODULE)
 set_package_properties(ECM PROPERTIES TYPE REQUIRED DESCRIPTION "Extra CMake 
Modules." URL 
"https://projects.kde.org/projects/kdesupport/extra-cmake-modules";)
 feature_summary(WHAT REQUIRED_PACKAGES_NOT_FOUND 
FATAL_ON_MISSING_REQUIRED_PACKAGES)
 set(CMAKE_MODULE_PATH ${ECM_MODULE_PATH} ${ECM_KDE_MODULE_DIR})
@@ -29,7 +29,7 @@
                         SOVERSION 5)
 
 # Dependencies
-set(REQUIRED_QT_VERSION 5.6.0)
+set(REQUIRED_QT_VERSION 5.7.0)
 find_package(Qt5 ${REQUIRED_QT_VERSION} CONFIG REQUIRED Concurrent Gui)
 
 find_package(Wayland 1.7 COMPONENTS Client Server)
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/kwayland-5.36.0/autotests/client/CMakeLists.txt 
new/kwayland-5.37.0/autotests/client/CMakeLists.txt
--- old/kwayland-5.36.0/autotests/client/CMakeLists.txt 2017-07-01 
17:01:18.000000000 +0200
+++ new/kwayland-5.37.0/autotests/client/CMakeLists.txt 2017-08-06 
18:55:14.000000000 +0200
@@ -6,7 +6,7 @@
     )
 add_executable(testWaylandConnectionThread ${testWaylandConnectionThread_SRCS})
 target_link_libraries( testWaylandConnectionThread Qt5::Test Qt5::Gui 
KF5::WaylandClient KF5::WaylandServer Wayland::Client Wayland::Server)
-add_test(kwayland-testWaylandConnectionThread testWaylandConnectionThread)
+add_test(NAME kwayland-testWaylandConnectionThread COMMAND 
testWaylandConnectionThread)
 ecm_mark_as_test(testWaylandConnectionThread)
 
 ########################################################
@@ -17,7 +17,7 @@
     )
 add_executable(testWaylandRegistry ${testWaylandRegistry_SRCS})
 target_link_libraries( testWaylandRegistry Qt5::Test Qt5::Gui 
KF5::WaylandClient KF5::WaylandServer Wayland::Client Wayland::Server)
-add_test(kwayland-testWaylandRegistry testWaylandRegistry)
+add_test(NAME kwayland-testWaylandRegistry COMMAND testWaylandRegistry)
 ecm_mark_as_test(testWaylandRegistry)
 
 ########################################################
@@ -29,7 +29,7 @@
         )
     add_executable(testWaylandFullscreenShell 
${testWaylandFullscreenShell_SRCS})
     target_link_libraries( testWaylandFullscreenShell Qt5::Test 
KF5::WaylandClient Wayland::Client)
-    add_test(kwayland-testWaylandFullscreenShell testWaylandFullscreenShell)
+    add_test(NAME kwayland-testWaylandFullscreenShell COMMAND 
testWaylandFullscreenShell)
     ecm_mark_as_test(testWaylandFullscreenShell)
 endif()
 
@@ -41,7 +41,7 @@
     )
 add_executable(testWaylandOutput ${testWaylandOutput_SRCS})
 target_link_libraries( testWaylandOutput Qt5::Test Qt5::Gui KF5::WaylandClient 
KF5::WaylandServer Wayland::Client Wayland::Server)
-add_test(kwayland-testWaylandOutput testWaylandOutput)
+add_test(NAME kwayland-testWaylandOutput COMMAND testWaylandOutput)
 ecm_mark_as_test(testWaylandOutput)
 
 ########################################################
@@ -52,7 +52,7 @@
     )
 add_executable(testWaylandShell ${testWaylandShell_SRCS})
 target_link_libraries( testWaylandShell Qt5::Test Qt5::Gui KF5::WaylandClient 
KF5::WaylandServer Wayland::Client Wayland::Server)
-add_test(kwayland-testWaylandShell testWaylandShell)
+add_test(NAME kwayland-testWaylandShell COMMAND testWaylandShell)
 ecm_mark_as_test(testWaylandShell)
 
 ########################################################
@@ -63,7 +63,7 @@
     )
 add_executable(testWaylandSurface ${testWaylandSurface_SRCS})
 target_link_libraries( testWaylandSurface Qt5::Test Qt5::Gui 
KF5::WaylandClient KF5::WaylandServer Wayland::Client Wayland::Server)
-add_test(kwayland-testWaylandSurface testWaylandSurface)
+add_test(NAME kwayland-testWaylandSurface COMMAND testWaylandSurface)
 ecm_mark_as_test(testWaylandSurface)
 
 ########################################################
@@ -75,7 +75,7 @@
         )
     add_executable(testWaylandSeat ${testWaylandSeat_SRCS})
     target_link_libraries( testWaylandSeat Qt5::Test Qt5::Gui 
KF5::WaylandClient KF5::WaylandServer Wayland::Client Wayland::Server)
-    add_test(kwayland-testWaylandSeat testWaylandSeat)
+    add_test(NAME kwayland-testWaylandSeat COMMAND testWaylandSeat)
     ecm_mark_as_test(testWaylandSeat)
 endif()
 
@@ -87,7 +87,7 @@
     )
 add_executable(testShmPool ${testShmPool_SRCS})
 target_link_libraries( testShmPool Qt5::Test Qt5::Gui KF5::WaylandClient 
KF5::WaylandServer)
-add_test(kwayland-testShmPool testShmPool)
+add_test(NAME kwayland-testShmPool COMMAND testShmPool)
 ecm_mark_as_test(testShmPool)
 
 ########################################################
@@ -98,7 +98,7 @@
     )
 add_executable(testWaylandOutputManagement 
${test_wayland_outputmanagement_SRCS})
 target_link_libraries( testWaylandOutputManagement Qt5::Test Qt5::Gui 
KF5::WaylandClient KF5::WaylandServer Wayland::Client)
-add_test(kwayland-testWaylandOutputManagement testWaylandOutputManagement)
+add_test(NAME kwayland-testWaylandOutputManagement COMMAND 
testWaylandOutputManagement)
 ecm_mark_as_test(testWaylandOutputManagement)
 
 ########################################################
@@ -109,7 +109,7 @@
     )
 add_executable(testWaylandOutputDevice ${test_wayland_outputdevice_SRCS})
 target_link_libraries( testWaylandOutputDevice Qt5::Test Qt5::Gui 
KF5::WaylandClient KF5::WaylandServer Wayland::Client)
-add_test(kwayland-testWaylandOutputDevice testWaylandOutputDevice)
+add_test(NAME kwayland-testWaylandOutputDevice COMMAND testWaylandOutputDevice)
 ecm_mark_as_test(testWaylandOutputDevice)
 
 ########################################################
@@ -120,7 +120,7 @@
     )
 add_executable(testCompositor ${testCompositor_SRCS})
 target_link_libraries( testCompositor Qt5::Test Qt5::Gui KF5::WaylandClient 
KF5::WaylandServer)
-add_test(kwayland-testCompositor testCompositor)
+add_test(NAME kwayland-testCompositor COMMAND testCompositor)
 ecm_mark_as_test(testCompositor)
 
 ########################################################
@@ -131,7 +131,7 @@
     )
 add_executable(testSubCompositor ${testSubCompositor_SRCS})
 target_link_libraries( testSubCompositor Qt5::Test Qt5::Gui KF5::WaylandClient 
KF5::WaylandServer)
-add_test(kwayland-testSubCompositor testSubCompositor)
+add_test(NAME kwayland-testSubCompositor COMMAND testSubCompositor)
 ecm_mark_as_test(testSubCompositor)
 
 
@@ -143,7 +143,7 @@
     )
 add_executable(testSubSurface ${testSubSurface_SRCS})
 target_link_libraries( testSubSurface Qt5::Test Qt5::Gui KF5::WaylandClient 
KF5::WaylandServer Wayland::Client)
-add_test(kwayland-testSubSurface testSubSurface)
+add_test(NAME kwayland-testSubSurface COMMAND testSubSurface)
 ecm_mark_as_test(testSubSurface)
 
 ########################################################
@@ -154,7 +154,7 @@
     )
 add_executable(testRegion ${testRegion_SRCS})
 target_link_libraries( testRegion Qt5::Test Qt5::Gui KF5::WaylandClient 
KF5::WaylandServer)
-add_test(kwayland-testRegion testRegion)
+add_test(NAME kwayland-testRegion COMMAND testRegion)
 ecm_mark_as_test(testRegion)
 
 ########################################################
@@ -165,7 +165,7 @@
     )
 add_executable(testBlur ${testBlur_SRCS})
 target_link_libraries( testBlur Qt5::Test Qt5::Gui KF5::WaylandClient 
KF5::WaylandServer)
-add_test(kwayland-testBlur testBlur)
+add_test(NAME kwayland-testBlur COMMAND testBlur)
 ecm_mark_as_test(testBlur)
 
 ########################################################
@@ -176,7 +176,7 @@
     )
 add_executable(testContrast ${testContrast_SRCS})
 target_link_libraries( testContrast Qt5::Test Qt5::Gui KF5::WaylandClient 
KF5::WaylandServer Wayland::Client)
-add_test(kwayland-testContrast testContrast)
+add_test(NAME kwayland-testContrast COMMAND testContrast)
 ecm_mark_as_test(testContrast)
 
 ########################################################
@@ -187,7 +187,7 @@
     )
 add_executable(testSlide ${testSlide_SRCS})
 target_link_libraries( testSlide Qt5::Test Qt5::Gui KF5::WaylandClient 
KF5::WaylandServer Wayland::Client)
-add_test(kwayland-testSlide testSlide)
+add_test(NAME kwayland-testSlide COMMAND testSlide)
 ecm_mark_as_test(testSlide)
 
 ########################################################
@@ -198,7 +198,7 @@
     )
 add_executable(testWindowmanagement ${testWindowmanagement_SRCS})
 target_link_libraries( testWindowmanagement Qt5::Test Qt5::Gui 
KF5::WaylandClient KF5::WaylandServer Wayland::Client)
-add_test(kwayland-testWindowmanagement testWindowmanagement)
+add_test(NAME kwayland-testWindowmanagement COMMAND testWindowmanagement)
 ecm_mark_as_test(testWindowmanagement)
 
 ########################################################
@@ -209,7 +209,7 @@
     )
 add_executable(testDataSource ${testDataSource_SRCS})
 target_link_libraries( testDataSource Qt5::Test Qt5::Gui KF5::WaylandClient 
KF5::WaylandServer Wayland::Client)
-add_test(kwayland-testDataSource testDataSource)
+add_test(NAME kwayland-testDataSource COMMAND testDataSource)
 ecm_mark_as_test(testDataSource)
 
 ########################################################
@@ -220,7 +220,7 @@
     )
 add_executable(testDataDevice ${testDataDevice_SRCS})
 target_link_libraries( testDataDevice Qt5::Test Qt5::Gui KF5::WaylandClient 
KF5::WaylandServer Wayland::Client)
-add_test(kwayland-testDataDevice testDataDevice)
+add_test(NAME kwayland-testDataDevice COMMAND testDataDevice)
 ecm_mark_as_test(testDataDevice)
 
 ########################################################
@@ -231,7 +231,7 @@
     )
 add_executable(testServerSideDecoration ${testServerSideDecoration_SRCS})
 target_link_libraries( testServerSideDecoration Qt5::Test Qt5::Gui 
KF5::WaylandClient KF5::WaylandServer Wayland::Client)
-add_test(kwayland-testServerSideDecoration testServerSideDecoration)
+add_test(NAME kwayland-testServerSideDecoration COMMAND 
testServerSideDecoration)
 ecm_mark_as_test(testServerSideDecoration)
 
 ########################################################
@@ -242,7 +242,7 @@
     )
 add_executable(testDragAndDrop ${testDragAndDrop_SRCS})
 target_link_libraries( testDragAndDrop Qt5::Test Qt5::Gui KF5::WaylandClient 
KF5::WaylandServer Wayland::Client)
-add_test(kwayland-testDragAndDrop testDragAndDrop)
+add_test(NAME kwayland-testDragAndDrop COMMAND testDragAndDrop)
 ecm_mark_as_test(testDragAndDrop)
 
 ########################################################
@@ -253,7 +253,7 @@
     )
 add_executable(testPlasmaShell ${testPlasmaShell_SRCS})
 target_link_libraries( testPlasmaShell Qt5::Test Qt5::Gui KF5::WaylandClient 
KF5::WaylandServer Wayland::Client)
-add_test(kwayland-testPlasmaShell testPlasmaShell)
+add_test(NAME kwayland-testPlasmaShell COMMAND testPlasmaShell)
 ecm_mark_as_test(testPlasmaShell)
 
 ########################################################
@@ -264,7 +264,7 @@
     )
 add_executable(testIdle ${testIdle_SRCS})
 target_link_libraries( testIdle Qt5::Test Qt5::Gui KF5::WaylandClient 
KF5::WaylandServer)
-add_test(kwayland-testIdle testIdle)
+add_test(NAME kwayland-testIdle COMMAND testIdle)
 ecm_mark_as_test(testIdle)
 
 ########################################################
@@ -275,7 +275,7 @@
     )
 add_executable(testShadow ${testShadow_SRCS})
 target_link_libraries( testShadow Qt5::Test Qt5::Gui KF5::WaylandClient 
KF5::WaylandServer)
-add_test(kwayland-testShadow testShadow)
+add_test(NAME kwayland-testShadow COMMAND testShadow)
 ecm_mark_as_test(testShadow)
 
 ########################################################
@@ -287,7 +287,7 @@
         )
     add_executable(testFakeInput ${testFakeInput_SRCS})
     target_link_libraries( testFakeInput Qt5::Test Qt5::Gui KF5::WaylandClient 
KF5::WaylandServer)
-    add_test(kwayland-testFakeInput testFakeInput)
+    add_test(NAME kwayland-testFakeInput COMMAND testFakeInput)
     ecm_mark_as_test(testFakeInput)
 endif()
 
@@ -300,7 +300,7 @@
         )
     add_executable(testPlasmaWindowModel ${testPlasmaWindowModel_SRCS})
     target_link_libraries( testPlasmaWindowModel Qt5::Test Qt5::Gui 
KF5::WaylandClient KF5::WaylandServer)
-    add_test(kwayland-testPlasmaWindowModel testPlasmaWindowModel)
+    add_test(NAME kwayland-testPlasmaWindowModel COMMAND testPlasmaWindowModel)
     ecm_mark_as_test(testPlasmaWindowModel)
 endif()
 
@@ -312,7 +312,7 @@
     )
 add_executable(testTextInput ${testTextInput_SRCS})
 target_link_libraries( testTextInput Qt5::Test Qt5::Gui KF5::WaylandClient 
KF5::WaylandServer)
-add_test(kwayland-testTextInput testTextInput)
+add_test(NAME kwayland-testTextInput COMMAND testTextInput)
 ecm_mark_as_test(testTextInput)
 
 ########################################################
@@ -323,7 +323,7 @@
     )
 add_executable(testError ${testError_SRCS})
 target_link_libraries( testError Qt5::Test Qt5::Gui KF5::WaylandClient 
KF5::WaylandServer Wayland::Client)
-add_test(kwayland-testError testError)
+add_test(NAME kwayland-testError COMMAND testError)
 ecm_mark_as_test(testError)
 
 ########################################################
@@ -334,7 +334,7 @@
     )
 add_executable(testSelection ${testSelection_SRCS})
 target_link_libraries( testSelection Qt5::Test Qt5::Gui KF5::WaylandClient 
KF5::WaylandServer Wayland::Client)
-add_test(kwayland-testSelection testSelection)
+add_test(NAME kwayland-testSelection COMMAND testSelection)
 ecm_mark_as_test(testSelection)
 
 ########################################################
@@ -345,7 +345,7 @@
       )
 add_executable(testXdgShellV5 ${testXdgShellV5_SRCS})
 target_link_libraries( testXdgShellV5 Qt5::Test Qt5::Gui KF5::WaylandServer 
KF5::WaylandClient Wayland::Client)
-add_test(kwayland-testXdgShellV5 testXdgShellV5)
+add_test(NAME kwayland-testXdgShellV5 COMMAND testXdgShellV5)
 ecm_mark_as_test(testXdgShellV5)
 
 ########################################################
@@ -353,5 +353,5 @@
 ########################################################
 add_executable(testPointerConstraints test_pointer_constraints.cpp)
 target_link_libraries( testPointerConstraints Qt5::Test Qt5::Gui 
KF5::WaylandServer KF5::WaylandClient Wayland::Client)
-add_test(kwayland-testPointerConstraints testPointerConstraints)
+add_test(NAME kwayland-testPointerConstraints COMMAND testPointerConstraints)
 ecm_mark_as_test(testPointerConstraints)
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/kwayland-5.36.0/autotests/client/test_text_input.cpp 
new/kwayland-5.37.0/autotests/client/test_text_input.cpp
--- old/kwayland-5.36.0/autotests/client/test_text_input.cpp    2017-07-01 
17:01:18.000000000 +0200
+++ new/kwayland-5.37.0/autotests/client/test_text_input.cpp    2017-08-06 
18:55:14.000000000 +0200
@@ -321,6 +321,8 @@
     QSignalSpy unboundSpy(serverSurface, &QObject::destroyed);
     surface.reset();
     QVERIFY(unboundSpy.wait());
+    QVERIFY(leftSpy.wait());
+    QVERIFY(!textInput->enteredSurface());
 }
 
 void TextInputTest::testShowHidePanel_data()
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/kwayland-5.36.0/autotests/client/test_wayland_connection_thread.cpp 
new/kwayland-5.37.0/autotests/client/test_wayland_connection_thread.cpp
--- old/kwayland-5.36.0/autotests/client/test_wayland_connection_thread.cpp     
2017-07-01 17:01:18.000000000 +0200
+++ new/kwayland-5.37.0/autotests/client/test_wayland_connection_thread.cpp     
2017-08-06 18:55:14.000000000 +0200
@@ -78,7 +78,9 @@
 
 void TestWaylandConnectionThread::testInitConnectionNoThread()
 {
+    QVERIFY(KWayland::Client::ConnectionThread::connections().isEmpty());
     QScopedPointer<KWayland::Client::ConnectionThread> connection(new 
KWayland::Client::ConnectionThread);
+    
QVERIFY(KWayland::Client::ConnectionThread::connections().contains(connection.data()));
     QCOMPARE(connection->socketName(), QStringLiteral("wayland-0"));
     connection->setSocketName(s_socketName);
     QCOMPARE(connection->socketName(), s_socketName);
@@ -90,6 +92,9 @@
     QCOMPARE(connectedSpy.count(), 1);
     QCOMPARE(failedSpy.count(), 0);
     QVERIFY(connection->display());
+
+    connection.reset();
+    QVERIFY(KWayland::Client::ConnectionThread::connections().isEmpty());
 }
 
 void TestWaylandConnectionThread::testConnectionFailure()
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/kwayland-5.36.0/autotests/client/test_wayland_registry.cpp 
new/kwayland-5.37.0/autotests/client/test_wayland_registry.cpp
--- old/kwayland-5.36.0/autotests/client/test_wayland_registry.cpp      
2017-07-01 17:01:18.000000000 +0200
+++ new/kwayland-5.37.0/autotests/client/test_wayland_registry.cpp      
2017-08-06 18:55:14.000000000 +0200
@@ -537,24 +537,37 @@
     QVERIFY(connectedSpy.wait());
 
     Registry registry;
+    QSignalSpy shellAnnouncedSpy(&registry, 
SIGNAL(shellAnnounced(quint32,quint32)));
+
     QVERIFY(!registry.isValid());
-    registry.create(connection.display());
+    registry.create(&connection);
     registry.setup();
     QVERIFY(registry.isValid());
 
-    connect(&connection, &ConnectionThread::connectionDied, &registry, 
&Registry::destroy);
+    //create some arbitrary Interface
+    shellAnnouncedSpy.wait();
+    QScopedPointer<Shell> 
shell(registry.createShell(registry.interface(Registry::Interface::Shell).name, 
registry.interface(Registry::Interface::Shell).version, &registry));
+
 
     QSignalSpy connectionDiedSpy(&connection, SIGNAL(connectionDied()));
+    QSignalSpy registryDiedSpy(&registry, SIGNAL(registryDestroyed()));
+
     QVERIFY(connectionDiedSpy.isValid());
+    QVERIFY(registryDiedSpy.isValid());
+
     delete m_display;
     m_display = nullptr;
     QVERIFY(connectionDiedSpy.wait());
 
+    QVERIFY(connectionDiedSpy.count() == 1);
+    QVERIFY(registryDiedSpy.count() == 1);
+
     // now the registry should be destroyed;
     QVERIFY(!registry.isValid());
 
     // calling destroy again should not fail
     registry.destroy();
+    shell->destroy();
 }
 
 void TestWaylandRegistry::testGlobalSync()
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/kwayland-5.36.0/autotests/client/test_wayland_seat.cpp 
new/kwayland-5.37.0/autotests/client/test_wayland_seat.cpp
--- old/kwayland-5.36.0/autotests/client/test_wayland_seat.cpp  2017-07-01 
17:01:18.000000000 +0200
+++ new/kwayland-5.37.0/autotests/client/test_wayland_seat.cpp  2017-08-06 
18:55:14.000000000 +0200
@@ -591,10 +591,11 @@
     QSignalSpy entered2Spy(p, &Pointer::entered);
     QVERIFY(entered2Spy.wait());
     QCOMPARE(p->enteredSurface(), s);
+    QSignalSpy leftSpy2(p, &Pointer::left);
+    QVERIFY(leftSpy2.isValid());
     delete s;
     QVERIFY(!p->enteredSurface());
-    wl_display_flush(m_connection->display());
-    QVERIFY(focusedPointerChangedSpy.wait());
+    QVERIFY(leftSpy2.wait());
     QCOMPARE(focusedPointerChangedSpy.count(), 10);
     QVERIFY(!m_seatInterface->focusedPointerSurface());
     QVERIFY(!m_seatInterface->focusedPointer());
@@ -1562,8 +1563,11 @@
 
     QSignalSpy serverSurfaceDestroyedSpy(serverSurface, &QObject::destroyed);
     QVERIFY(serverSurfaceDestroyedSpy.isValid());
+    QCOMPARE(keyboard->enteredSurface(), s);
     delete s;
-    QVERIFY(serverSurfaceDestroyedSpy.wait());
+    QVERIFY(!keyboard->enteredSurface());
+    QVERIFY(leftSpy.wait());
+    QCOMPARE(serverSurfaceDestroyedSpy.count(), 1);
     QVERIFY(!m_seatInterface->focusedKeyboardSurface());
     QVERIFY(!m_seatInterface->focusedKeyboard());
     QVERIFY(!serverKeyboard->focusedSurface());
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/kwayland-5.36.0/autotests/server/CMakeLists.txt 
new/kwayland-5.37.0/autotests/server/CMakeLists.txt
--- old/kwayland-5.36.0/autotests/server/CMakeLists.txt 2017-07-01 
17:01:18.000000000 +0200
+++ new/kwayland-5.37.0/autotests/server/CMakeLists.txt 2017-08-06 
18:55:14.000000000 +0200
@@ -1,13 +1,12 @@
 ########################################################
 # Test WaylandServerDisplay
 ########################################################
-add_definitions(-DAUTOTEST_CURRENT_BIN_DIR="${CMAKE_CURRENT_BINARY_DIR}")
 set( testWaylandServerDisplay_SRCS
         test_display.cpp
     )
 add_executable(testWaylandServerDisplay ${testWaylandServerDisplay_SRCS})
 target_link_libraries( testWaylandServerDisplay Qt5::Test Qt5::Gui 
KF5::WaylandServer Wayland::Server)
-add_test(kwayland-testWaylandServerDisplay testWaylandServerDisplay)
+add_test(NAME kwayland-testWaylandServerDisplay COMMAND 
testWaylandServerDisplay)
 ecm_mark_as_test(testWaylandServerDisplay)
 
 ########################################################
@@ -18,7 +17,7 @@
     )
 add_executable(testWaylandServerSeat ${testWaylandServerSeat_SRCS})
 target_link_libraries( testWaylandServerSeat Qt5::Test Qt5::Gui 
KF5::WaylandServer Wayland::Server)
-add_test(kwayland-testWaylandServerSeat testWaylandServerSeat)
+add_test(NAME kwayland-testWaylandServerSeat COMMAND testWaylandServerSeat)
 ecm_mark_as_test(testWaylandServerSeat)
 
 ########################################################
@@ -36,7 +35,7 @@
     )
 add_executable(testQtSurfaceExtension ${testQtSurfaceExtension_SRCS})
 target_link_libraries( testQtSurfaceExtension Qt5::Test Qt5::Gui 
KF5::WaylandServer)
-add_test(kwayland-testQtSurfaceExtension testQtSurfaceExtension)
+add_test(NAME kwayland-testQtSurfaceExtension COMMAND testQtSurfaceExtension)
 ecm_mark_as_test(testQtSurfaceExtension)
 
 ########################################################
@@ -44,5 +43,5 @@
 ########################################################
 add_executable(testNoXdgRuntimeDir test_no_xdg_runtime_dir.cpp)
 target_link_libraries( testNoXdgRuntimeDir Qt5::Test KF5::WaylandServer)
-add_test(kwayland-testNoXdgRuntimeDir testNoXdgRuntimeDir)
+add_test(NAME kwayland-testNoXdgRuntimeDir COMMAND testNoXdgRuntimeDir)
 ecm_mark_as_test(testNoXdgRuntimeDir)
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/kwayland-5.36.0/autotests/server/test_display.cpp 
new/kwayland-5.37.0/autotests/server/test_display.cpp
--- old/kwayland-5.36.0/autotests/server/test_display.cpp       2017-07-01 
17:01:18.000000000 +0200
+++ new/kwayland-5.37.0/autotests/server/test_display.cpp       2017-08-06 
18:55:14.000000000 +0200
@@ -143,7 +143,7 @@
     QVERIFY(connection->groupId() != 0);
     QVERIFY(connection->processId() != 0);
     QCOMPARE(connection->display(), &display);
-    QCOMPARE(connection->executablePath(), 
QStringLiteral("%1/testWaylandServerDisplay").arg(AUTOTEST_CURRENT_BIN_DIR));
+    QCOMPARE(connection->executablePath(), 
QCoreApplication::applicationFilePath());
     QCOMPARE((wl_client*)*connection, client);
     const ClientConnection &constRef = *connection;
     QCOMPARE((wl_client*)constRef, client);
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/kwayland-5.36.0/src/client/blur.h 
new/kwayland-5.37.0/src/client/blur.h
--- old/kwayland-5.36.0/src/client/blur.h       2017-07-01 17:01:18.000000000 
+0200
+++ new/kwayland-5.37.0/src/client/blur.h       2017-08-06 18:55:14.000000000 
+0200
@@ -173,10 +173,8 @@
      * that the instance can be deleted or set up to a new org_kde_kwin_blur 
interface
      * once there is a new connection available.
      *
-     * It is suggested to connect this method to 
ConnectionThread::connectionDied:
-     * @code
-     * connect(connection, &ConnectionThread::connectionDied, blur, 
&Blur::destroy);
-     * @endcode
+     * This method is automatically invoked when the Registry which created 
this
+     * Blur gets destroyed.
      *
      * @see release
      **/
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/kwayland-5.36.0/src/client/connection_thread.cpp 
new/kwayland-5.37.0/src/client/connection_thread.cpp
--- old/kwayland-5.36.0/src/client/connection_thread.cpp        2017-07-01 
17:01:18.000000000 +0200
+++ new/kwayland-5.37.0/src/client/connection_thread.cpp        2017-08-06 
18:55:14.000000000 +0200
@@ -25,6 +25,8 @@
 #include <QDebug>
 #include <QDir>
 #include <QFileSystemWatcher>
+#include <QMutex>
+#include <QMutexLocker>
 #include <QSocketNotifier>
 #include <qpa/qplatformnativeinterface.h>
 // Wayland
@@ -55,10 +57,16 @@
     bool foreign = false;
     QMetaObject::Connection eventDispatcherConnection;
     int error = 0;
+    static QVector<ConnectionThread*> connections;
+    static QMutex mutex;
 private:
     ConnectionThread *q;
 };
 
+QVector<ConnectionThread*> ConnectionThread::Private::connections = 
QVector<ConnectionThread*>{};
+QMutex ConnectionThread::Private::mutex{QMutex::Recursive};
+
+
 ConnectionThread::Private::Private(ConnectionThread *q)
     : socketName(QString::fromUtf8(qgetenv("WAYLAND_DISPLAY")))
     , runtimeDir(QString::fromUtf8(qgetenv("XDG_RUNTIME_DIR")))
@@ -67,10 +75,18 @@
     if (socketName.isEmpty()) {
         socketName = QStringLiteral("wayland-0");
     }
+    {
+        QMutexLocker lock(&mutex);
+        connections << q;
+    }
 }
 
 ConnectionThread::Private::~Private()
 {
+    {
+        QMutexLocker lock(&mutex);
+        connections.removeOne(q);
+    }
     if (display && !foreign) {
         wl_display_flush(display);
         wl_display_disconnect(display);
@@ -202,6 +218,7 @@
     ConnectionThread *ct = new ConnectionThread(parent);
     ct->d->foreign = true;
     ct->d->display = display;
+    connect(native, &QObject::destroyed, ct, 
&ConnectionThread::connectionDied);
     return ct;
 }
 
@@ -280,5 +297,10 @@
     return d->error;
 }
 
+QVector<ConnectionThread*> ConnectionThread::connections()
+{
+    return Private::connections;
+}
+
 }
 }
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/kwayland-5.36.0/src/client/connection_thread.h 
new/kwayland-5.37.0/src/client/connection_thread.h
--- old/kwayland-5.36.0/src/client/connection_thread.h  2017-07-01 
17:01:18.000000000 +0200
+++ new/kwayland-5.37.0/src/client/connection_thread.h  2017-08-06 
18:55:14.000000000 +0200
@@ -21,6 +21,7 @@
 #define WAYLAND_CONNECTION_THREAD_H
 
 #include <QObject>
+#include <QVector>
 
 #include <KWayland/Client/kwaylandclient_export.h>
 
@@ -198,6 +199,12 @@
      **/
     int errorCode() const;
 
+    /**
+     * @returns all connections created in this application
+     * @since 5.37
+     **/
+    static QVector<ConnectionThread*> connections();
+
 public Q_SLOTS:
     /**
      * Initializes the connection in an asynchronous way.
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/kwayland-5.36.0/src/client/contrast.h 
new/kwayland-5.37.0/src/client/contrast.h
--- old/kwayland-5.36.0/src/client/contrast.h   2017-07-01 17:01:18.000000000 
+0200
+++ new/kwayland-5.37.0/src/client/contrast.h   2017-08-06 18:55:14.000000000 
+0200
@@ -166,10 +166,8 @@
      * that the instance can be deleted or set up to a new 
org_kde_kwin_contrast interface
      * once there is a new connection available.
      *
-     * It is suggested to connect this method to 
ConnectionThread::connectionDied:
-     * @code
-     * connect(connection, &ConnectionThread::connectionDied, contrast, 
&Contrast::destroy);
-     * @endcode
+     * This method is automatically invoked when the Registry which created 
this
+     * Contrast gets destroyed.
      *
      * @see release
      **/
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/kwayland-5.36.0/src/client/datadevice.h 
new/kwayland-5.37.0/src/client/datadevice.h
--- old/kwayland-5.36.0/src/client/datadevice.h 2017-07-01 17:01:18.000000000 
+0200
+++ new/kwayland-5.37.0/src/client/datadevice.h 2017-08-06 18:55:14.000000000 
+0200
@@ -71,10 +71,8 @@
      * that the instance can be deleted or set up to a new wl_data_device 
interface
      * once there is a new connection available.
      *
-     * It is suggested to connect this method to 
ConnectionThread::connectionDied:
-     * @code
-     * connect(connection, &ConnectionThread::connectionDied, source, 
&DataDevice::destroy);
-     * @endcode
+     * This method is automatically invoked when the Registry which created 
this
+     * DataDevice gets destroyed.
      *
      * @see release
      **/
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/kwayland-5.36.0/src/client/datadevicemanager.h 
new/kwayland-5.37.0/src/client/datadevicemanager.h
--- old/kwayland-5.36.0/src/client/datadevicemanager.h  2017-07-01 
17:01:18.000000000 +0200
+++ new/kwayland-5.37.0/src/client/datadevicemanager.h  2017-08-06 
18:55:14.000000000 +0200
@@ -97,10 +97,8 @@
      * that the instance can be deleted or set up to a new 
wl_data_device_manager interface
      * once there is a new connection available.
      *
-     * It is suggested to connect this method to 
ConnectionThread::connectionDied:
-     * @code
-     * connect(connection, &ConnectionThread::connectionDied, manager, 
&DataDeviceManager::destroy);
-     * @endcode
+     * This method is automatically invoked when the Registry which created 
this
+     * DataDeviceManager gets destroyed.
      *
      * @see release
      **/
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/kwayland-5.36.0/src/client/dataoffer.h 
new/kwayland-5.37.0/src/client/dataoffer.h
--- old/kwayland-5.36.0/src/client/dataoffer.h  2017-07-01 17:01:18.000000000 
+0200
+++ new/kwayland-5.37.0/src/client/dataoffer.h  2017-08-06 18:55:14.000000000 
+0200
@@ -63,10 +63,8 @@
      * that the instance can be deleted or set up to a new wl_data_offer 
interface
      * once there is a new connection available.
      *
-     * It is suggested to connect this method to 
ConnectionThread::connectionDied:
-     * @code
-     * connect(connection, &ConnectionThread::connectionDied, source, 
&DataOffer::destroy);
-     * @endcode
+     * This method is automatically invoked when the Registry which created 
this
+     * DataOffer gets destroyed.
      *
      * @see release
      **/
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/kwayland-5.36.0/src/client/datasource.h 
new/kwayland-5.37.0/src/client/datasource.h
--- old/kwayland-5.36.0/src/client/datasource.h 2017-07-01 17:01:18.000000000 
+0200
+++ new/kwayland-5.37.0/src/client/datasource.h 2017-08-06 18:55:14.000000000 
+0200
@@ -71,10 +71,8 @@
      * that the instance can be deleted or set up to a new wl_data_source 
interface
      * once there is a new connection available.
      *
-     * It is suggested to connect this method to 
ConnectionThread::connectionDied:
-     * @code
-     * connect(connection, &ConnectionThread::connectionDied, source, 
&DataSource::destroy);
-     * @endcode
+     * This method is automatically invoked when the Registry which created 
this
+     * DataSource gets destroyed.
      *
      * @see release
      **/
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/kwayland-5.36.0/src/client/dpms.h 
new/kwayland-5.37.0/src/client/dpms.h
--- old/kwayland-5.36.0/src/client/dpms.h       2017-07-01 17:01:18.000000000 
+0200
+++ new/kwayland-5.37.0/src/client/dpms.h       2017-08-06 18:55:14.000000000 
+0200
@@ -98,10 +98,8 @@
      * that the instance can be deleted or set up to a new 
org_kde_kwin_dpms_manager interface
      * once there is a new connection available.
      *
-     * It is suggested to connect this method to 
ConnectionThread::connectionDied:
-     * @code
-     * connect(connection, &ConnectionThread::connectionDied, manager, 
&DpmsManager::destroy);
-     * @endcode
+     * This method is automatically invoked when the Registry which created 
this
+     * DPMS gets destroyed.
      *
      * @see release
      **/
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/kwayland-5.36.0/src/client/event_queue.h 
new/kwayland-5.37.0/src/client/event_queue.h
--- old/kwayland-5.36.0/src/client/event_queue.h        2017-07-01 
17:01:18.000000000 +0200
+++ new/kwayland-5.37.0/src/client/event_queue.h        2017-08-06 
18:55:14.000000000 +0200
@@ -111,11 +111,6 @@
      * that the instance can be deleted or set up to a new wl_event_queue 
interface
      * once there is a new connection available.
      *
-     * It is suggested to connect this method to 
ConnectionThread::connectionDied:
-     * @code
-     * connect(connection, &ConnectionThread::connectionDied, queue, 
&EventQueue::destroy);
-     * @endcode
-     *
      * @see release
      **/
     void destroy();
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/kwayland-5.36.0/src/client/fakeinput.h 
new/kwayland-5.37.0/src/client/fakeinput.h
--- old/kwayland-5.36.0/src/client/fakeinput.h  2017-07-01 17:01:18.000000000 
+0200
+++ new/kwayland-5.37.0/src/client/fakeinput.h  2017-08-06 18:55:14.000000000 
+0200
@@ -99,10 +99,8 @@
      * that the instance can be deleted or set up to a new 
org_kde_kwin_fake_input interface
      * once there is a new connection available.
      *
-     * It is suggested to connect this method to 
ConnectionThread::connectionDied:
-     * @code
-     * connect(connection, &ConnectionThread::connectionDied, manager, 
&FakeInput::destroy);
-     * @endcode
+     * This method is automatically invoked when the Registry which created 
this
+     * FakeInput gets destroyed.
      *
      * @see release
      **/
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/kwayland-5.36.0/src/client/idle.h 
new/kwayland-5.37.0/src/client/idle.h
--- old/kwayland-5.36.0/src/client/idle.h       2017-07-01 17:01:18.000000000 
+0200
+++ new/kwayland-5.37.0/src/client/idle.h       2017-08-06 18:55:14.000000000 
+0200
@@ -102,10 +102,8 @@
      * that the instance can be deleted or set up to a new org_kde_kwin_idle 
interface
      * once there is a new connection available.
      *
-     * It is suggested to connect this method to 
ConnectionThread::connectionDied:
-     * @code
-     * connect(connection, &ConnectionThread::connectionDied, manager, 
&Idle::destroy);
-     * @endcode
+     * This method is automatically invoked when the Registry which created 
this
+     * Idle gets destroyed.
      *
      * @see release
      **/
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/kwayland-5.36.0/src/client/keyboard.cpp 
new/kwayland-5.37.0/src/client/keyboard.cpp
--- old/kwayland-5.36.0/src/client/keyboard.cpp 2017-07-01 17:01:18.000000000 
+0200
+++ new/kwayland-5.37.0/src/client/keyboard.cpp 2017-08-06 18:55:14.000000000 
+0200
@@ -20,6 +20,7 @@
 #include "keyboard.h"
 #include "surface.h"
 #include "wayland_pointer_p.h"
+#include <QPointer>
 // wayland
 #include <wayland-client-protocol.h>
 
@@ -35,7 +36,7 @@
     void setup(wl_keyboard *k);
 
     WaylandPointer<wl_keyboard, wl_keyboard_release> keyboard;
-    Surface *enteredSurface = nullptr;
+    QPointer<Surface> enteredSurface;
 
     struct {
         qint32 charactersPerSecond = 0;
@@ -119,15 +120,15 @@
 
 void Keyboard::Private::leaveCallback(void *data, wl_keyboard *keyboard, 
uint32_t serial, wl_surface *surface)
 {
+    Q_UNUSED(surface)
     auto k = reinterpret_cast<Private*>(data);
     Q_ASSERT(k->keyboard == keyboard);
-    Q_ASSERT(*(k->enteredSurface) == surface);
     k->leave(serial);
 }
 
 void Keyboard::Private::leave(uint32_t serial)
 {
-    enteredSurface = nullptr;
+    enteredSurface.clear();
     emit q->left(serial);
 }
 
@@ -176,12 +177,12 @@
 
 Surface *Keyboard::enteredSurface()
 {
-    return d->enteredSurface;
+    return d->enteredSurface.data();
 }
 
 Surface *Keyboard::enteredSurface() const
 {
-    return d->enteredSurface;
+    return d->enteredSurface.data();
 }
 
 bool Keyboard::isValid() const
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/kwayland-5.36.0/src/client/output.cpp 
new/kwayland-5.37.0/src/client/output.cpp
--- old/kwayland-5.36.0/src/client/output.cpp   2017-07-01 17:01:18.000000000 
+0200
+++ new/kwayland-5.37.0/src/client/output.cpp   2017-08-06 18:55:14.000000000 
+0200
@@ -391,5 +391,10 @@
     return Private::get(o);
 }
 
+void Output::destroy()
+{
+    d->output.destroy();
+}
+
 }
 }
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/kwayland-5.36.0/src/client/output.h 
new/kwayland-5.37.0/src/client/output.h
--- old/kwayland-5.36.0/src/client/output.h     2017-07-01 17:01:18.000000000 
+0200
+++ new/kwayland-5.37.0/src/client/output.h     2017-08-06 18:55:14.000000000 
+0200
@@ -204,6 +204,19 @@
      **/
     static Output *get(wl_output *native);
 
+    /**
+    * Destroys the data hold by this Output.
+    * This method is supposed to be used when the connection to the Wayland
+    * server goes away. If the connection is not valid any more, it's not
+    * possible to call release any more as that calls into the Wayland
+    * connection and the call would fail.
+    *
+    * This method is automatically invoked when the Registry which created this
+    * Output gets destroyed.
+    *
+    **/
+    void destroy();
+
 Q_SIGNALS:
     /**
      * Emitted whenever at least one of the data changed.
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/kwayland-5.36.0/src/client/outputconfiguration.h 
new/kwayland-5.37.0/src/client/outputconfiguration.h
--- old/kwayland-5.36.0/src/client/outputconfiguration.h        2017-07-01 
17:01:18.000000000 +0200
+++ new/kwayland-5.37.0/src/client/outputconfiguration.h        2017-08-06 
18:55:14.000000000 +0200
@@ -125,10 +125,9 @@
     * that the instance can be deleted or setup to a new 
org_kde_kwin_outputconfiguration interface
     * once there is a new connection available.
     *
-    * It is suggested to connect this method to 
ConnectionThread::connectionDied:
-    * @code
-    * connect(connection, &ConnectionThread::connectionDied, 
outputconfiguration, &OutputConfiguration::destroy);
-    * @endcode
+    * This method is automatically invoked when the Registry which created this
+    * OutputConfiguration gets destroyed.
+    *
     *
     * @see release
     **/
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/kwayland-5.36.0/src/client/outputdevice.cpp 
new/kwayland-5.37.0/src/client/outputdevice.cpp
--- old/kwayland-5.36.0/src/client/outputdevice.cpp     2017-07-01 
17:01:18.000000000 +0200
+++ new/kwayland-5.37.0/src/client/outputdevice.cpp     2017-08-06 
18:55:14.000000000 +0200
@@ -439,6 +439,11 @@
     return d->uuid;
 }
 
+void OutputDevice::destroy()
+{
+    d->output.destroy();
+
+}
 
 }
 }
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/kwayland-5.36.0/src/client/outputdevice.h 
new/kwayland-5.37.0/src/client/outputdevice.h
--- old/kwayland-5.36.0/src/client/outputdevice.h       2017-07-01 
17:01:18.000000000 +0200
+++ new/kwayland-5.37.0/src/client/outputdevice.h       2017-08-06 
18:55:14.000000000 +0200
@@ -227,7 +227,17 @@
      **/
     QByteArray uuid() const;
 
-
+    /**
+    * Destroys the data hold by this OutputDevice.
+    * This method is supposed to be used when the connection to the Wayland
+    * server goes away. If the connection is not valid any more, it's not
+    * possible to call release any more as that calls into the Wayland
+    * connection and the call would fail.
+    *
+    * This method is automatically invoked when the Registry which created this
+    * Output gets destroyed.
+    **/
+    void destroy();
 
 Q_SIGNALS:
     /**
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/kwayland-5.36.0/src/client/outputmanagement.h 
new/kwayland-5.37.0/src/client/outputmanagement.h
--- old/kwayland-5.36.0/src/client/outputmanagement.h   2017-07-01 
17:01:18.000000000 +0200
+++ new/kwayland-5.37.0/src/client/outputmanagement.h   2017-08-06 
18:55:14.000000000 +0200
@@ -98,10 +98,8 @@
     * that the instance can be deleted or setup to a new 
org_kde_kwin_outputmanagement interface
     * once there is a new connection available.
     *
-    * It is suggested to connect this method to 
ConnectionThread::connectionDied:
-    * @code
-    * connect(connection, &ConnectionThread::connectionDied, outputmanagement, 
&OutputManagement::destroy);
-    * @endcode
+    * This method is automatically invoked when the Registry which created this
+    * OutputManagement gets destroyed.
     *
     * @see release
     **/
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/kwayland-5.36.0/src/client/plasmashell.h 
new/kwayland-5.37.0/src/client/plasmashell.h
--- old/kwayland-5.36.0/src/client/plasmashell.h        2017-07-01 
17:01:18.000000000 +0200
+++ new/kwayland-5.37.0/src/client/plasmashell.h        2017-08-06 
18:55:14.000000000 +0200
@@ -91,10 +91,8 @@
      * that the instance can be deleted or set up to a new 
org_kde_plasma_shell interface
      * once there is a new connection available.
      *
-     * It is suggested to connect this method to 
ConnectionThread::connectionDied:
-     * @code
-     * connect(connection, &ConnectionThread::connectionDied, shell, 
&PlasmaShell::destroy);
-     * @endcode
+     * This method is automatically invoked when the Registry which created 
this
+     * PlasmaShell gets destroyed.
      *
      * Right before the data is destroyed, the signal 
interfaceAboutToBeDestroyed is emitted.
      *
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/kwayland-5.36.0/src/client/plasmawindowmanagement.h 
new/kwayland-5.37.0/src/client/plasmawindowmanagement.h
--- old/kwayland-5.36.0/src/client/plasmawindowmanagement.h     2017-07-01 
17:01:18.000000000 +0200
+++ new/kwayland-5.37.0/src/client/plasmawindowmanagement.h     2017-08-06 
18:55:14.000000000 +0200
@@ -97,10 +97,8 @@
      * that the instance can be deleted or set up to a new 
org_kde_plasma_window_management interface
      * once there is a new connection available.
      *
-     * It is suggested to connect this method to 
ConnectionThread::connectionDied:
-     * @code
-     * connect(connection, &ConnectionThread::connectionDied, shell, 
&PlasmaWindowManagement::destroy);
-     * @endcode
+     * This method is automatically invoked when the Registry which created 
this
+     * PlasmaWindowManagement gets destroyed.
      *
      * Right before the data is destroyed, the signal 
interfaceAboutToBeDestroyed is emitted.
      *
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/kwayland-5.36.0/src/client/pointerconstraints.h 
new/kwayland-5.37.0/src/client/pointerconstraints.h
--- old/kwayland-5.36.0/src/client/pointerconstraints.h 2017-07-01 
17:01:18.000000000 +0200
+++ new/kwayland-5.37.0/src/client/pointerconstraints.h 2017-08-06 
18:55:14.000000000 +0200
@@ -407,10 +407,8 @@
      * that the instance can be deleted or set up to a new 
zwp_confined_pointer_v1 interface
      * once there is a new connection available.
      *
-     * It is suggested to connect this method to 
ConnectionThread::connectionDied:
-     * @code
-     * connect(connection, &ConnectionThread::connectionDied, confinedpointer, 
&ConfinedPointer::destroy);
-     * @endcode
+     * This method is automatically invoked when the Registry which created 
this
+     * PointerConstraints gets destroyed.
      *
      * @see release
      **/
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/kwayland-5.36.0/src/client/pointergestures.h 
new/kwayland-5.37.0/src/client/pointergestures.h
--- old/kwayland-5.36.0/src/client/pointergestures.h    2017-07-01 
17:01:18.000000000 +0200
+++ new/kwayland-5.37.0/src/client/pointergestures.h    2017-08-06 
18:55:14.000000000 +0200
@@ -106,9 +106,8 @@
      * that the instance can be deleted or set up to a new 
zwp_pointer_gestures_v1 interface
      * once there is a new connection available.
      *
-     * It is suggested to connect this method to 
ConnectionThread::connectionDied:
-     * @code
-     * connect(connection, &ConnectionThread::connectionDied, pointergestures, 
&PointerGestures::destroy);
+     * This method is automatically invoked when the Registry which created 
this
+     * PointerGestures gets destroyed.
      * @endcode
      *
      * @see release
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/kwayland-5.36.0/src/client/registry.cpp 
new/kwayland-5.37.0/src/client/registry.cpp
--- old/kwayland-5.36.0/src/client/registry.cpp 2017-07-01 17:01:18.000000000 
+0200
+++ new/kwayland-5.37.0/src/client/registry.cpp 2017-08-06 18:55:14.000000000 
+0200
@@ -361,6 +361,7 @@
 
 void Registry::destroy()
 {
+    emit registryDestroyed();
     d->registry.destroy();
     d->callback.destroy();
 }
@@ -380,6 +381,7 @@
 void Registry::create(ConnectionThread *connection)
 {
     create(connection->display());
+    connect(connection, &ConnectionThread::connectionDied, this, 
&Registry::destroy);
 }
 
 void Registry::setup()
@@ -601,6 +603,7 @@
             }
         }
     );
+    QObject::connect(q, &Registry::registryDestroyed, t, &T::destroy);
     return t;
 }
 
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/kwayland-5.36.0/src/client/registry.h 
new/kwayland-5.37.0/src/client/registry.h
--- old/kwayland-5.36.0/src/client/registry.h   2017-07-01 17:01:18.000000000 
+0200
+++ new/kwayland-5.37.0/src/client/registry.h   2017-08-06 18:55:14.000000000 
+0200
@@ -1300,6 +1300,12 @@
      **/
     void interfacesAnnounced();
 
+Q_SIGNALS:
+    /*
+     * Emitted when the registry has been destroyed rather than released
+     */
+    void registryDestroyed();
+
 private:
     class Private;
     QScopedPointer<Private> d;
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/kwayland-5.36.0/src/client/relativepointer.h 
new/kwayland-5.37.0/src/client/relativepointer.h
--- old/kwayland-5.36.0/src/client/relativepointer.h    2017-07-01 
17:01:18.000000000 +0200
+++ new/kwayland-5.37.0/src/client/relativepointer.h    2017-08-06 
18:55:14.000000000 +0200
@@ -178,10 +178,8 @@
      * that the instance can be deleted or set up to a new 
zwp_relative_pointer_v1 interface
      * once there is a new connection available.
      *
-     * It is suggested to connect this method to 
ConnectionThread::connectionDied:
-     * @code
-     * connect(connection, &ConnectionThread::connectionDied, 
relativepointerunstablev1, &RelativePointerUnstableV1::destroy);
-     * @endcode
+     * This method is automatically invoked when the Registry which created 
this
+     * RelativePointer gets destroyed.
      *
      * @see release
      **/
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/kwayland-5.36.0/src/client/seat.h 
new/kwayland-5.37.0/src/client/seat.h
--- old/kwayland-5.36.0/src/client/seat.h       2017-07-01 17:01:18.000000000 
+0200
+++ new/kwayland-5.37.0/src/client/seat.h       2017-08-06 18:55:14.000000000 
+0200
@@ -116,10 +116,8 @@
      * that the instance can be deleted or set up to a new wl_shell interface
      * once there is a new connection available.
      *
-     * It is suggested to connect this method to 
ConnectionThread::connectionDied:
-     * @code
-     * connect(connection, &ConnectionThread::connectionDied, seat, 
&Seat::destroy);
-     * @endcode
+     * This method is automatically invoked when the Registry which created 
this
+     * Seat gets destroyed.
      *
      * Right before the data is destroyed the signal 
interfaceAboutToBeDestroyed is emitted.
      *
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/kwayland-5.36.0/src/client/server_decoration.h 
new/kwayland-5.37.0/src/client/server_decoration.h
--- old/kwayland-5.36.0/src/client/server_decoration.h  2017-07-01 
17:01:18.000000000 +0200
+++ new/kwayland-5.37.0/src/client/server_decoration.h  2017-08-06 
18:55:14.000000000 +0200
@@ -176,10 +176,8 @@
      * that the instance can be deleted or set up to a new 
org_kde_kwin_server_decoration interface
      * once there is a new connection available.
      *
-     * It is suggested to connect this method to 
ConnectionThread::connectionDied:
-     * @code
-     * connect(connection, &ConnectionThread::connectionDied, 
serversidedecoration, &ServerSideDecoration::destroy);
-     * @endcode
+     * This method is automatically invoked when the Registry which created 
this
+     * ServerDecoration gets destroyed.
      *
      * @see release
      **/
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/kwayland-5.36.0/src/client/shadow.cpp 
new/kwayland-5.37.0/src/client/shadow.cpp
--- old/kwayland-5.36.0/src/client/shadow.cpp   2017-07-01 17:01:18.000000000 
+0200
+++ new/kwayland-5.37.0/src/client/shadow.cpp   2017-08-06 18:55:14.000000000 
+0200
@@ -175,6 +175,9 @@
 } \
 void Shadow::attach##__PART__(Buffer *buffer) \
 { \
+    if (!buffer) {\
+        return;\
+    }\
     attach##__PART__(buffer->buffer()); \
 } \
 void Shadow::attach##__PART__(Buffer::Ptr buffer) \
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/kwayland-5.36.0/src/client/shadow.h 
new/kwayland-5.37.0/src/client/shadow.h
--- old/kwayland-5.36.0/src/client/shadow.h     2017-07-01 17:01:18.000000000 
+0200
+++ new/kwayland-5.37.0/src/client/shadow.h     2017-08-06 18:55:14.000000000 
+0200
@@ -106,10 +106,8 @@
      * that the instance can be deleted or set up to a new 
org_kde_kwin_shadow_manager interface
      * once there is a new connection available.
      *
-     * It is suggested to connect this method to 
ConnectionThread::connectionDied:
-     * @code
-     * connect(connection, &ConnectionThread::connectionDied, compositor, 
&ShadowManager::destroy);
-     * @endcode
+     * This method is automatically invoked when the Registry which created 
this
+     * Shadow gets destroyed.
      *
      * @see release
      **/
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/kwayland-5.36.0/src/client/shm_pool.h 
new/kwayland-5.37.0/src/client/shm_pool.h
--- old/kwayland-5.36.0/src/client/shm_pool.h   2017-07-01 17:01:18.000000000 
+0200
+++ new/kwayland-5.37.0/src/client/shm_pool.h   2017-08-06 18:55:14.000000000 
+0200
@@ -164,10 +164,8 @@
      *
      * All Buffers are destroyed!
      *
-     * It is suggested to connect this method to 
ConnectionThread::connectionDied:
-     * @code
-     * connect(connection, &ConnectionThread::connectionDied, shmPool, 
&ShmPool::destroy);
-     * @endcode
+     * This method is automatically invoked when the Registry which created 
this
+     * ShmPool gets destroyed.
      *
      * @see release
      **/
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/kwayland-5.36.0/src/client/slide.h 
new/kwayland-5.37.0/src/client/slide.h
--- old/kwayland-5.36.0/src/client/slide.h      2017-07-01 17:01:18.000000000 
+0200
+++ new/kwayland-5.37.0/src/client/slide.h      2017-08-06 18:55:14.000000000 
+0200
@@ -104,10 +104,8 @@
      * that the instance can be deleted or set up to a new 
org_kde_kwin_slide_manager interface
      * once there is a new connection available.
      *
-     * It is suggested to connect this method to 
ConnectionThread::connectionDied:
-     * @code
-     * connect(connection, &ConnectionThread::connectionDied, slidemanager, 
&SlideManager::destroy);
-     * @endcode
+     * This method is automatically invoked when the Registry which created 
this
+     * SlideManager gets destroyed.
      *
      * @see release
      **/
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/kwayland-5.36.0/src/client/surface.h 
new/kwayland-5.37.0/src/client/surface.h
--- old/kwayland-5.36.0/src/client/surface.h    2017-07-01 17:01:18.000000000 
+0200
+++ new/kwayland-5.37.0/src/client/surface.h    2017-08-06 18:55:14.000000000 
+0200
@@ -106,10 +106,8 @@
      * that the instance can be deleted or set up to a new wl_surface interface
      * once there is a new connection available.
      *
-     * It is suggested to connect this method to 
ConnectionThread::connectionDied:
-     * @code
-     * connect(connection, &ConnectionThread::connectionDied, surface, 
&Surface::destroy);
-     * @endcode
+     * This method is automatically invoked when the Registry which created 
this
+     * Surface gets destroyed.
      *
      * @see release
      **/
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/kwayland-5.36.0/src/client/textinput.h 
new/kwayland-5.37.0/src/client/textinput.h
--- old/kwayland-5.36.0/src/client/textinput.h  2017-07-01 17:01:18.000000000 
+0200
+++ new/kwayland-5.37.0/src/client/textinput.h  2017-08-06 18:55:14.000000000 
+0200
@@ -465,10 +465,8 @@
      * that the instance can be deleted or set up to a new  interface
      * once there is a new connection available.
      *
-     * It is suggested to connect this method to 
ConnectionThread::connectionDied:
-     * @code
-     * connect(connection, &ConnectionThread::connectionDied, 
textinputmanager, &TextInputManager::destroy);
-     * @endcode
+     * This method is automatically invoked when the Registry which created 
this
+     * TextInput gets destroyed.
      *
      * @see release
      **/
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/kwayland-5.36.0/src/client/xdgshell.h 
new/kwayland-5.37.0/src/client/xdgshell.h
--- old/kwayland-5.36.0/src/client/xdgshell.h   2017-07-01 17:01:18.000000000 
+0200
+++ new/kwayland-5.37.0/src/client/xdgshell.h   2017-08-06 18:55:14.000000000 
+0200
@@ -95,10 +95,8 @@
      * that the instance can be deleted or set up to a new xdg_shell interface
      * once there is a new connection available.
      *
-     * It is suggested to connect this method to 
ConnectionThread::connectionDied:
-     * @code
-     * connect(connection, &ConnectionThread::connectionDied, xdgshellv5, 
&XdgShell::destroy);
-     * @endcode
+     * This method is automatically invoked when the Registry which created 
this
+     * XdgShell gets destroyed.
      *
      * @see release
      **/
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/kwayland-5.36.0/src/server/keyboard_interface.cpp 
new/kwayland-5.37.0/src/server/keyboard_interface.cpp
--- old/kwayland-5.36.0/src/server/keyboard_interface.cpp       2017-07-01 
17:01:18.000000000 +0200
+++ new/kwayland-5.37.0/src/server/keyboard_interface.cpp       2017-08-06 
18:55:14.000000000 +0200
@@ -121,9 +121,12 @@
     if (!d->focusedSurface) {
         return;
     }
-    d->destroyConnection = connect(d->focusedSurface, &QObject::destroyed, 
this,
+    d->destroyConnection = connect(d->focusedSurface, 
&Resource::aboutToBeUnbound, this,
         [this] {
             Q_D();
+            if (d->resource) {
+                wl_keyboard_send_leave(d->resource, 
d->global->display()->nextSerial(), d->focusedSurface->resource());
+            }
             d->focusedSurface = nullptr;
             d->focusedChildSurface.clear();
         }
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/kwayland-5.36.0/src/server/pointer_interface.cpp 
new/kwayland-5.37.0/src/server/pointer_interface.cpp
--- old/kwayland-5.36.0/src/server/pointer_interface.cpp        2017-07-01 
17:01:18.000000000 +0200
+++ new/kwayland-5.37.0/src/server/pointer_interface.cpp        2017-08-06 
18:55:14.000000000 +0200
@@ -265,9 +265,10 @@
         return;
     }
     d->focusedSurface = surface;
-    d->destroyConnection = connect(d->focusedSurface, &QObject::destroyed, 
this,
+    d->destroyConnection = connect(d->focusedSurface, 
&Resource::aboutToBeUnbound, this,
         [this] {
             Q_D();
+            d->sendLeave(d->focusedChildSurface.data(), 
d->global->display()->nextSerial());
             d->focusedSurface = nullptr;
             d->focusedChildSurface.clear();
         }
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/kwayland-5.36.0/src/server/resource.cpp 
new/kwayland-5.37.0/src/server/resource.cpp
--- old/kwayland-5.36.0/src/server/resource.cpp 2017-07-01 17:01:18.000000000 
+0200
+++ new/kwayland-5.37.0/src/server/resource.cpp 2017-08-06 18:55:14.000000000 
+0200
@@ -63,6 +63,7 @@
 void Resource::Private::unbind(wl_resource *r)
 {
     Private *p = cast<Private>(r);
+    emit p->q->aboutToBeUnbound();
     p->resource = nullptr;
     emit p->q->unbound();
     p->q->deleteLater();
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/kwayland-5.36.0/src/server/resource.h 
new/kwayland-5.37.0/src/server/resource.h
--- old/kwayland-5.36.0/src/server/resource.h   2017-07-01 17:01:18.000000000 
+0200
+++ new/kwayland-5.37.0/src/server/resource.h   2017-08-06 18:55:14.000000000 
+0200
@@ -81,6 +81,16 @@
      * @since 5.24
      **/
     void unbound();
+    /**
+     * This signal is emitted when the client is in the process of unbinding 
the Resource.
+     * In opposite to @link{unbound} the @link{resource} is still valid and 
allows to perform
+     * cleanup tasks. Example: send a keyboard leave for the Surface which is 
in the process of
+     * getting destroyed.
+     *
+     * @see unbound
+     * @since 5.37
+     **/
+    void aboutToBeUnbound();
 
 protected:
     class Private;
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/kwayland-5.36.0/src/server/seat_interface.cpp 
new/kwayland-5.37.0/src/server/seat_interface.cpp
--- old/kwayland-5.36.0/src/server/seat_interface.cpp   2017-07-01 
17:01:18.000000000 +0200
+++ new/kwayland-5.37.0/src/server/seat_interface.cpp   2017-08-06 
18:55:14.000000000 +0200
@@ -1437,7 +1437,7 @@
     }
     d->textInput.focus.textInput = t;
     if (d->textInput.focus.surface) {
-        d->textInput.focus.destroyConnection = connect(surface, 
&QObject::destroyed, this,
+        d->textInput.focus.destroyConnection = connect(surface, 
&Resource::aboutToBeUnbound, this,
             [this] {
                 setFocusedTextInputSurface(nullptr);
             }
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/kwayland-5.36.0/src/server/touch_interface.cpp 
new/kwayland-5.37.0/src/server/touch_interface.cpp
--- old/kwayland-5.36.0/src/server/touch_interface.cpp  2017-07-01 
17:01:18.000000000 +0200
+++ new/kwayland-5.37.0/src/server/touch_interface.cpp  2017-08-06 
18:55:14.000000000 +0200
@@ -37,7 +37,6 @@
     Private(SeatInterface *parent, wl_resource *parentResource, TouchInterface 
*q);
 
     SeatInterface *seat;
-    SurfaceInterface *focusedSurface = nullptr;
     QMetaObject::Connection destroyConnection;
 
 private:


Reply via email to