KManagerSelection::claim() emits signal in case it fails
We need to connect to this signal instead of waiting for it to time out. This means we are already starting the window manager while it might be that we fail.
This commit is contained in:
parent
1e0600bbc7
commit
053841f87f
1 changed files with 3 additions and 2 deletions
5
main.cpp
5
main.cpp
|
@ -323,11 +323,12 @@ Application::Application()
|
|||
if (screen_number == -1)
|
||||
screen_number = DefaultScreen(display());
|
||||
|
||||
if (!owner.claim(args->isSet("replace"), true)) {
|
||||
connect(&owner, &KSelectionOwner::failedToClaimOwnership, []{
|
||||
fputs(i18n("kwin: unable to claim manager selection, another wm running? (try using --replace)\n").toLocal8Bit().constData(), stderr);
|
||||
::exit(1);
|
||||
}
|
||||
});
|
||||
connect(&owner, SIGNAL(lostOwnership()), SLOT(lostSelection()));
|
||||
owner.claim(args->isSet("replace"), true);
|
||||
|
||||
KCrash::setEmergencySaveFunction(Application::crashHandler);
|
||||
crashes = args->getOption("crashes").toInt();
|
||||
|
|
Loading…
Reference in a new issue