[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-commits
Subject:    [latte-dock] app: update wayland code based on plasma
From:       Michail Vourlakos <null () kde ! org>
Date:       2018-02-28 23:31:41
Message-ID: E1erBCH-0005Ev-AN () code ! kde ! org
[Download RAW message or body]

Git commit 0a1488b64316dc8f7ebc2439f09a717ede58305e by Michail Vourlakos.
Committed on 28/02/2018 at 22:52.
Pushed by mvourlakos into branch 'master'.

update wayland code based on plasma

M  +1    -1    app/dock/dockconfigview.cpp
M  +1    -1    app/dock/docksecconfigview.cpp
M  +1    -3    app/dock/dockview.cpp
M  +10   -8    app/dockcorona.cpp

https://commits.kde.org/latte-dock/0a1488b64316dc8f7ebc2439f09a717ede58305e

diff --git a/app/dock/dockconfigview.cpp b/app/dock/dockconfigview.cpp
index 51faed0..f3735b1 100644
--- a/app/dock/dockconfigview.cpp
+++ b/app/dock/dockconfigview.cpp
@@ -400,9 +400,9 @@ bool DockConfigView::event(QEvent *e)
                     if (m_shellSurface) {
                         delete m_shellSurface;
                         m_shellSurface = nullptr;
+                        PanelShadows::self()->removeWindow(this);
                     }
 
-                    PanelShadows::self()->removeWindow(this);
                     break;
             }
         }
diff --git a/app/dock/docksecconfigview.cpp b/app/dock/docksecconfigview.cpp
index 843d9b7..de0de27 100644
--- a/app/dock/docksecconfigview.cpp
+++ b/app/dock/docksecconfigview.cpp
@@ -309,9 +309,9 @@ bool DockSecConfigView::event(QEvent *e)
                     if (m_shellSurface) {
                         delete m_shellSurface;
                         m_shellSurface = nullptr;
+                        PanelShadows::self()->removeWindow(this);
                     }
 
-                    PanelShadows::self()->removeWindow(this);
                     break;
             }
         }
diff --git a/app/dock/dockview.cpp b/app/dock/dockview.cpp
index f4ade12..7e6861e 100644
--- a/app/dock/dockview.cpp
+++ b/app/dock/dockview.cpp
@@ -344,12 +344,11 @@ void DockView::availableScreenRectChanged()
 
 void DockView::setupWaylandIntegration()
 {
-    using namespace KWayland::Client;
-
     if (m_shellSurface)
         return;
 
     if (DockCorona *c = qobject_cast<DockCorona *>(corona())) {
+        using namespace KWayland::Client;
         PlasmaShell *interface{c->waylandDockCoronaInterface()};
 
         if (!interface)
@@ -1674,7 +1673,6 @@ bool DockView::event(QEvent *e)
 
                         case QPlatformSurfaceEvent::SurfaceAboutToBeDestroyed:
                             if (m_shellSurface) {
-                                m_shellSurface->release();
                                 delete m_shellSurface;
                                 m_shellSurface = nullptr;
                                 qDebug() << "wayland dock window surface was deleted...";
diff --git a/app/dockcorona.cpp b/app/dockcorona.cpp
index 2839e9a..a8a2e75 100644
--- a/app/dockcorona.cpp
+++ b/app/dockcorona.cpp
@@ -208,16 +208,17 @@ void DockCorona::unload()
 
 void DockCorona::setupWaylandIntegration()
 {
-    using namespace KWayland::Client;
-
     if (!KWindowSystem::isPlatformWayland()) {
         return;
     }
 
+    using namespace KWayland::Client;
+
     auto connection = ConnectionThread::fromApplication(this);
 
-    if (!connection)
+    if (!connection) {
         return;
+    }
 
     Registry *registry{new Registry(this)};
     registry->create(connection);
@@ -227,14 +228,15 @@ void DockCorona::setupWaylandIntegration()
         m_waylandDockCorona = registry->createPlasmaShell(name, version, this);
     });
 
-    connect(qApp, &QCoreApplication::aboutToQuit, this, [this, registry]() {
-        if (m_waylandDockCorona)
-            m_waylandDockCorona->release();
+    /* connect(qApp, &QCoreApplication::aboutToQuit, this, [this, registry]() {
+         if (m_waylandDockCorona)
+             m_waylandDockCorona->release();
 
-        registry->release();
-    });
+         registry->release();
+     });*/
 
     registry->setup();
+    connection->roundtrip();
 }
 
 KWayland::Client::PlasmaShell *DockCorona::waylandDockCoronaInterface() const

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic