[prev in list] [next in list] [prev in thread] [next in thread]
List: kde-commits
Subject: [kwin] /: Ensure Workspace is only started once in Wayland-only mode
From: Martin_Flöser <null () kde ! org>
Date: 2017-10-01 7:07:58
Message-ID: E1dyYM2-0001e5-DN () code ! kde ! org
[Download RAW message or body]
Git commit d75e5c63d4dafd9432b76f9efd1bc1fb36260e98 by Martin Flöser.
Committed on 01/10/2017 at 07:06.
Pushed by graesslin into branch 'master'.
Ensure Workspace is only started once in Wayland-only mode
The connect to Compositor::sceneCreated must be disconnected again,
otherwise a restart of the Compositor results in Workspace being created
again.
Thanks to our autotests for finding this problem!
M +7 -5 autotests/integration/kwin_wayland_test.cpp
M +1 -0 autotests/integration/kwin_wayland_test.h
M +9 -7 main_wayland.cpp
M +1 -0 main_wayland.h
https://commits.kde.org/kwin/d75e5c63d4dafd9432b76f9efd1bc1fb36260e98
diff --git a/autotests/integration/kwin_wayland_test.cpp \
b/autotests/integration/kwin_wayland_test.cpp index 1af5c065f..6adf2512f 100644
--- a/autotests/integration/kwin_wayland_test.cpp
+++ b/autotests/integration/kwin_wayland_test.cpp
@@ -119,17 +119,19 @@ void WaylandTestApplication::continueStartupWithScreens()
if (operationMode() == OperationModeWaylandOnly) {
createCompositor();
- connect(Compositor::self(), &Compositor::sceneCreated, this,
- [this] {
- createWorkspace();
- }
- );
+ connect(Compositor::self(), &Compositor::sceneCreated, this, \
&WaylandTestApplication::continueStartupWithSceen); return;
}
createCompositor();
connect(Compositor::self(), &Compositor::sceneCreated, this, \
&WaylandTestApplication::startXwaylandServer); }
+void WaylandTestApplication::continueStartupWithSceen()
+{
+ disconnect(Compositor::self(), &Compositor::sceneCreated, this, \
&WaylandTestApplication::continueStartupWithSceen); + createWorkspace();
+}
+
void WaylandTestApplication::continueStartupWithX()
{
createX11Connection();
diff --git a/autotests/integration/kwin_wayland_test.h \
b/autotests/integration/kwin_wayland_test.h index 2a27962eb..c79b38f39 100644
--- a/autotests/integration/kwin_wayland_test.h
+++ b/autotests/integration/kwin_wayland_test.h
@@ -64,6 +64,7 @@ private:
void createBackend();
void createX11Connection();
void continueStartupWithScreens();
+ void continueStartupWithSceen();
void continueStartupWithX();
void startXwaylandServer();
diff --git a/main_wayland.cpp b/main_wayland.cpp
index 0e749c4dc..fad5b798e 100644
--- a/main_wayland.cpp
+++ b/main_wayland.cpp
@@ -162,19 +162,21 @@ void ApplicationWayland::continueStartupWithScreens()
if (operationMode() == OperationModeWaylandOnly) {
createCompositor();
- connect(Compositor::self(), &Compositor::sceneCreated, this,
- [this] {
- startSession();
- createWorkspace();
- notifyKSplash();
- }
- );
+ connect(Compositor::self(), &Compositor::sceneCreated, this, \
&ApplicationWayland::continueStartupWithSceen); return;
}
createCompositor();
connect(Compositor::self(), &Compositor::sceneCreated, this, \
&ApplicationWayland::startXwaylandServer); }
+void ApplicationWayland::continueStartupWithSceen()
+{
+ disconnect(Compositor::self(), &Compositor::sceneCreated, this, \
&ApplicationWayland::continueStartupWithSceen); + startSession();
+ createWorkspace();
+ notifyKSplash();
+}
+
void ApplicationWayland::continueStartupWithX()
{
createX11Connection();
diff --git a/main_wayland.h b/main_wayland.h
index e7a642f56..31b7ebd55 100644
--- a/main_wayland.h
+++ b/main_wayland.h
@@ -61,6 +61,7 @@ private:
void createBackend();
void createX11Connection();
void continueStartupWithScreens();
+ void continueStartupWithSceen();
void continueStartupWithX();
void startXwaylandServer();
void startSession();
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic