diff --git a/kwin/composite.h b/kwin/composite.h
index e6df5a72..42b10bec 100644
--- a/kwin/composite.h
+++ b/kwin/composite.h
@@ -122,6 +122,14 @@ public:
static bool compositing() {
return s_compositor != NULL && s_compositor->isActive();
}
+ /**
+ * @brief Static check to test whether the Compositor is still starting.
+ *
+ * @return bool @c true if there is a Compositor and it is still starting, @c false otherwise
+ **/
+ static bool starting() {
+ return s_compositor != NULL && s_compositor->m_starting;
+ }
// for delayed supportproperty management of effects
void keepSupportProperty(xcb_atom_t atom);
diff --git a/kwin/main.cpp b/kwin/main.cpp
index 1a920fc4..c1b60d74 100644
--- a/kwin/main.cpp
+++ b/kwin/main.cpp
@@ -60,6 +60,7 @@ along with this program. If not, see .
#include "utils.h"
#include "effects.h"
#include "workspace.h"
+#include "composite.h"
#include "xcbutils.h"
#include
@@ -488,7 +489,17 @@ int main(int argc, char * argv[])
return 1;
}
- a.processEvents(); // trigger any events before resuming such as compositor setup
+ // wait for the workspace initialization to complete before resuming
+ while (KWin::Workspace::self() && KWin::Workspace::self()->initializing()) {
+ a.processEvents();
+ }
+ // and the compositor
+ while (KWin::Compositor::starting()) {
+ a.processEvents();
+ }
+ // and one more iteration just in case
+ a.processEvents();
+
ksmserver.resumeStartup("kwin");
KWin::SessionManager weAreIndeed;
KWin::SessionSaveDoneHelper helper;