BApplication: Fix B_ARGV_* handling on silent relaunch.

In hrev47355 a logic reversal was introduced as part of a cleanup
commit which caused B_ARGV_RECEIVED to be sent only to apps with the
B_ARGV_ONLY flag set instead of clear.

In addition to that, don't send the B_SILENT_RELAUNCH message for apps
with B_ARGV_ONLY either, as they are not supposed to receive messages
after launch. This is in line with the documentation and what BRoster
does.
This commit is contained in:
Michael Lotz
2015-04-20 23:27:52 +02:00
parent 06ba99b08a
commit 9b3be14015
+6 -5
View File
@@ -445,10 +445,11 @@ BApplication::_InitData(const char* signature, bool initGUI, status_t* _error)
if (otherTeam >= 0) { if (otherTeam >= 0) {
BMessenger otherApp(NULL, otherTeam); BMessenger otherApp(NULL, otherTeam);
app_info otherAppInfo; app_info otherAppInfo;
if (__libc_argc > 1 bool argvOnly = be_roster->GetRunningAppInfo(otherTeam,
&& be_roster->GetRunningAppInfo(otherTeam, &otherAppInfo) &otherAppInfo) == B_OK
== B_OK && (otherAppInfo.flags & B_ARGV_ONLY) != 0;
&& (otherAppInfo.flags & B_ARGV_ONLY) != 0) {
if (__libc_argc > 1 && !argvOnly) {
// create an B_ARGV_RECEIVED message // create an B_ARGV_RECEIVED message
BMessage argvMessage(B_ARGV_RECEIVED); BMessage argvMessage(B_ARGV_RECEIVED);
fill_argv_message(argvMessage); fill_argv_message(argvMessage);
@@ -461,7 +462,7 @@ BApplication::_InitData(const char* signature, bool initGUI, status_t* _error)
// send the message // send the message
otherApp.SendMessage(&argvMessage); otherApp.SendMessage(&argvMessage);
} else } else if (!argvOnly)
otherApp.SendMessage(B_SILENT_RELAUNCH); otherApp.SendMessage(B_SILENT_RELAUNCH);
} }
} else if (fInitError == B_OK) { } else if (fInitError == B_OK) {