kwin: add new KWin::Compositor::starting() method and use it in during startup

I have a feeling even that will not be enough

Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
This commit is contained in:
Ivailo Monev 2022-11-13 21:37:58 +02:00
parent 16d6d9df9a
commit 2935698c0c
2 changed files with 20 additions and 1 deletions

View file

@ -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);

View file

@ -60,6 +60,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
#include "utils.h"
#include "effects.h"
#include "workspace.h"
#include "composite.h"
#include "xcbutils.h"
#include <X11/Xproto.h>
@ -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;