From 77c4904770841a44ea74a93dc9741b1fafe35a0e Mon Sep 17 00:00:00 2001 From: Jacek Antonelli Date: Fri, 15 Aug 2008 23:45:32 -0500 Subject: Second Life viewer sources 1.19.0.4 --- linden/indra/newview/llappviewer.cpp | 44 ++++++------------------ linden/indra/newview/llfloateractivespeakers.cpp | 18 ++++++++++ linden/indra/newview/releasenotes.txt | 8 +++++ 3 files changed, 37 insertions(+), 33 deletions(-) (limited to 'linden/indra') diff --git a/linden/indra/newview/llappviewer.cpp b/linden/indra/newview/llappviewer.cpp index e3d7073..30ac8fa 100644 --- a/linden/indra/newview/llappviewer.cpp +++ b/linden/indra/newview/llappviewer.cpp @@ -2610,43 +2610,36 @@ void LLAppViewer::setCrashBehavior(S32 cb) bool LLAppViewer::anotherInstanceRunning() { - // We create a marker file when the program starts and remove the file when it finishes. + // We create a marker file when the program starts and remove the file when it finishes. // If the file is currently locked, that means another process is already running. std::string marker_file = gDirUtilp->getExpandedFilename(LL_PATH_LOGS, MARKER_FILE_NAME); llinfos << "Checking marker file for lock..." << llendl; - // If file doesn't exist, we create it - // If file does exist, try to get writing privileges - FILE* fMarker = LLFile::fopen(marker_file.c_str(), "rb"); // Flawfinder: ignore + //Freeze case checks + apr_file_t* fMarker = ll_apr_file_open(marker_file, LL_APR_RB); if (fMarker != NULL) { // File exists, try opening with write permissions - fclose(fMarker); - fMarker = LLFile::fopen(marker_file.c_str(), "wb"); // Flawfinder: ignore + apr_file_close(fMarker); + fMarker = ll_apr_file_open(marker_file, LL_APR_WB); if (fMarker == NULL) { + // Another instance is running. Skip the rest of these operations. llinfos << "Marker file is locked." << llendl; return TRUE; } - - // *FIX:Mani - rather than have this exception here, - // LLFile::fopen() have consistent behavior across platforms? -#if LL_DARWIN || LL_LINUX || LL_SOLARIS - // Try to lock it. On Mac, this is the only way to test if it's actually locked. - if (flock(fileno(fMarker), LOCK_EX | LOCK_NB) == -1) + if (apr_file_lock(fMarker, APR_FLOCK_NONBLOCK | APR_FLOCK_EXCLUSIVE) != APR_SUCCESS) //flock(fileno(fMarker), LOCK_EX | LOCK_NB) == -1) { - // Lock failed - somebody else has it. - fclose(fMarker); + apr_file_close(fMarker); llinfos << "Marker file is locked." << llendl; return TRUE; } -#endif - fclose(fMarker); + // No other instances; we'll lock this file now & delete on quit. + apr_file_close(fMarker); } llinfos << "Marker file isn't locked." << llendl; return FALSE; - } void LLAppViewer::initMarkerFile() @@ -2688,25 +2681,10 @@ void LLAppViewer::initMarkerFile() ll_apr_file_remove(error_marker_file); //Freeze case checks + if(anotherInstanceRunning()) return; fMarker = ll_apr_file_open(mMarkerFileName, LL_APR_RB); if (fMarker != NULL) { - // File exists, try opening with write permissions - apr_file_close(fMarker); - fMarker = ll_apr_file_open(mMarkerFileName, LL_APR_WB); - if (fMarker == NULL) - { - // Another instance is running. Skip the rest of these operations. - llinfos << "Marker file is locked." << llendl; - return; - } - if (apr_file_lock(fMarker, APR_FLOCK_NONBLOCK | APR_FLOCK_EXCLUSIVE) != APR_SUCCESS) //flock(fileno(fMarker), LOCK_EX | LOCK_NB) == -1) - { - apr_file_close(fMarker); - llinfos << "Marker file is locked." << llendl; - return; - } - // No other instances; we'll lock this file now & delete on quit. apr_file_close(fMarker); gLastExecEvent = LAST_EXEC_FROZE; llinfos << "Exec marker found: program froze on previous execution" << llendl; diff --git a/linden/indra/newview/llfloateractivespeakers.cpp b/linden/indra/newview/llfloateractivespeakers.cpp index 8432d21..21b302a 100644 --- a/linden/indra/newview/llfloateractivespeakers.cpp +++ b/linden/indra/newview/llfloateractivespeakers.cpp @@ -486,11 +486,16 @@ void LLPanelActiveSpeakers::refreshSpeakers() LLScrollListCell* name_cell = itemp->getColumn(1); if (name_cell) { + //FIXME: remove hard coding of font colors if (speakerp->mStatus == LLSpeaker::STATUS_NOT_IN_CHANNEL) { // draw inactive speakers in gray name_cell->setColor(LLColor4::grey4); } + else + { + name_cell->setColor(LLColor4::black); + } LLString speaker_name; if (speakerp->mDisplayName.empty()) @@ -1294,6 +1299,19 @@ void LLActiveSpeakerMgr::updateSpeakerList() mVoiceChannel = LLVoiceChannel::getCurrentVoiceChannel(); } LLSpeakerMgr::updateSpeakerList(); + + // clean up text only speakers + for (speaker_map_t::iterator speaker_it = mSpeakers.begin(); speaker_it != mSpeakers.end(); ++speaker_it) + { + LLUUID speaker_id = speaker_it->first; + LLSpeaker* speakerp = speaker_it->second; + if (speakerp->mStatus == LLSpeaker::STATUS_TEXT_ONLY) + { + // automatically flag text only speakers for removal + speakerp->mStatus = LLSpeaker::STATUS_NOT_IN_CHANNEL; + } + } + } diff --git a/linden/indra/newview/releasenotes.txt b/linden/indra/newview/releasenotes.txt index 7aa71f9..b7fb7e6 100644 --- a/linden/indra/newview/releasenotes.txt +++ b/linden/indra/newview/releasenotes.txt @@ -1,3 +1,11 @@ +Release Notes for Second Life 1.19.0(4) February 26th, 2008 +===================================== + +Fixes: +* VWR-4921: not recognising in Linux that client is already running +* VWR-4960: Active Speakers list does not clear in 1.19.0 (2) + + Release Notes for Second Life 1.19.0(3) February 22nd, 2008 ===================================== -- cgit v1.1