Delay startup till the manager selection is claimed
Moving all the startup code into closure connected to the claimedOwnership signal.
This commit is contained in:
parent
dcc273fe0f
commit
8da23f76d3
1 changed files with 54 additions and 53 deletions
9
main.cpp
9
main.cpp
|
@ -214,15 +214,14 @@ Application::Application()
|
||||||
}
|
}
|
||||||
|
|
||||||
if (screen_number == -1)
|
if (screen_number == -1)
|
||||||
screen_number = DefaultScreen(display());
|
screen_number = QX11Info::appScreen();
|
||||||
|
|
||||||
connect(&owner, &KSelectionOwner::failedToClaimOwnership, []{
|
connect(&owner, &KSelectionOwner::failedToClaimOwnership, []{
|
||||||
fputs(i18n("kwin: unable to claim manager selection, another wm running? (try using --replace)\n").toLocal8Bit().constData(), stderr);
|
fputs(i18n("kwin: unable to claim manager selection, another wm running? (try using --replace)\n").toLocal8Bit().constData(), stderr);
|
||||||
::exit(1);
|
::exit(1);
|
||||||
});
|
});
|
||||||
connect(&owner, SIGNAL(lostOwnership()), SLOT(lostSelection()));
|
connect(&owner, SIGNAL(lostOwnership()), SLOT(lostSelection()));
|
||||||
owner.claim(args->isSet("replace"), true);
|
connect(&owner, &KSelectionOwner::claimedOwnership, [this, args, config]{
|
||||||
|
|
||||||
KCrash::setEmergencySaveFunction(Application::crashHandler);
|
KCrash::setEmergencySaveFunction(Application::crashHandler);
|
||||||
crashes = args->getOption("crashes").toInt();
|
crashes = args->getOption("crashes").toInt();
|
||||||
if (crashes >= 4) {
|
if (crashes >= 4) {
|
||||||
|
@ -263,7 +262,7 @@ Application::Application()
|
||||||
|
|
||||||
atoms = new Atoms;
|
atoms = new Atoms;
|
||||||
|
|
||||||
// initting = false; // TODO
|
// initting = false; // TODO
|
||||||
|
|
||||||
// This tries to detect compositing options and can use GLX. GLX problems
|
// This tries to detect compositing options and can use GLX. GLX problems
|
||||||
// (X errors) shouldn't cause kwin to abort, so this is out of the
|
// (X errors) shouldn't cause kwin to abort, so this is out of the
|
||||||
|
@ -284,6 +283,8 @@ Application::Application()
|
||||||
e.xclient.format = 8;
|
e.xclient.format = 8;
|
||||||
strcpy(e.xclient.data.b, "wm");
|
strcpy(e.xclient.data.b, "wm");
|
||||||
XSendEvent(display(), rootWindow(), False, SubstructureNotifyMask, &e);
|
XSendEvent(display(), rootWindow(), False, SubstructureNotifyMask, &e);
|
||||||
|
});
|
||||||
|
owner.claim(args->isSet("replace"), true);
|
||||||
}
|
}
|
||||||
|
|
||||||
Application::~Application()
|
Application::~Application()
|
||||||
|
|
Loading…
Reference in a new issue