From cc5f95c229b63e8fbc4dccd23db0d2651660b73d Mon Sep 17 00:00:00 2001 From: Nicky Date: Sun, 26 Sep 2021 20:38:41 +0200 Subject: [PATCH 01/48] Remove gtk/atk dependency by using fltk instead. --- autobuild.xml | 96 +++++++++++-------- indra/cmake/Copy3rdPartyLibs.cmake | 7 -- indra/cmake/DBusGlib.cmake | 47 ++++----- indra/cmake/GLIB.cmake | 11 +++ indra/cmake/UI.cmake | 37 +++---- .../linux_crash_logger/llcrashloggerlinux.cpp | 1 + indra/llwindow/llwindowsdl.cpp | 1 + indra/newview/llappviewerlinux.h | 8 +- indra/newview/lldirpicker.cpp | 41 +++++++- indra/newview/lldirpicker.h | 2 +- indra/newview/llfilepicker.cpp | 77 ++++++++++++++- indra/newview/llfilepicker.h | 18 +++- 12 files changed, 245 insertions(+), 101 deletions(-) create mode 100644 indra/cmake/GLIB.cmake diff --git a/autobuild.xml b/autobuild.xml index 963dd22556..ea8a8c65cb 100644 --- a/autobuild.xml +++ b/autobuild.xml @@ -3,6 +3,62 @@ installables + glib + + copyright + Copyright (C) glib project + license + LGPL + license_file + LICENSES/glib.txt + name + glib + platforms + + linux64 + + archive + + hash + 9c93ba8b8af97fc8379f77de77e1540a + url + http://3p.firestormviewer.org/glib-2.48.0.202301938-linux64-202301938.tar.bz2 + + name + linux + + + version + 2.48.0 + + fltk + + copyright + Copyright (C) fltk project + license + LGPL/fltk + license_file + LICENSES/fltk.txt + name + fltk + platforms + + linux64 + + archive + + hash + 81fe1e927e4fe3c5e5f15ce6219ca883 + url + http://3p.firestormviewer.org/fltk-1.3.5.202282121-linux64-202282121.tar.bz2 + + name + linux + + + version + 1.3.5 + jemalloc copyright @@ -1603,46 +1659,6 @@ version 0.10.6.314267 - gtk-atk-pango-glib - - copyright - Copyright (various, see sources) - license - lgpl - license_file - LICENSES/gtk-atk-pango-glib.txt - name - gtk-atk-pango-glib - platforms - - linux - - archive - - hash - fb047d496c32cc3b9f99793ee6ebb1e3 - url - http://3p.firestormviewer.org/gtk_atk_pango_glib-2.1-linux-180871647.tar.bz2 - - name - linux - - linux64 - - archive - - hash - d918d894430c1d1d869b9f2e06570c65 - url - http://3p.firestormviewer.org/gtk_atk_pango_glib-2.1-linux64-180841902.tar.bz2 - - name - linux64 - - - version - 2.1 - havok-source copyright diff --git a/indra/cmake/Copy3rdPartyLibs.cmake b/indra/cmake/Copy3rdPartyLibs.cmake index 386c503734..466a2a4475 100644 --- a/indra/cmake/Copy3rdPartyLibs.cmake +++ b/indra/cmake/Copy3rdPartyLibs.cmake @@ -239,16 +239,9 @@ elseif(LINUX) # have to deal with if (NOT USESYSTEMLIBS) set(release_files - #libapr-1.so.0 - #libaprutil-1.so.0 - libatk-1.0.so #libdb-5.1.so ${EXPAT_COPY} - #libfreetype.so.6.6.2 - #libfreetype.so.6 #libGLOD.so - libgmodule-2.0.so - libgobject-2.0.so libhunspell-1.3.so.0.0.0 libopenal.so #libopenjpeg.so diff --git a/indra/cmake/DBusGlib.cmake b/indra/cmake/DBusGlib.cmake index 5e46b6711a..52a4ed7c97 100644 --- a/indra/cmake/DBusGlib.cmake +++ b/indra/cmake/DBusGlib.cmake @@ -1,29 +1,32 @@ # -*- cmake -*- include(Prebuilt) +include(GLIB) -if (USESYSTEMLIBS) - include(FindPkgConfig) +if( GLIB_FOUND ) + if (USESYSTEMLIBS) + include(FindPkgConfig) - pkg_check_modules(DBUSGLIB REQUIRED dbus-glib-1) + pkg_check_modules(DBUSGLIB REQUIRED dbus-glib-1) -elseif (LINUX) - use_prebuilt_binary(dbus_glib) - set(DBUSGLIB_FOUND ON FORCE BOOL) - set(DBUSGLIB_INCLUDE_DIRS - ${LIBS_PREBUILT_DIR}/include/dbus - ) - # We don't need to explicitly link against dbus-glib itself, because - # the viewer probes for the system's copy at runtime. - set(DBUSGLIB_LIBRARIES - gobject-2.0 - glib-2.0 - ) -endif (USESYSTEMLIBS) + elseif (LINUX) + use_prebuilt_binary(dbus_glib) + set(DBUSGLIB_FOUND ON FORCE BOOL) + set(DBUSGLIB_INCLUDE_DIRS + ${LIBS_PREBUILT_DIR}/include/dbus + ) + # We don't need to explicitly link against dbus-glib itself, because + # the viewer probes for the system's copy at runtime. + set(DBUSGLIB_LIBRARIES + gobject-2.0 + glib-2.0 + ) + endif (USESYSTEMLIBS) -if (DBUSGLIB_FOUND) - set(DBUSGLIB ON CACHE BOOL "Build with dbus-glib message bus support.") -endif (DBUSGLIB_FOUND) + if (DBUSGLIB_FOUND) + set(DBUSGLIB ON CACHE BOOL "Build with dbus-glib message bus support.") + endif (DBUSGLIB_FOUND) -if (DBUSGLIB) - add_definitions(-DLL_DBUS_ENABLED=1) -endif (DBUSGLIB) + if (DBUSGLIB) + add_definitions(-DLL_DBUS_ENABLED=1) + endif (DBUSGLIB) +endif() diff --git a/indra/cmake/GLIB.cmake b/indra/cmake/GLIB.cmake new file mode 100644 index 0000000000..0024cb26ac --- /dev/null +++ b/indra/cmake/GLIB.cmake @@ -0,0 +1,11 @@ + +include(Prebuilt) + +if( LINUX ) + use_prebuilt_binary(glib) + set(GLIB_FOUND ON CACHE BOOL "Build against glib 2") + set(GLIB_INCLUDE_DIRS ${LIBS_PREBUILT_DIR}/include/glib-2.0 ${LIBS_PREBUILT_DIR}/lib/release/glib-2.0/include ) + set(GLIB_LIBRARIES libgobject-2.0.a libglib-2.0.a libffi.a libpcre.a) + + add_definitions(-DLL_GLIB=1) +endif() diff --git a/indra/cmake/UI.cmake b/indra/cmake/UI.cmake index f1a8b68900..8c5d266cf5 100644 --- a/indra/cmake/UI.cmake +++ b/indra/cmake/UI.cmake @@ -5,23 +5,29 @@ include(FreeType) if (USESYSTEMLIBS) include(FindPkgConfig) + if( NOT GTK_VERSION ) + set( GTK_VERSION 2.0 ) + endif() if (LINUX) set(PKGCONFIG_PACKAGES atk cairo - gdk-2.0 + gdk-${GTK_VERSION} gdk-pixbuf-2.0 glib-2.0 gmodule-2.0 - gtk+-2.0 + gtk+-${GTK_VERSION} gthread-2.0 libpng pango pangoft2 - pangox - pangoxft - sdl + sdl2 ) + if( GTK_VERSION LESS "3.0" ) + LIST( APPEND PKGCONFIG_PACKAGES pangoxft ) + else() + add_definitions( -DGTK_DISABLE_DEPRECATED) + endif() endif (LINUX) foreach(pkg ${PKGCONFIG_PACKAGES}) @@ -31,29 +37,16 @@ if (USESYSTEMLIBS) list(APPEND UI_LIBRARIES ${${pkg}_LIBRARIES}) add_definitions(${${pkg}_CFLAGS_OTHERS}) endforeach(pkg) + list(APPEND UI_LIBRARIES X11) else (USESYSTEMLIBS) if (LINUX) - use_prebuilt_binary(gtk-atk-pango-glib) + use_prebuilt_binary(fltk) endif (LINUX) if (LINUX) set(UI_LIB_NAMES + libfltk.a freetype - atk-1.0 - gdk-x11-2.0 - gdk_pixbuf-2.0 - glib-2.0 - gmodule-2.0 - gobject-2.0 - gthread-2.0 - gtk-x11-2.0 - pango-1.0 - pangoft2-1.0 - pangox-1.0 - #pangoxft-1.0 - gio-2.0 - pangocairo-1.0 - ffi ) foreach(libname ${UI_LIB_NAMES}) @@ -80,5 +73,5 @@ else (USESYSTEMLIBS) endif (USESYSTEMLIBS) if (LINUX) - add_definitions(-DLL_GTK=1 -DLL_X11=1) + add_definitions(-DLL_X11=1 -DLL_FLTK=1) endif (LINUX) diff --git a/indra/linux_crash_logger/llcrashloggerlinux.cpp b/indra/linux_crash_logger/llcrashloggerlinux.cpp index f6fd71e849..0395935d04 100644 --- a/indra/linux_crash_logger/llcrashloggerlinux.cpp +++ b/indra/linux_crash_logger/llcrashloggerlinux.cpp @@ -40,6 +40,7 @@ #if LL_GTK # include "gtk/gtk.h" +#error "Direct use of GTK is deprecated" #endif // LL_GTK #define MAX_LOADSTRING 100 diff --git a/indra/llwindow/llwindowsdl.cpp b/indra/llwindow/llwindowsdl.cpp index c6c9eff376..5669bb23e1 100644 --- a/indra/llwindow/llwindowsdl.cpp +++ b/indra/llwindow/llwindowsdl.cpp @@ -43,6 +43,7 @@ #if LL_GTK extern "C" { # include "gtk/gtk.h" +#error "Direct use of GTK is deprecated" } #include #endif // LL_GTK diff --git a/indra/newview/llappviewerlinux.h b/indra/newview/llappviewerlinux.h index ed71ff36fd..1196bc58c1 100644 --- a/indra/newview/llappviewerlinux.h +++ b/indra/newview/llappviewerlinux.h @@ -27,15 +27,17 @@ #ifndef LL_LLAPPVIEWERLINUX_H #define LL_LLAPPVIEWERLINUX_H +#ifdef LL_GLIB extern "C" { # include -} #if LL_DBUS_ENABLED -extern "C" { # include # include +#endif + } + #endif #ifndef LL_LLAPPVIEWER_H @@ -70,7 +72,7 @@ protected: virtual bool sendURLToOtherInstance(const std::string& url); }; -#if LL_DBUS_ENABLED +#if LL_DBUS_ENABLED && LL_GLIB typedef struct { GObject parent; diff --git a/indra/newview/lldirpicker.cpp b/indra/newview/lldirpicker.cpp index 01790ad19e..9db6aa1d8a 100644 --- a/indra/newview/lldirpicker.cpp +++ b/indra/newview/lldirpicker.cpp @@ -41,6 +41,11 @@ # include "llfilepicker.h" #endif +#ifdef LL_FLTK + #include "FL/Fl.H" + #include "FL/Fl_Native_File_Chooser.H" +#endif + // // Globals // @@ -193,32 +198,41 @@ LLDirPicker::LLDirPicker() : mFileName(NULL), mLocked(false) { +#ifndef LL_FLTK mFilePicker = new LLFilePicker(); +#endif + reset(); } LLDirPicker::~LLDirPicker() { +#ifndef LL_FLTK delete mFilePicker; +#endif } void LLDirPicker::reset() { +#ifndef LL_FLTK if (mFilePicker) - mFilePicker->reset(); + mFilePicker->reset(); +#else + mDir = ""; +#endif } BOOL LLDirPicker::getDir(std::string* filename, bool blocking) { reset(); - // if local file browsing is turned off, return without opening dialog if ( check_local_file_access_enabled() == false ) { return FALSE; } +#ifndef LL_FLTK #if !LL_MESA_HEADLESS if (mFilePicker) @@ -237,15 +251,38 @@ BOOL LLDirPicker::getDir(std::string* filename, bool blocking) #endif // !LL_MESA_HEADLESS return FALSE; +#else + Fl_Native_File_Chooser flDlg; + flDlg.title("Pick a dir"); + flDlg.type(Fl_Native_File_Chooser::BROWSE_DIRECTORY ); + + int res = flDlg.show(); + if( res == 0 ) + { + char const *pDir = flDlg.filename(0); + if( pDir ) + mDir = pDir; + } + else if( res == -1 ) + { + LL_WARNS() << "FLTK failed: " << flDlg.errmsg() << LL_ENDL; + } + + return !mDir.empty(); +#endif } std::string LLDirPicker::getDirName() { +#ifndef LL_FLTK if (mFilePicker) { return mFilePicker->getFirstFile(); } return ""; +#else + return mDir; +#endif } #else // not implemented diff --git a/indra/newview/lldirpicker.h b/indra/newview/lldirpicker.h index 52febe4523..5683e34131 100644 --- a/indra/newview/lldirpicker.h +++ b/indra/newview/lldirpicker.h @@ -80,7 +80,7 @@ private: #if LL_LINUX || LL_DARWIN // On Linux we just implement LLDirPicker on top of LLFilePicker - LLFilePicker *mFilePicker; + // LLFilePicker *mFilePicker; #endif diff --git a/indra/newview/llfilepicker.cpp b/indra/newview/llfilepicker.cpp index be62f7b3a9..f02363505f 100644 --- a/indra/newview/llfilepicker.cpp +++ b/indra/newview/llfilepicker.cpp @@ -36,10 +36,16 @@ #include "llviewercontrol.h" #include "llwindow.h" // beforeDialog() +#undef LL_GTK #if LL_SDL #include "llwindowsdl.h" // for some X/GTK utils to help with filepickers #endif // LL_SDL +#ifdef LL_FLTK + #include "FL/Fl.H" + #include "FL/Fl_Native_File_Chooser.H" +#endif + #if LL_LINUX #include "llhttpconstants.h" // file picker uses some of thes constants on Linux #endif @@ -1566,12 +1572,79 @@ BOOL LLFilePicker::getMultipleOpenFiles( ELoadFilter filter, bool blocking) return rtn; } +#elif LL_FLTK +BOOL LLFilePicker::getSaveFile( ESaveFilter filter, const std::string& filename, bool blocking ) +{ + return openFileDialog( filter, blocking, eSaveFile ); +} + +BOOL LLFilePicker::getOpenFile( ELoadFilter filter, bool blocking ) +{ + return openFileDialog( filter, blocking, eOpenFile ); +} + +BOOL LLFilePicker::getMultipleOpenFiles( ELoadFilter filter, bool blocking) +{ + return openFileDialog( filter, blocking, eOpenMultiple ); +} + +void setupFilter( Fl_Native_File_Chooser &chooser, LLFilePicker::ESaveFilter filter ) +{ +} + +void setupFilter( Fl_Native_File_Chooser &chooser, LLFilePicker::ELoadFilter filter ) +{ +} + +bool LLFilePicker::openFileDialog( int32_t filter, bool blocking, EType aType ) +{ + if ( check_local_file_access_enabled() == false ) + return false; + + reset(); + Fl_Native_File_Chooser::Type flType = Fl_Native_File_Chooser::BROWSE_FILE; + + if( aType == eOpenMultiple ) + flType = Fl_Native_File_Chooser::BROWSE_MULTI_FILE; + else if( aType == eSaveFile ) + flType = Fl_Native_File_Chooser::BROWSE_SAVE_FILE; + + Fl_Native_File_Chooser flDlg; + flDlg.title("Pick a file"); + flDlg.type( flType ); + + if( aType == eSaveFile ) + setupFilter( flDlg, (ESaveFilter) filter ); + else + setupFilter( flDlg, (ELoadFilter) filter ); + + int res = flDlg.show(); + if( res == 0 ) + { + int32_t count = flDlg.count(); + if( count < 0 ) + count = 0; + for( int32_t i = 0; i < count; ++i ) + { + char const *pFile = flDlg.filename(i); + if( pFile && strlen(pFile) > 0 ) + mFiles.push_back( pFile ); + } + } + else if( res == -1 ) + { + LL_WARNS() << "FLTK failed: " << flDlg.errmsg() << LL_ENDL; + } + + return mFiles.empty()?FALSE:TRUE; +} + # else // LL_GTK // Hacky stubs designed to facilitate fake getSaveFile and getOpenFile with // static results, when we don't have a real filepicker. -BOOL LLFilePicker::getSaveFile( ESaveFilter filter, const std::string& filename ) +BOOL LLFilePicker::getSaveFile( ESaveFilter filter, const std::string& filename, bool blocking ) { // if local file browsing is turned off, return without opening dialog // (Even though this is a stub, I think we still should not return anything at all) @@ -1634,7 +1707,7 @@ BOOL LLFilePicker::getMultipleOpenFiles( ELoadFilter filter, bool blocking) #else // not implemented -BOOL LLFilePicker::getSaveFile( ESaveFilter filter, const std::string& filename ) +BOOL LLFilePicker::getSaveFile( ESaveFilter filter, const std::string& filename, bool blockin ) { reset(); return FALSE; diff --git a/indra/newview/llfilepicker.h b/indra/newview/llfilepicker.h index 53ea7fd316..1aa5802d02 100644 --- a/indra/newview/llfilepicker.h +++ b/indra/newview/llfilepicker.h @@ -33,6 +33,12 @@ #ifndef LL_LLFILEPICKER_H #define LL_LLFILEPICKER_H +#if LL_FLTK + #if LL_GTK + #undef LL_GTK + #endif +#endif + #include "stdtypes.h" #if LL_DARWIN @@ -58,12 +64,13 @@ extern "C" { // mostly for Linux, possible on others #if LL_GTK # include "gtk/gtk.h" +#error "Direct use of GTK is deprecated" #endif // LL_GTK } class LLFilePicker { -#ifdef LL_GTK +#if LL_GTK friend class LLDirPicker; friend void chooser_responder(GtkWidget *, gint, gpointer); #endif // LL_GTK @@ -187,7 +194,14 @@ private: // we also remember the extension of the last added file. std::string mCurrentExtension; #endif - +#if LL_FLTK + enum EType + { + eSaveFile, eOpenFile, eOpenMultiple + }; + bool openFileDialog( int32_t filter, bool blocking, EType aType ); +#endif + std::vector mFiles; S32 mCurrentFile; bool mLocked; From f78ae2593e2deb0efe97dc45c9d214787ef8c5d8 Mon Sep 17 00:00:00 2001 From: Nicky Date: Sun, 26 Sep 2021 22:49:47 +0200 Subject: [PATCH 02/48] - DBus itself does not provide any link libraries, this be more clear and link against the GLIB libraries instead. - Make sure DBus code sees the correct glib2 includes from our 3p package --- indra/cmake/DBusGlib.cmake | 11 +++-------- indra/newview/CMakeLists.txt | 2 +- 2 files changed, 4 insertions(+), 9 deletions(-) diff --git a/indra/cmake/DBusGlib.cmake b/indra/cmake/DBusGlib.cmake index 52a4ed7c97..160196a672 100644 --- a/indra/cmake/DBusGlib.cmake +++ b/indra/cmake/DBusGlib.cmake @@ -12,14 +12,9 @@ if( GLIB_FOUND ) use_prebuilt_binary(dbus_glib) set(DBUSGLIB_FOUND ON FORCE BOOL) set(DBUSGLIB_INCLUDE_DIRS - ${LIBS_PREBUILT_DIR}/include/dbus - ) - # We don't need to explicitly link against dbus-glib itself, because - # the viewer probes for the system's copy at runtime. - set(DBUSGLIB_LIBRARIES - gobject-2.0 - glib-2.0 - ) + ${GLIB_INCLUDE_DIRS} + ${LIBS_PREBUILT_DIR}/include/dbus + ) endif (USESYSTEMLIBS) if (DBUSGLIB_FOUND) diff --git a/indra/newview/CMakeLists.txt b/indra/newview/CMakeLists.txt index 9397168fe7..9170669f64 100644 --- a/indra/newview/CMakeLists.txt +++ b/indra/newview/CMakeLists.txt @@ -2505,7 +2505,7 @@ target_link_libraries(${VIEWER_BINARY_NAME} ${BOOST_WAVE_LIBRARY} #FS specific ${BOOST_THREAD_LIBRARY} #FS specific ${BOOST_CONTEXT_LIBRARY} - ${DBUSGLIB_LIBRARIES} + ${GLIB_LIBRARIES} ${OPENGL_LIBRARIES} ${FMODWRAPPER_LIBRARY} # must come after LLAudio ${OPENAL_LIBRARIES} From 88a75482bd8f8268f04414405eb0af425b46216b Mon Sep 17 00:00:00 2001 From: Nicky Date: Sun, 26 Sep 2021 22:51:34 +0200 Subject: [PATCH 03/48] Move LLWindowSDL::getNativeKeyData to a common block where so it does not get #ifdef'd out. --- indra/llwindow/llwindowsdl.cpp | 64 ++++++++++++++++------------------ 1 file changed, 31 insertions(+), 33 deletions(-) diff --git a/indra/llwindow/llwindowsdl.cpp b/indra/llwindow/llwindowsdl.cpp index 5669bb23e1..a5eab80af4 100644 --- a/indra/llwindow/llwindowsdl.cpp +++ b/indra/llwindow/llwindowsdl.cpp @@ -2395,39 +2395,6 @@ static void color_changed_callback(GtkWidget *widget, gtk_color_selection_get_current_color(colorsel, colorp); } - -/* - Make the raw keyboard data available - used to poke through to LLQtWebKit so - that Qt/Webkit has access to the virtual keycodes etc. that it needs -*/ -LLSD LLWindowSDL::getNativeKeyData() -{ - LLSD result = LLSD::emptyMap(); - - U32 modifiers = 0; // pretend-native modifiers... oh what a tangled web we weave! - - // we go through so many levels of device abstraction that I can't really guess - // what a plugin under GDK under Qt under SL under SDL under X11 considers - // a 'native' modifier mask. this has been sort of reverse-engineered... they *appear* - // to match GDK consts, but that may be co-incidence. - modifiers |= (mKeyModifiers & KMOD_LSHIFT) ? 0x0001 : 0; - modifiers |= (mKeyModifiers & KMOD_RSHIFT) ? 0x0001 : 0;// munge these into the same shift - modifiers |= (mKeyModifiers & KMOD_CAPS) ? 0x0002 : 0; - modifiers |= (mKeyModifiers & KMOD_LCTRL) ? 0x0004 : 0; - modifiers |= (mKeyModifiers & KMOD_RCTRL) ? 0x0004 : 0;// munge these into the same ctrl - modifiers |= (mKeyModifiers & KMOD_LALT) ? 0x0008 : 0;// untested - modifiers |= (mKeyModifiers & KMOD_RALT) ? 0x0008 : 0;// untested - // *todo: test ALTs - I don't have a case for testing these. Do you? - // *todo: NUM? - I don't care enough right now (and it's not a GDK modifier). - - result["scan_code"] = (S32)mKeyScanCode; - result["virtual_key"] = (S32)mKeyVirtualKey; - result["modifiers"] = (S32)modifiers; - result[ "sdl_sym" ] = (S32)mSDLSym; // Store the SDL Keysym too. - return result; -} - - BOOL LLWindowSDL::dialogColorPicker( F32 *r, F32 *g, F32 *b) { BOOL rtn = FALSE; @@ -2512,6 +2479,37 @@ BOOL LLWindowSDL::dialogColorPicker( F32 *r, F32 *g, F32 *b) } #endif // LL_GTK +/* + Make the raw keyboard data available - used to poke through to LLQtWebKit so + that Qt/Webkit has access to the virtual keycodes etc. that it needs +*/ +LLSD LLWindowSDL::getNativeKeyData() +{ + LLSD result = LLSD::emptyMap(); + + U32 modifiers = 0; // pretend-native modifiers... oh what a tangled web we weave! + + // we go through so many levels of device abstraction that I can't really guess + // what a plugin under GDK under Qt under SL under SDL under X11 considers + // a 'native' modifier mask. this has been sort of reverse-engineered... they *appear* + // to match GDK consts, but that may be co-incidence. + modifiers |= (mKeyModifiers & KMOD_LSHIFT) ? 0x0001 : 0; + modifiers |= (mKeyModifiers & KMOD_RSHIFT) ? 0x0001 : 0;// munge these into the same shift + modifiers |= (mKeyModifiers & KMOD_CAPS) ? 0x0002 : 0; + modifiers |= (mKeyModifiers & KMOD_LCTRL) ? 0x0004 : 0; + modifiers |= (mKeyModifiers & KMOD_RCTRL) ? 0x0004 : 0;// munge these into the same ctrl + modifiers |= (mKeyModifiers & KMOD_LALT) ? 0x0008 : 0;// untested + modifiers |= (mKeyModifiers & KMOD_RALT) ? 0x0008 : 0;// untested + // *todo: test ALTs - I don't have a case for testing these. Do you? + // *todo: NUM? - I don't care enough right now (and it's not a GDK modifier). + + result["scan_code"] = (S32)mKeyScanCode; + result["virtual_key"] = (S32)mKeyVirtualKey; + result["modifiers"] = (S32)modifiers; + result[ "sdl_sym" ] = (S32)mSDLSym; // Store the SDL Keysym too. + return result; +} + #if LL_LINUX // extracted from spawnWebBrowser for clarity and to eliminate // compiler confusion regarding close(int fd) vs. LLWindow::close() From ec010e7e1a2c7621ca45ee2c2fc9d347aa0942c7 Mon Sep 17 00:00:00 2001 From: Nicky Date: Sun, 26 Sep 2021 22:52:30 +0200 Subject: [PATCH 04/48] pango and libffi does not need to be packaged anymore. --- indra/newview/viewer_manifest.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/indra/newview/viewer_manifest.py b/indra/newview/viewer_manifest.py index 8265e291a0..c96538834d 100755 --- a/indra/newview/viewer_manifest.py +++ b/indra/newview/viewer_manifest.py @@ -2029,7 +2029,7 @@ class LinuxManifest(ViewerManifest): self.path("libopenal.so", "libopenal.so.1") # Install as versioned file in case it's missing from the 3p- and won't get copied below self.path("libopenal.so*") #self.path("libnotify.so.1.1.2", "libnotify.so.1") # LO - uncomment when testing libnotify(growl) on linux - self.path("libpangox-1.0.so*") + #self.path("libpangox-1.0.so*") # KLUDGE: As of 2012-04-11, the 'fontconfig' package installs # libfontconfig.so.1.4.4, along with symlinks libfontconfig.so.1 # and libfontconfig.so. Before we added support for library-file @@ -2217,7 +2217,7 @@ class Linux_x86_64_Manifest(LinuxManifest): if self.is_packaging_viewer(): with self.prefix(src=os.path.join(pkgdir, 'lib', 'release'), dst="lib"): - self.path("libffi*.so*") + #self.path("libffi*.so*") # vivox 32-bit hack. # one has to extract libopenal.so from the 32-bit openal package, or official LL viewer, and rename it to libopenal32.so # and place it in the prebuilt lib/release directory From 5611e19ea4385a73d3d2dd7d51ab23b71b4c112f Mon Sep 17 00:00:00 2001 From: Nicky Date: Mon, 10 Jan 2022 11:41:02 +0100 Subject: [PATCH 05/48] Exclude more filetypes from strip call. --- indra/newview/viewer_manifest.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/indra/newview/viewer_manifest.py b/indra/newview/viewer_manifest.py index 3632594b2d..67d7225287 100755 --- a/indra/newview/viewer_manifest.py +++ b/indra/newview/viewer_manifest.py @@ -2087,7 +2087,7 @@ class LinuxManifest(ViewerManifest): [os.path.join(self.get_dst_prefix(), dir) for dir in ('bin', 'lib')] + # Remove VMP # ['-type', 'f', '!', '-name', '*.py', - ['-type', 'f', "!", "-name", "*.dat", "!", "-name", "*.pak", "!", "-name", "*.bin", + ['-type', 'f', "!", "-name", "*.dat", "!", "-name", "*.pak", "!", "-name", "*.bin", "!", "-name", "*.lib", "!", "-name", "*.pdb", # Remove VMP '!', '-name', 'update_install', '-exec', 'strip', '-S', '{}', ';']) From 6987c74527406c3664f16e58862ba3deb125dca6 Mon Sep 17 00:00:00 2001 From: Ansariel Date: Tue, 11 Jan 2022 00:29:16 +0100 Subject: [PATCH 06/48] Update German translation --- indra/newview/skins/default/xui/de/panel_preferences_UI.xml | 1 + 1 file changed, 1 insertion(+) diff --git a/indra/newview/skins/default/xui/de/panel_preferences_UI.xml b/indra/newview/skins/default/xui/de/panel_preferences_UI.xml index ce4be02ba0..d28f52b3fc 100644 --- a/indra/newview/skins/default/xui/de/panel_preferences_UI.xml +++ b/indra/newview/skins/default/xui/de/panel_preferences_UI.xml @@ -233,6 +233,7 @@ + From aa69e18b10ae8c50ac6a0ce491fea87e27876cdc Mon Sep 17 00:00:00 2001 From: Andrey Lihatskiy Date: Mon, 10 Jan 2022 22:18:48 +0200 Subject: [PATCH 07/48] SL-16565 Added com.apple.security.device.audio-input to the hardened runtime entitlements --- indra/newview/slplugin.entitlements | 2 ++ 1 file changed, 2 insertions(+) diff --git a/indra/newview/slplugin.entitlements b/indra/newview/slplugin.entitlements index a72c6bc82c..aea8dbfd15 100644 --- a/indra/newview/slplugin.entitlements +++ b/indra/newview/slplugin.entitlements @@ -12,5 +12,7 @@ com.apple.security.cs.allow-dyld-environment-variables + com.apple.security.device.audio-input + From 84d989acac107f252964f8a498c738a22d3b96da Mon Sep 17 00:00:00 2001 From: Andrey Lihatskiy Date: Tue, 11 Jan 2022 23:53:26 +0200 Subject: [PATCH 08/48] SL-11875 Verbose log --- indra/newview/installers/darwin/apple-notarize.sh | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/indra/newview/installers/darwin/apple-notarize.sh b/indra/newview/installers/darwin/apple-notarize.sh index 466898ecda..e019437924 100755 --- a/indra/newview/installers/darwin/apple-notarize.sh +++ b/indra/newview/installers/darwin/apple-notarize.sh @@ -16,8 +16,9 @@ if [ -f "$CONFIG_FILE" ]; then --password $PASSWORD \ --asc-provider $ASC_PROVIDER \ --file "$zip_file" 2>&1) + echo $res + requestUUID=$(echo $res | awk '/RequestUUID/ { print $NF; }') - echo "Apple Notarization RequestUUID: $requestUUID" if [[ -n $requestUUID ]]; then From 1ec05e93695a661f6b3b6e374bf60cb991bab954 Mon Sep 17 00:00:00 2001 From: Nat Goodspeed Date: Wed, 12 Jan 2022 16:25:40 -0500 Subject: [PATCH 09/48] Increment viewer version to 6.5.3 following promotion of DRTVWR-554 --- indra/newview/VIEWER_VERSION.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/indra/newview/VIEWER_VERSION.txt b/indra/newview/VIEWER_VERSION.txt index 5e3ec53ea6..db0785f273 100644 --- a/indra/newview/VIEWER_VERSION.txt +++ b/indra/newview/VIEWER_VERSION.txt @@ -1 +1 @@ -6.5.2 +6.5.3 From b59d4b9a02795b9fc465665b91faefbf86936619 Mon Sep 17 00:00:00 2001 From: PanteraPolnocy Date: Fri, 14 Jan 2022 00:17:31 +0100 Subject: [PATCH 10/48] FIRE-31353 Russian translation update, by Romka Swallowtail --- indra/newview/skins/default/xui/ru/panel_preferences_UI.xml | 1 + 1 file changed, 1 insertion(+) diff --git a/indra/newview/skins/default/xui/ru/panel_preferences_UI.xml b/indra/newview/skins/default/xui/ru/panel_preferences_UI.xml index 23944592a9..248039a98e 100644 --- a/indra/newview/skins/default/xui/ru/panel_preferences_UI.xml +++ b/indra/newview/skins/default/xui/ru/panel_preferences_UI.xml @@ -225,6 +225,7 @@ + From 9330609ba88f4d8a1e7b55594e3d5d39f29abe68 Mon Sep 17 00:00:00 2001 From: PanteraPolnocy Date: Fri, 14 Jan 2022 00:21:25 +0100 Subject: [PATCH 11/48] Small adjustment for the previous commit Let's make this a bit wider... --- indra/newview/skins/default/xui/ru/panel_preferences_UI.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/indra/newview/skins/default/xui/ru/panel_preferences_UI.xml b/indra/newview/skins/default/xui/ru/panel_preferences_UI.xml index 248039a98e..5701593277 100644 --- a/indra/newview/skins/default/xui/ru/panel_preferences_UI.xml +++ b/indra/newview/skins/default/xui/ru/panel_preferences_UI.xml @@ -225,7 +225,7 @@ - + From 108f4c7cd4ca357e9a9f619f9bcf955da93267d6 Mon Sep 17 00:00:00 2001 From: Andrey Kleshchev Date: Thu, 13 Jan 2022 22:59:05 +0200 Subject: [PATCH 12/48] SL-16644 OUT_FULL updates should reset cache A revert of SH-4631 --- indra/newview/llviewerobjectlist.cpp | 3 ++- indra/newview/llviewerregion.cpp | 14 +++----------- indra/newview/llviewerregion.h | 2 +- 3 files changed, 6 insertions(+), 13 deletions(-) diff --git a/indra/newview/llviewerobjectlist.cpp b/indra/newview/llviewerobjectlist.cpp index 733fb3c7df..0f15443b8b 100644 --- a/indra/newview/llviewerobjectlist.cpp +++ b/indra/newview/llviewerobjectlist.cpp @@ -614,7 +614,8 @@ void LLViewerObjectList::processObjectUpdate(LLMessageSystem *mesgsys, if(update_cache) { - objectp = regionp->updateCacheEntry(local_id, objectp, update_type); + //update object cache if the object receives a full-update or terse update + objectp = regionp->updateCacheEntry(local_id, objectp); } // This looks like it will break if the local_id of the object doesn't change diff --git a/indra/newview/llviewerregion.cpp b/indra/newview/llviewerregion.cpp index 00ad76fc31..a2c8ba80aa 100644 --- a/indra/newview/llviewerregion.cpp +++ b/indra/newview/llviewerregion.cpp @@ -1855,13 +1855,8 @@ LLViewerObject* LLViewerRegion::addNewObject(LLVOCacheEntry* entry) //update object cache if the object receives a full-update or terse update //update_type == EObjectUpdateType::OUT_TERSE_IMPROVED or EObjectUpdateType::OUT_FULL -LLViewerObject* LLViewerRegion::updateCacheEntry(U32 local_id, LLViewerObject* objectp, U32 update_type) +LLViewerObject* LLViewerRegion::updateCacheEntry(U32 local_id, LLViewerObject* objectp) { - if(objectp && update_type != (U32)OUT_TERSE_IMPROVED) - { - return objectp; //no need to access cache - } - LLVOCacheEntry* entry = getCacheEntry(local_id); if (!entry) { @@ -1873,11 +1868,8 @@ LLViewerObject* LLViewerRegion::updateCacheEntry(U32 local_id, LLViewerObject* o objectp = addNewObject(entry); } - //remove from cache if terse update - if(update_type == (U32)OUT_TERSE_IMPROVED) - { - killCacheEntry(entry, true); - } + //remove from cache. + killCacheEntry(entry, true); return objectp; } diff --git a/indra/newview/llviewerregion.h b/indra/newview/llviewerregion.h index 2aa8258a75..77acc5a98b 100644 --- a/indra/newview/llviewerregion.h +++ b/indra/newview/llviewerregion.h @@ -380,7 +380,7 @@ public: void requestCacheMisses(); void addCacheMissFull(const U32 local_id); //update object cache if the object receives a full-update or terse update - LLViewerObject* updateCacheEntry(U32 local_id, LLViewerObject* objectp, U32 update_type); + LLViewerObject* updateCacheEntry(U32 local_id, LLViewerObject* objectp); void findOrphans(U32 parent_id); void clearCachedVisibleObjects(); void dumpCache(); From 3c2217becb9e2f0c689bdb476b1246abe85ac405 Mon Sep 17 00:00:00 2001 From: Ansariel Date: Sat, 15 Jan 2022 22:44:36 +0100 Subject: [PATCH 13/48] Increase version to 6.5.4 --- indra/newview/VIEWER_VERSION.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/indra/newview/VIEWER_VERSION.txt b/indra/newview/VIEWER_VERSION.txt index db0785f273..54358db763 100644 --- a/indra/newview/VIEWER_VERSION.txt +++ b/indra/newview/VIEWER_VERSION.txt @@ -1 +1 @@ -6.5.3 +6.5.4 From d031507caa094c1016ee7ba72c4b37a71e037452 Mon Sep 17 00:00:00 2001 From: Kitty Barnett Date: Sun, 16 Jan 2022 01:23:13 +0100 Subject: [PATCH 14/48] Update FMOD Studio to 2.02.05 (Mac) --- autobuild.xml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/autobuild.xml b/autobuild.xml index c66dde9b47..192c453c38 100644 --- a/autobuild.xml +++ b/autobuild.xml @@ -1058,11 +1058,11 @@ archive hash - bde9eb3e53001584edb1af44e3b265a2 + 2db00aa4126d4ee8152fc49b03bb3fe1 hash_algorithm md5 url - file:///opt/firestorm/fmodstudio-2.02.04-darwin-213491614.tar.bz2 + file:///opt/firestorm/fmodstudio-2.02.05-darwin-220160006.tar.bz2 name darwin From 7a8b63be87df1acc3421b58676633176e3e6f9be Mon Sep 17 00:00:00 2001 From: Nicky Date: Sun, 16 Jan 2022 13:14:53 +0100 Subject: [PATCH 15/48] Tabs to spaces. --- autobuild.xml | 52 +++++++++++++++++++++++++-------------------------- 1 file changed, 26 insertions(+), 26 deletions(-) diff --git a/autobuild.xml b/autobuild.xml index bd1927856a..3860c7554e 100644 --- a/autobuild.xml +++ b/autobuild.xml @@ -33,32 +33,32 @@ fltk - copyright - Copyright (C) fltk project - license - LGPL/fltk - license_file - LICENSES/fltk.txt - name - fltk - platforms - - linux64 - - archive - - hash - 81fe1e927e4fe3c5e5f15ce6219ca883 - url - http://3p.firestormviewer.org/fltk-1.3.5.202282121-linux64-202282121.tar.bz2 - - name - linux - - - version - 1.3.5 - + copyright + Copyright (C) fltk project + license + LGPL/fltk + license_file + LICENSES/fltk.txt + name + fltk + platforms + + linux64 + + archive + + hash + 81fe1e927e4fe3c5e5f15ce6219ca883 + url + http://3p.firestormviewer.org/fltk-1.3.5.202282121-linux64-202282121.tar.bz2 + + name + linux + + + version + 1.3.5 + jemalloc copyright From 227cfe37c9dd09494fecdfdd01dcd11d42a47d94 Mon Sep 17 00:00:00 2001 From: Ansariel Date: Mon, 17 Jan 2022 13:16:30 +0100 Subject: [PATCH 16/48] Don't half-way apply RLVa name filter to names in online/offline status notifications --- indra/newview/llcallingcard.cpp | 1 + indra/newview/llfloaterimnearbychathandler.cpp | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/indra/newview/llcallingcard.cpp b/indra/newview/llcallingcard.cpp index 753a78fefd..e55931cfa9 100644 --- a/indra/newview/llcallingcard.cpp +++ b/indra/newview/llcallingcard.cpp @@ -885,6 +885,7 @@ static void on_avatar_name_cache_notify(const LLUUID& agent_id, } else { + args["ONLINE_STATUS"] = true; LLNotificationsUI::LLNotificationManager::instance().onChat(chat, args); } diff --git a/indra/newview/llfloaterimnearbychathandler.cpp b/indra/newview/llfloaterimnearbychathandler.cpp index 3136f96fe4..2031fc6a4e 100644 --- a/indra/newview/llfloaterimnearbychathandler.cpp +++ b/indra/newview/llfloaterimnearbychathandler.cpp @@ -569,7 +569,7 @@ void LLFloaterIMNearbyChatHandler::processChat(const LLChat& chat_msg, RlvUtil::filterLocation(tmp_chat.mText); tmp_chat.mRlvLocFiltered = TRUE; } - if ( (!RlvActions::canShowName(RlvActions::SNC_DEFAULT)) && (!tmp_chat.mRlvNamesFiltered) && (CHAT_SOURCE_AGENT != tmp_chat.mSourceType) ) + if ( (!RlvActions::canShowName(RlvActions::SNC_DEFAULT)) && (!tmp_chat.mRlvNamesFiltered) && (CHAT_SOURCE_AGENT != tmp_chat.mSourceType) && (!args.has("ONLINE_STATUS") || !args["ONLINE_STATUS"].asBoolean()) ) { RlvUtil::filterNames(tmp_chat.mText); tmp_chat.mRlvNamesFiltered = TRUE; From 43614cfdaafb400792452285cd026a55589a8d84 Mon Sep 17 00:00:00 2001 From: Nicky Date: Mon, 17 Jan 2022 14:38:04 +0100 Subject: [PATCH 17/48] Remove obsolete scripts. --- scripts/export_for_merge.sh | 11 --------- scripts/import_to_branch.sh | 46 ------------------------------------- 2 files changed, 57 deletions(-) delete mode 100644 scripts/export_for_merge.sh delete mode 100644 scripts/import_to_branch.sh diff --git a/scripts/export_for_merge.sh b/scripts/export_for_merge.sh deleted file mode 100644 index 40cef000f6..0000000000 --- a/scripts/export_for_merge.sh +++ /dev/null @@ -1,11 +0,0 @@ -if [ -d exp/ ] -then - rm exp/*.diff -else - mkdir exp -fi - -for i in $(cat exp.txt) -do - hg export -o exp/$i.diff -r $i - done diff --git a/scripts/import_to_branch.sh b/scripts/import_to_branch.sh deleted file mode 100644 index e05e94e5fa..0000000000 --- a/scripts/import_to_branch.sh +++ /dev/null @@ -1,46 +0,0 @@ -#!/bin/sh -read -p "Calling hg revert and purge on indra/. Then importing changes. Continue? " ANSWER - -case "$ANSWER" in - y|Y)echo "Carrying on" - ;; - *) echo "Exit" - exit 0 - ;; -esac - -if [ ! -d indra/ ] -then - echo "Indra directory not found" - exit 1 -fi - -hg revert indra/ -hg revert autobuild.xml -hg purge indra/ - -for i in $(cat exp.txt|sort -n) -do - echo "Importing change $i" - hg import --no-commit -f exp/$i.diff || exit 1 -done - -read -p "All patches applied without errors. Apply them again and commit? " ANSWER - -case "$ANSWER" in - y|Y)echo "Carrying on" - ;; - *) echo "Exit" - exit 0 - ;; -esac - -hg revert indra/ -hg revert autobuild.xml -hg purge indra/ - -for i in $(cat exp.txt|sort -n) -do - echo "Importing change $i" - hg import exp/$i.diff || exit 1 -done From 5929d4780debbf21725fc1017cf6b4b17ae8a2e6 Mon Sep 17 00:00:00 2001 From: Nicky Date: Mon, 17 Jan 2022 16:54:33 +0100 Subject: [PATCH 18/48] Enable ninja build generator for all platforms --- scripts/configure_firestorm.sh | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/scripts/configure_firestorm.sh b/scripts/configure_firestorm.sh index ed28c392c7..1b09dfbbfa 100755 --- a/scripts/configure_firestorm.sh +++ b/scripts/configure_firestorm.sh @@ -83,7 +83,7 @@ showUsage() echo " --testbuild : Create time-limited test build (build date + )" echo " --platform : Build for specified platform (darwin | windows | linux)" echo " --jobs : Build with jobs in parallel (Linux and Darwin only)" - echo " --ninja : Build using Ninja (Linux only)" + echo " --ninja : Build using Ninja" echo " --vscode : Exports compile commands for VSCode (Linux only)" echo echo "All arguments not in the above list will be passed through to LL's configure/build." @@ -525,11 +525,7 @@ if [ $WANTS_CONFIG -eq $TRUE ] ; then TARGET="Xcode" elif [ \( $TARGET_PLATFORM == "linux" \) ] ; then OPENAL="-DOPENAL:BOOL=ON" - if [ $WANTS_NINJA -eq $TRUE ] ; then - TARGET="Ninja" - else - TARGET="Unix Makefiles" - fi + TARGET="Unix Makefiles" if [ $WANTS_VSCODE -eq $TRUE ] ; then VSCODE_FLAGS="-DCMAKE_EXPORT_COMPILE_COMMANDS=On" ROOT_DIR=$(dirname $(dirname $(readlink -f $0))) @@ -545,6 +541,10 @@ if [ $WANTS_CONFIG -eq $TRUE ] ; then UNATTENDED="-DUNATTENDED=ON" fi + if [ $WANTS_NINJA -eq $TRUE ] ; then + TARGET="Ninja" + fi + cmake -G "$TARGET" ../indra $CHANNEL ${GITHASH} $FMODSTUDIO $OPENAL $KDU $OPENSIM $SINGLEGRID $AVX_OPTIMIZATION $AVX2_OPTIMIZATION $TRACY_PROFILER $TESTBUILD $PACKAGE \ $UNATTENDED -DLL_TESTS:BOOL=OFF -DADDRESS_SIZE:STRING=$AUTOBUILD_ADDRSIZE -DCMAKE_BUILD_TYPE:STRING=$BTYPE \ $CRASH_REPORTING -DVIEWER_SYMBOL_FILE:STRING="${VIEWER_SYMBOL_FILE:-}" -DROOT_PROJECT_NAME:STRING=Firestorm $LL_ARGS_PASSTHRU ${VSCODE_FLAGS:-} | tee $LOG From 55ce47676bf0b1e8870adbda6fef3ae294b17fb3 Mon Sep 17 00:00:00 2001 From: Nicky Date: Mon, 17 Jan 2022 18:24:06 +0100 Subject: [PATCH 19/48] Add option to enable compiler cache (if found). --- scripts/configure_firestorm.sh | 24 ++++++++++++++++++++++-- 1 file changed, 22 insertions(+), 2 deletions(-) diff --git a/scripts/configure_firestorm.sh b/scripts/configure_firestorm.sh index 1b09dfbbfa..e6615fbb3d 100755 --- a/scripts/configure_firestorm.sh +++ b/scripts/configure_firestorm.sh @@ -42,6 +42,7 @@ WANTS_TESTBUILD=$FALSE WANTS_TRACY=$FALSE WANTS_BUILD=$FALSE WANTS_CRASHREPORTING=$FALSE +WANTS_CACHE=$FALSE TARGET_PLATFORM="darwin" # darwin, windows, linux BTYPE="Release" CHANNEL="" # will be overwritten later with platform-specific values unless manually specified. @@ -85,6 +86,7 @@ showUsage() echo " --jobs : Build with jobs in parallel (Linux and Darwin only)" echo " --ninja : Build using Ninja" echo " --vscode : Exports compile commands for VSCode (Linux only)" + echo " --compiler-cache : Try to detect and use compiler cache (needs also --ninja for OSX and Windows)" echo echo "All arguments not in the above list will be passed through to LL's configure/build." echo @@ -94,7 +96,7 @@ getArgs() # $* = the options passed in from main { if [ $# -gt 0 ]; then - while getoptex "clean build config version package no-package fmodstudio openal ninja vscode jobs: platform: kdu opensim no-opensim singlegrid: avx avx2 tracy crashreporting testbuild: help chan: btype:" "$@" ; do + while getoptex "clean build config version package no-package fmodstudio openal ninja vscode compiler-cache jobs: platform: kdu opensim no-opensim singlegrid: avx avx2 tracy crashreporting testbuild: help chan: btype:" "$@" ; do #ensure options are valid if [ -z "$OPTOPT" ] ; then @@ -133,6 +135,7 @@ getArgs() jobs) JOBS="$OPTARG";; ninja) WANTS_NINJA=$TRUE;; vscode) WANTS_VSCODE=$TRUE;; + compiler-cache) WANTS_CACHE=$TRUE;; help) showUsage && exit 0;; @@ -324,6 +327,7 @@ echo -e " BUILD: `b2a $WANTS_BUILD`" | echo -e " CONFIG: `b2a $WANTS_CONFIG`" | tee -a $LOG echo -e " NINJA: `b2a $WANTS_NINJA`" | tee -a $LOG echo -e " VSCODE: `b2a $WANTS_VSCODE`" | tee -a $LOG +echo -e " COMPILER CACHE: `b2a $WANTS_CACHE`" | tee -a $LOG echo -e " PASSTHRU: $LL_ARGS_PASSTHRU" | tee -a $LOG echo -e " BTYPE: $BTYPE" | tee -a $LOG if [ $TARGET_PLATFORM == "linux" -o $TARGET_PLATFORM == "darwin" ] ; then @@ -545,8 +549,24 @@ if [ $WANTS_CONFIG -eq $TRUE ] ; then TARGET="Ninja" fi + CACHE_OPT="" + + if [ $WANTS_CACHE -eq $TRUE ] + then + if [ `which ccache 2>/dev/null` ] + then + echo "Found ccache" + CACHE_OPT="-DCMAKE_C_COMPILER_LAUNCHER=ccache -DCMAKE_CXX_COMPILER_LAUNCHER=ccache" + fi + if [ `which buildcache 2>/dev/null` ] + then + echo "Found buildcache" + CACHE_OPT="-DCMAKE_C_COMPILER_LAUNCHER=buildcache -DCMAKE_CXX_COMPILER_LAUNCHER=buildcache" + fi + fi + cmake -G "$TARGET" ../indra $CHANNEL ${GITHASH} $FMODSTUDIO $OPENAL $KDU $OPENSIM $SINGLEGRID $AVX_OPTIMIZATION $AVX2_OPTIMIZATION $TRACY_PROFILER $TESTBUILD $PACKAGE \ - $UNATTENDED -DLL_TESTS:BOOL=OFF -DADDRESS_SIZE:STRING=$AUTOBUILD_ADDRSIZE -DCMAKE_BUILD_TYPE:STRING=$BTYPE \ + $UNATTENDED -DLL_TESTS:BOOL=OFF -DADDRESS_SIZE:STRING=$AUTOBUILD_ADDRSIZE -DCMAKE_BUILD_TYPE:STRING=$BTYPE $CACHE_OPT \ $CRASH_REPORTING -DVIEWER_SYMBOL_FILE:STRING="${VIEWER_SYMBOL_FILE:-}" -DROOT_PROJECT_NAME:STRING=Firestorm $LL_ARGS_PASSTHRU ${VSCODE_FLAGS:-} | tee $LOG if [ $TARGET_PLATFORM == "windows" ] ; then From 92f7e1cbe86323cbe0c16109602b6f2c4cad3c19 Mon Sep 17 00:00:00 2001 From: Beq Date: Mon, 17 Jan 2022 22:39:37 +0000 Subject: [PATCH 20/48] FIRE-31326 - CTD with autotune and xml clean up Should fix the crash to desktop behaviour when autotune was used and preferences not previously opened. Also cleans up various warnings where unsupported params were used on certain elements. --- indra/newview/fsfloaterperformance.cpp | 10 ++++------ .../skins/default/xui/en/floater_performance.xml | 5 +---- .../default/xui/en/panel_performance_autotune.xml | 9 +++------ .../default/xui/en/panel_performance_preferences.xml | 4 +--- 4 files changed, 9 insertions(+), 19 deletions(-) diff --git a/indra/newview/fsfloaterperformance.cpp b/indra/newview/fsfloaterperformance.cpp index c8f5d64d76..00faffca0d 100644 --- a/indra/newview/fsfloaterperformance.cpp +++ b/indra/newview/fsfloaterperformance.cpp @@ -139,7 +139,7 @@ BOOL FSFloaterPerformance::postBuild() mObjectList->setHoverIconName("StopReload_Off"); mObjectList->setIconClickedCallback(boost::bind(&FSFloaterPerformance::detachItem, this, _1)); - mSettingsPanel->getChild("graphics_quality")->setCommitCallback(boost::bind(&FSFloaterPerformance::onChangeQuality, this, _2)); + mSettingsPanel->getChild("quality_vs_perf_selection")->setCommitCallback(boost::bind(&FSFloaterPerformance::onChangeQuality, this, _2)); mNearbyPanel->getChild("exceptions_btn")->setCommitCallback(boost::bind(&FSFloaterPerformance::onClickExceptions, this)); mNearbyPanel->getChild("hide_avatars")->setCommitCallback(boost::bind(&FSFloaterPerformance::onClickHideAvatars, this)); @@ -732,11 +732,9 @@ void FSFloaterPerformance::detachItem(const LLUUID& item_id) void FSFloaterPerformance::onChangeQuality(const LLSD& data) { - LLFloaterPreference* instance = LLFloaterReg::getTypedInstance("preferences"); - if (instance) - { - instance->onChangeQuality(data); - } + U32 level = (U32)(data.asReal()); + LLFeatureManager::getInstance()->setGraphicsLevel(level, true); + refresh(); } void FSFloaterPerformance::onClickHideAvatars() diff --git a/indra/newview/skins/default/xui/en/floater_performance.xml b/indra/newview/skins/default/xui/en/floater_performance.xml index 10d9c71fc6..fedea24bd3 100644 --- a/indra/newview/skins/default/xui/en/floater_performance.xml +++ b/indra/newview/skins/default/xui/en/floater_performance.xml @@ -7,8 +7,6 @@ save_rect="true" title="Improve Graphics Speed (Experimental)" can_resize="false" - min_height="652" - max_height="652" min_width="580" width="580"> @@ -172,7 +170,6 @@ Target [FPSTARGET] fps + width="190" /> +width="190" /> +width="190" /> - Date: Tue, 18 Jan 2022 00:31:31 +0100 Subject: [PATCH 21/48] XUI fix --- indra/newview/skins/default/xui/de/floater_performance.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/indra/newview/skins/default/xui/de/floater_performance.xml b/indra/newview/skins/default/xui/de/floater_performance.xml index 28a98d3e55..4985f92000 100644 --- a/indra/newview/skins/default/xui/de/floater_performance.xml +++ b/indra/newview/skins/default/xui/de/floater_performance.xml @@ -48,7 +48,7 @@ - + From 2e503f15bc20ec17bb6daf917d395688a3203c25 Mon Sep 17 00:00:00 2001 From: Beq Date: Tue, 18 Jan 2022 13:50:09 +0000 Subject: [PATCH 22/48] FIRE-31367 - fixes for weird behaviour after region crossing --- indra/newview/fsfloaterperformance.cpp | 184 +++++++++++++------------ indra/newview/fsperfstats.cpp | 1 + 2 files changed, 94 insertions(+), 91 deletions(-) diff --git a/indra/newview/fsfloaterperformance.cpp b/indra/newview/fsfloaterperformance.cpp index 00faffca0d..43401fe0b4 100644 --- a/indra/newview/fsfloaterperformance.cpp +++ b/indra/newview/fsfloaterperformance.cpp @@ -240,104 +240,106 @@ void FSFloaterPerformance::draw() // tot_frame_time_ns -= tot_limit_time_ns; // tot_frame_time_ns -= tot_sleep_time_ns; - if(tot_frame_time_ns == 0) + if(tot_frame_time_ns != 0) { - LL_WARNS("performance") << "things went wrong, quit while we can." << LL_ENDL; - return; - } - auto pct_avatar_time = (tot_avatar_time_ns * 100)/tot_frame_time_ns; - auto pct_huds_time = (tot_huds_time_ns * 100)/tot_frame_time_ns; - auto pct_ui_time = (tot_ui_time_ns * 100)/tot_frame_time_ns; - auto pct_idle_time = (tot_idle_time_ns * 100)/tot_frame_time_ns; - auto pct_swap_time = (tot_swap_time_ns * 100)/tot_frame_time_ns; - auto pct_scene_render_time = (tot_scene_time_ns * 100)/tot_frame_time_ns; - pct_avatar_time = llclamp(pct_avatar_time,0.,100.); - pct_huds_time = llclamp(pct_huds_time,0.,100.); - pct_ui_time = llclamp(pct_ui_time,0.,100.); - pct_idle_time = llclamp(pct_idle_time,0.,100.); - pct_swap_time = llclamp(pct_swap_time,0.,100.); - pct_scene_render_time = llclamp(pct_scene_render_time,0.,100.); + auto pct_avatar_time = (tot_avatar_time_ns * 100)/tot_frame_time_ns; + auto pct_huds_time = (tot_huds_time_ns * 100)/tot_frame_time_ns; + auto pct_ui_time = (tot_ui_time_ns * 100)/tot_frame_time_ns; + auto pct_idle_time = (tot_idle_time_ns * 100)/tot_frame_time_ns; + auto pct_swap_time = (tot_swap_time_ns * 100)/tot_frame_time_ns; + auto pct_scene_render_time = (tot_scene_time_ns * 100)/tot_frame_time_ns; + pct_avatar_time = llclamp(pct_avatar_time,0.,100.); + pct_huds_time = llclamp(pct_huds_time,0.,100.); + pct_ui_time = llclamp(pct_ui_time,0.,100.); + pct_idle_time = llclamp(pct_idle_time,0.,100.); + pct_swap_time = llclamp(pct_swap_time,0.,100.); + pct_scene_render_time = llclamp(pct_scene_render_time,0.,100.); - args["AV_FRAME_PCT"] = llformat("%02u", (U32)llround(pct_avatar_time)); - args["HUDS_FRAME_PCT"] = llformat("%02u", (U32)llround(pct_huds_time)); - args["UI_FRAME_PCT"] = llformat("%02u", (U32)llround(pct_ui_time)); - args["IDLE_FRAME_PCT"] = llformat("%02u", (U32)llround(pct_idle_time)); - args["SWAP_FRAME_PCT"] = llformat("%02u", (U32)llround(pct_swap_time)); - args["SCENERY_FRAME_PCT"] = llformat("%02u", (U32)llround(pct_scene_render_time)); - args["TOT_FRAME_TIME"] = llformat("%02u", (U32)llround(tot_frame_time_ns/1000000)); - args["FPSCAP"] = llformat("%02u", (U32)fpsCap); - args["FPSTARGET"] = llformat("%02u", (U32)targetFPS); + args["AV_FRAME_PCT"] = llformat("%02u", (U32)llround(pct_avatar_time)); + args["HUDS_FRAME_PCT"] = llformat("%02u", (U32)llround(pct_huds_time)); + args["UI_FRAME_PCT"] = llformat("%02u", (U32)llround(pct_ui_time)); + args["IDLE_FRAME_PCT"] = llformat("%02u", (U32)llround(pct_idle_time)); + args["SWAP_FRAME_PCT"] = llformat("%02u", (U32)llround(pct_swap_time)); + args["SCENERY_FRAME_PCT"] = llformat("%02u", (U32)llround(pct_scene_render_time)); + args["TOT_FRAME_TIME"] = llformat("%02u", (U32)llround(tot_frame_time_ns/1000000)); + args["FPSCAP"] = llformat("%02u", (U32)fpsCap); + args["FPSTARGET"] = llformat("%02u", (U32)targetFPS); - getChild("av_frame_stats")->setText(getString("av_frame_pct", args)); - getChild("huds_frame_stats")->setText(getString("huds_frame_pct", args)); - getChild("frame_breakdown")->setText(getString("frame_stats", args)); - - auto textbox = getChild("fps_warning"); - if (tot_sleep_time_raw > 0) // We are sleeping because view is not focussed - { - textbox->setVisible(true); - textbox->setText(getString("focus_fps")); - textbox->setColor(LLUIColorTable::instance().getColor("DrYellow")); - unreliable = true; - } - else if (tot_limit_time_raw > 0) - { - textbox->setVisible(true); - textbox->setText(getString("limit_fps", args)); - textbox->setColor(LLUIColorTable::instance().getColor("DrYellow")); - unreliable = true; - } - else if (FSPerfStats::autoTune) - { - textbox->setVisible(true); - textbox->setText(getString("tuning_fps", args)); - textbox->setColor(LLUIColorTable::instance().getColor("green")); + getChild("av_frame_stats")->setText(getString("av_frame_pct", args)); + getChild("huds_frame_stats")->setText(getString("huds_frame_pct", args)); + getChild("frame_breakdown")->setText(getString("frame_stats", args)); + + auto textbox = getChild("fps_warning"); + if (tot_sleep_time_raw > 0) // We are sleeping because view is not focussed + { + textbox->setVisible(true); + textbox->setText(getString("focus_fps")); + textbox->setColor(LLUIColorTable::instance().getColor("DrYellow")); + unreliable = true; + } + else if (tot_limit_time_raw > 0) + { + textbox->setVisible(true); + textbox->setText(getString("limit_fps", args)); + textbox->setColor(LLUIColorTable::instance().getColor("DrYellow")); + unreliable = true; + } + else if (FSPerfStats::autoTune) + { + textbox->setVisible(true); + textbox->setText(getString("tuning_fps", args)); + textbox->setColor(LLUIColorTable::instance().getColor("green")); + } + else + { + textbox->setVisible(false); + } + + if (FSPerfStats::autoTune && !unreliable ) + { + // the tuning itself is managed from another thread but we can report progress here + + // Is our target frame time lower than current? If so we need to take action to reduce draw overheads. + if (target_frame_time_ns <= tot_frame_time_ns) + { + U32 non_avatar_time_ns = tot_frame_time_ns - tot_avatar_time_ns; + // If the target frame time < non avatar frame time then we can pototentially reach it. + if (non_avatar_time_ns < target_frame_time_ns) + { + textbox->setColor(LLUIColorTable::instance().getColor("orange")); + } + else + { + // TODO(Beq): Set advisory text for further actions + textbox->setColor(LLUIColorTable::instance().getColor("red")); + } + } + else if (target_frame_time_ns > (tot_frame_time_ns + FSPerfStats::renderAvatarMaxART_ns)) + { + // if we have more time to spare. Display this (the service will update things) + textbox->setColor(LLUIColorTable::instance().getColor("green")); + } + } + + if (mHUDsPanel->getVisible()) + { + populateHUDList(); + } + else if (mNearbyPanel->getVisible()) + { + populateNearbyList(); + mNearbyPanel->getChild("hide_avatars")->set(!LLPipeline::hasRenderTypeControl(LLPipeline::RENDER_TYPE_AVATAR)); + } + else if (mComplexityPanel->getVisible()) + { + populateObjectList(); + } } else { - textbox->setVisible(false); + LL_WARNS("performance") << "Scene time 0. Skipping til we have data." << LL_ENDL; } - - if (FSPerfStats::autoTune && !unreliable ) - { - // the tuning itself is managed from another thread but we can report progress here - - // Is our target frame time lower than current? If so we need to take action to reduce draw overheads. - if (target_frame_time_ns <= tot_frame_time_ns) - { - U32 non_avatar_time_ns = tot_frame_time_ns - tot_avatar_time_ns; - // If the target frame time < non avatar frame time then we can pototentially reach it. - if (non_avatar_time_ns < target_frame_time_ns) - { - textbox->setColor(LLUIColorTable::instance().getColor("orange")); - } - else - { - // TODO(Beq): Set advisory text for further actions - textbox->setColor(LLUIColorTable::instance().getColor("red")); - } - } - else if (target_frame_time_ns > (tot_frame_time_ns + FSPerfStats::renderAvatarMaxART_ns)) - { - // if we have more time to spare. Display this (the service will update things) - textbox->setColor(LLUIColorTable::instance().getColor("green")); - } - } - - if (mHUDsPanel->getVisible()) - { - populateHUDList(); - } - else if (mNearbyPanel->getVisible()) - { - populateNearbyList(); - mNearbyPanel->getChild("hide_avatars")->set(!LLPipeline::hasRenderTypeControl(LLPipeline::RENDER_TYPE_AVATAR)); - } - else if (mComplexityPanel->getVisible()) - { - populateObjectList(); - } - + mUpdateTimer->setTimerExpirySec(REFRESH_INTERVAL); } LLFloater::draw(); diff --git a/indra/newview/fsperfstats.cpp b/indra/newview/fsperfstats.cpp index 1febba5f35..aebb1a600a 100644 --- a/indra/newview/fsperfstats.cpp +++ b/indra/newview/fsperfstats.cpp @@ -109,6 +109,7 @@ namespace FSPerfStats unreliable = true; lastStats[static_cast(StatType_t::RENDER_FPSLIMIT)] = sceneStats[static_cast(StatType_t::RENDER_FPSLIMIT)]; lastStats[static_cast(StatType_t::RENDER_SLEEP)] = sceneStats[static_cast(StatType_t::RENDER_SLEEP)]; + lastStats[static_cast(StatType_t::RENDER_FRAME)] = sceneStats[static_cast(StatType_t::RENDER_FRAME)]; // bring over the total frame render time to deal with region crossing overlap issues } if(!unreliable) From 53c77c07fe325ff5d7b5cc198c060a9a2a985f83 Mon Sep 17 00:00:00 2001 From: Beq Date: Tue, 18 Jan 2022 13:58:16 +0000 Subject: [PATCH 23/48] XUI fixes for remaining languages Update for RU and PL which had inherited my typo. See also fix from Ansa for DE --- indra/newview/skins/default/xui/pl/floater_performance.xml | 2 +- indra/newview/skins/default/xui/ru/floater_performance.xml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/indra/newview/skins/default/xui/pl/floater_performance.xml b/indra/newview/skins/default/xui/pl/floater_performance.xml index 7973ca493b..d0cef75141 100644 --- a/indra/newview/skins/default/xui/pl/floater_performance.xml +++ b/indra/newview/skins/default/xui/pl/floater_performance.xml @@ -42,7 +42,7 @@ - + diff --git a/indra/newview/skins/default/xui/ru/floater_performance.xml b/indra/newview/skins/default/xui/ru/floater_performance.xml index 37f18b0b27..2380f6de67 100644 --- a/indra/newview/skins/default/xui/ru/floater_performance.xml +++ b/indra/newview/skins/default/xui/ru/floater_performance.xml @@ -38,7 +38,7 @@ - + From 4f4a11e054beb76069a6687999b909c5d8cee827 Mon Sep 17 00:00:00 2001 From: Nicky Date: Sat, 22 Jan 2022 02:03:35 +0100 Subject: [PATCH 24/48] Port X11 clipboard handling from Cool VL. Many thanks Henri --- indra/llwindow/llwindowsdl.cpp | 258 ++++++++++++++++++++++++++++++++- indra/llwindow/llwindowsdl.h | 18 +++ 2 files changed, 269 insertions(+), 7 deletions(-) diff --git a/indra/llwindow/llwindowsdl.cpp b/indra/llwindow/llwindowsdl.cpp index 6945e8da67..15f67bf73a 100644 --- a/indra/llwindow/llwindowsdl.cpp +++ b/indra/llwindow/llwindowsdl.cpp @@ -187,6 +187,248 @@ Display* LLWindowSDL::get_SDL_Display(void) } #endif // LL_X11 +#if LL_X11 + +// Clipboard handing via native X11, base on the implementation in Cool VL by Henri Beauchamp + +namespace +{ + std::array gSupportedAtoms; + + Atom XA_CLIPBOARD; + Atom XA_TARGETS; + Atom PVT_PASTE_BUFFER; + long const MAX_PASTE_BUFFER_SIZE = 16383; + + void filterSelectionRequest( XEvent aEvent ) + { + auto *display = LLWindowSDL::getSDLDisplay(); + auto &request = aEvent.xselectionrequest; + + XSelectionEvent reply { SelectionNotify, aEvent.xany.serial, aEvent.xany.send_event, display, + request.requestor, request.selection, request.target, + request.property,request.time }; + + if (request.target == XA_TARGETS) + { + XChangeProperty(display, request.requestor, request.property, + XA_ATOM, 32, PropModeReplace, + (unsigned char *) &gSupportedAtoms.front(), gSupportedAtoms.size()); + } + else if (std::find(gSupportedAtoms.begin(), gSupportedAtoms.end(), request.target) != + gSupportedAtoms.end()) + { + std::string utf8; + if (request.selection == XA_PRIMARY) + utf8 = wstring_to_utf8str(gWindowImplementation->getPrimaryText()); + else + utf8 = wstring_to_utf8str(gWindowImplementation->getSecondaryText()); + + XChangeProperty(display, request.requestor, request.property, + request.target, 8, PropModeReplace, + (unsigned char *) utf8.c_str(), utf8.length()); + } + else if (request.selection == XA_CLIPBOARD) + { + // Did not have what they wanted, so no property set + reply.property = None; + } + else + return; + + XSendEvent(request.display, request.requestor, False, NoEventMask, (XEvent *) &reply); + XSync(display, False); + } + + void filterSelectionClearRequest( XEvent aEvent ) + { + auto &request = aEvent.xselectionrequest; + if (request.selection == XA_PRIMARY) + gWindowImplementation->clearPrimaryText(); + else if (request.selection == XA_CLIPBOARD) + gWindowImplementation->clearSecondaryText(); + } + + int x11_clipboard_filter(const SDL_Event *evt) + { + Display *display = LLWindowSDL::getSDLDisplay(); + if (!display) + return 1; + + if (evt->type != SDL_SYSWMEVENT) + return 1; + + auto xevent = evt->syswm.msg->event.xevent; + + if (xevent.type == SelectionRequest) + filterSelectionRequest( xevent ); + else if (xevent.type == SelectionClear) + filterSelectionClearRequest( xevent ); + return 1; + } + + bool grab_property(Display* display, Window window, Atom selection, Atom target) + { + if( !display ) + return false; + + maybe_lock_display(); + + XDeleteProperty(display, window, PVT_PASTE_BUFFER); + XFlush(display); + + XConvertSelection(display, selection, target, PVT_PASTE_BUFFER, window, CurrentTime); + + // Unlock the connection so that the SDL event loop may function + maybe_unlock_display(); + + const auto start{ SDL_GetTicks() }; + const auto end{ start + 1000 }; + + XEvent xevent {}; + bool response = false; + + do + { + SDL_Event event {}; + + // Wait for an event + SDL_WaitEvent(&event); + + // If the event is a window manager event + if (event.type == SDL_SYSWMEVENT) + { + xevent = event.syswm.msg->event.xevent; + + if (xevent.type == SelectionNotify && xevent.xselection.requestor == window) + response = true; + } + } while (!response && SDL_GetTicks() < end ); + + return response && xevent.xselection.property != None; + } +} + +void LLWindowSDL::initialiseX11Clipboard() +{ + if (!mSDL_Display) + return; + + SDL_EventState(SDL_SYSWMEVENT, SDL_ENABLE); + SDL_SetEventFilter(x11_clipboard_filter); + + maybe_lock_display(); + + XA_CLIPBOARD = XInternAtom(mSDL_Display, "CLIPBOARD", False); + + gSupportedAtoms[0] = XA_STRING; + + gSupportedAtoms[1] = XInternAtom(mSDL_Display, "COMPOUND_TEXT", False); + gSupportedAtoms[2] = XInternAtom(mSDL_Display, "UTF8_STRING", False); + + // TARGETS atom + XA_TARGETS = XInternAtom(mSDL_Display, "TARGETS", False); + + // SL_PASTE_BUFFER atom + PVT_PASTE_BUFFER = XInternAtom(mSDL_Display, "FS_PASTE_BUFFER", False); + + maybe_unlock_display(); +} + +bool LLWindowSDL::getSelectionText( Atom aSelection, Atom aType, LLWString &text ) +{ + if( !mSDL_Display ) + return false; + + if( !grab_property(mSDL_Display, mSDL_XWindowID, aSelection,aType ) ) + return false; + + maybe_lock_display(); + + Atom type; + int format{}; + unsigned long len{},remaining {}; + unsigned char* data = nullptr; + int res = XGetWindowProperty(mSDL_Display, mSDL_XWindowID, + PVT_PASTE_BUFFER, 0, MAX_PASTE_BUFFER_SIZE, False, + AnyPropertyType, &type, &format, &len, + &remaining, &data); + if (data && len) + { + text = LLWString( + utf8str_to_wstring(reinterpret_cast< char const *>( data ) ) + ); + XFree(data); + } + + maybe_unlock_display(); + return res == Success; +} + +bool LLWindowSDL::getSelectionText(Atom selection, LLWString& text) +{ + if (!mSDL_Display) + return false; + + maybe_lock_display(); + + Window owner = XGetSelectionOwner(mSDL_Display, selection); + if (owner == None) + { + if (selection == XA_PRIMARY) + { + owner = DefaultRootWindow(mSDL_Display); + selection = XA_CUT_BUFFER0; + } + else + { + maybe_unlock_display(); + return false; + } + } + + maybe_unlock_display(); + + for( Atom atom : gSupportedAtoms ) + { + if(getSelectionText(selection, atom, text ) ) + return true; + } + + return false; +} + +bool LLWindowSDL::setSelectionText(Atom selection, const LLWString& text) +{ + maybe_lock_display(); + + if (selection == XA_PRIMARY) + { + std::string utf8 = wstring_to_utf8str(text); + XStoreBytes(mSDL_Display, utf8.c_str(), utf8.length() + 1); + mPrimaryClipboard = text; + } + else + mSecondaryClipboard = text; + + XSetSelectionOwner(mSDL_Display, selection, mSDL_XWindowID, CurrentTime); + + auto owner = XGetSelectionOwner(mSDL_Display, selection); + + maybe_unlock_display(); + + return owner == mSDL_XWindowID; +} + +Display* LLWindowSDL::getSDLDisplay() +{ + if (gWindowImplementation) + return gWindowImplementation->mSDL_Display; + return nullptr; +} + +#endif + LLWindowSDL::LLWindowSDL(LLWindowCallbacks* callbacks, const std::string& title, S32 x, S32 y, S32 width, @@ -254,6 +496,7 @@ LLWindowSDL::LLWindowSDL(LLWindowCallbacks* callbacks, #if LL_X11 mFlashing = FALSE; + initialiseX11Clipboard(); #endif // LL_X11 mKeyScanCode = 0; @@ -1357,33 +1600,34 @@ BOOL LLWindowSDL::copyTextToPrimary(const LLWString &text) #else BOOL LLWindowSDL::isClipboardTextAvailable() -{ - return FALSE; // unsupported +{ + return mSDL_Display && XGetSelectionOwner(mSDL_Display, XA_CLIPBOARD) != None; } BOOL LLWindowSDL::pasteTextFromClipboard(LLWString &dst) { - return FALSE; // unsupported + return getSelectionText(XA_CLIPBOARD, dst); } BOOL LLWindowSDL::copyTextToClipboard(const LLWString &s) { - return FALSE; // unsupported + return setSelectionText(XA_CLIPBOARD, s); } BOOL LLWindowSDL::isPrimaryTextAvailable() { - return FALSE; // unsupported + LLWString text; + return getSelectionText(XA_PRIMARY, text) && !text.empty(); } BOOL LLWindowSDL::pasteTextFromPrimary(LLWString &dst) { - return FALSE; // unsupported + return getSelectionText(XA_PRIMARY, dst); } BOOL LLWindowSDL::copyTextToPrimary(const LLWString &s) { - return FALSE; // unsupported + return setSelectionText(XA_PRIMARY, s); } #endif // LL_GTK diff --git a/indra/llwindow/llwindowsdl.h b/indra/llwindow/llwindowsdl.h index de0ee173ec..a0ca9839a5 100644 --- a/indra/llwindow/llwindowsdl.h +++ b/indra/llwindow/llwindowsdl.h @@ -220,6 +220,24 @@ private: U32 mSDLSym; // Store the SDL Keysym too. BOOL mUseLegacyCursors; // Legacy cursor setting from main program + +public: +#if LL_X11 + static Display* getSDLDisplay(); + LLWString const& getPrimaryText() const { return mPrimaryClipboard; } + LLWString const& getSecondaryText() const { return mSecondaryClipboard; } + void clearPrimaryText() { mPrimaryClipboard.clear(); } + void clearSecondaryText() { mSecondaryClipboard.clear(); } +private: + void initialiseX11Clipboard(); + + bool getSelectionText(Atom selection, LLWString& text); + bool getSelectionText( Atom selection, Atom type, LLWString &text ); + + bool setSelectionText(Atom selection, const LLWString& text); +#endif + LLWString mPrimaryClipboard; + LLWString mSecondaryClipboard; }; From 43944a6fbc94710793576b971f98068decf56e0c Mon Sep 17 00:00:00 2001 From: Ansariel Date: Sat, 22 Jan 2022 11:30:47 +0100 Subject: [PATCH 25/48] Fix wrong check --- indra/newview/llfloatertools.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/indra/newview/llfloatertools.cpp b/indra/newview/llfloatertools.cpp index c60ab8ca2a..500ec37738 100644 --- a/indra/newview/llfloatertools.cpp +++ b/indra/newview/llfloatertools.cpp @@ -334,15 +334,15 @@ BOOL LLFloaterTools::postBuild() sShowObjectCost = gSavedSettings.getBOOL("ShowObjectRenderingCost"); // Added back more/less button - LLButton* btnExpand = getChild("btnExpand"); + LLButton* btnExpand = findChild("btnExpand"); if (btnExpand && mTab) { mExpandedHeight = getRect().getHeight(); mCollapsedHeight = mExpandedHeight - mTab->getRect().getHeight() + btnExpand->getRect().getHeight(); - if(!gSavedSettings.getBOOL("FSToolboxExpanded")) + if (!gSavedSettings.getBOOL("FSToolboxExpanded")) { mTab->setVisible(FALSE); - reshape( getRect().getWidth(), mCollapsedHeight); + reshape(getRect().getWidth(), mCollapsedHeight); btnExpand->setImageOverlay("Arrow_Down", btnExpand->getImageOverlayHAlign()); } } From b3d297ca9bd1330cd78ef47d5a95d1dee1611999 Mon Sep 17 00:00:00 2001 From: Beq Date: Sat, 22 Jan 2022 16:46:54 +0000 Subject: [PATCH 26/48] FIRE-17459 - Add unattenuated local voice support back on OpenSim More details in Jira. Seems this functionality is not supported on later Vivox 4 versions. Still works on server 4.6 (opensim) --- indra/newview/llfloaterpreference.cpp | 10 ++++++++++ indra/newview/llvoicevivox.cpp | 16 +++++++++++++++- indra/newview/llvoicevivox.h | 1 + .../default/xui/en/panel_preferences_sound.xml | 13 +++++++++++-- 4 files changed, 37 insertions(+), 3 deletions(-) diff --git a/indra/newview/llfloaterpreference.cpp b/indra/newview/llfloaterpreference.cpp index 6c3b06ad60..5221d9cfa4 100644 --- a/indra/newview/llfloaterpreference.cpp +++ b/indra/newview/llfloaterpreference.cpp @@ -3139,6 +3139,16 @@ void LLFloaterPreference::updateUISoundsControls() getChild("PlayModeUISndNewIncomingGroupIMSession")->setValue((int)gSavedSettings.getU32("PlayModeUISndNewIncomingGroupIMSession")); // 0, 1, 2, 3. Shared with Chat > Notifications > "When receiving Group Instant Messages" getChild("PlayModeUISndNewIncomingConfIMSession")->setValue((int)gSavedSettings.getU32("PlayModeUISndNewIncomingConfIMSession")); // 0, 1, 2, 3. Shared with Chat > Notifications > "When receiving AdHoc Instant Messages" #ifdef OPENSIM + auto earPosGroup = getChild("ear_location"); + // OpenSim has option to not attenuate nearby local voice by distance + if(earPosGroup) + { + // It seems there is no better way to do this than with magic numbers short of importing the enums in vivoxvoice (which aren't necessarily the same thing). + // Index 2 here is the opensim only option to hear nearby chat without attenuation. + constexpr int hearNearbyVoiceFullVolume{2}; + earPosGroup->setIndexEnabled(hearNearbyVoiceFullVolume,LLGridManager::instance().isInOpenSim()); + } + // getChild("textFSRestartOpenSim")->setVisible(TRUE); getChild("UISndRestartOpenSim")->setVisible(TRUE); getChild("Prev_UISndRestartOpenSim")->setVisible(TRUE); diff --git a/indra/newview/llvoicevivox.cpp b/indra/newview/llvoicevivox.cpp index 0591fd898d..8db9cfa228 100644 --- a/indra/newview/llvoicevivox.cpp +++ b/indra/newview/llvoicevivox.cpp @@ -3373,17 +3373,31 @@ void LLVivoxVoiceClient::sendPositionAndVolumeUpdate(void) earVelocity = mAvatarVelocity; earRot = mCameraRot; break; +// reimplement hear voice equally + case earLocSpeaker: + // we leave EarPos/Vel/Rot as empty + LL_DEBUGS("Voice") << "EarLoc Speaker in use" << LL_ENDL; + break; +// } +// reimplement hear voice equally + if(mEarLocation != earLocSpeaker) + { + // for all spatial sources we need to do the transform +// l = earRot.getLeftRow(); u = earRot.getUpRow(); a = earRot.getFwdRow(); pos = earPosition; vel = earVelocity; - + oldSDKTransform(l, u, a, pos, vel); +// reimplement hear voice equally + } +// if (mHidden) { diff --git a/indra/newview/llvoicevivox.h b/indra/newview/llvoicevivox.h index d19e6ca718..23a04b723c 100644 --- a/indra/newview/llvoicevivox.h +++ b/indra/newview/llvoicevivox.h @@ -803,6 +803,7 @@ private: { earLocCamera = 0, // ear at camera earLocAvatar, // ear at avatar + earLocSpeaker, // re-add equal voice based loosely on original patch from Tigh MacFanatic earLocMixed // ear at avatar location/camera direction }; diff --git a/indra/newview/skins/default/xui/en/panel_preferences_sound.xml b/indra/newview/skins/default/xui/en/panel_preferences_sound.xml index 4e5d3d25dd..4633555472 100644 --- a/indra/newview/skins/default/xui/en/panel_preferences_sound.xml +++ b/indra/newview/skins/default/xui/en/panel_preferences_sound.xml @@ -939,7 +939,7 @@ layout="topleft" left="25" width="400" - height="40" + height="60" top_pad="0" name="ear_location"> - + Date: Sat, 22 Jan 2022 22:58:41 +0100 Subject: [PATCH 27/48] Fix next check --- indra/newview/llfloaterpreference.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/indra/newview/llfloaterpreference.cpp b/indra/newview/llfloaterpreference.cpp index 5221d9cfa4..533cb39a7b 100644 --- a/indra/newview/llfloaterpreference.cpp +++ b/indra/newview/llfloaterpreference.cpp @@ -3139,14 +3139,14 @@ void LLFloaterPreference::updateUISoundsControls() getChild("PlayModeUISndNewIncomingGroupIMSession")->setValue((int)gSavedSettings.getU32("PlayModeUISndNewIncomingGroupIMSession")); // 0, 1, 2, 3. Shared with Chat > Notifications > "When receiving Group Instant Messages" getChild("PlayModeUISndNewIncomingConfIMSession")->setValue((int)gSavedSettings.getU32("PlayModeUISndNewIncomingConfIMSession")); // 0, 1, 2, 3. Shared with Chat > Notifications > "When receiving AdHoc Instant Messages" #ifdef OPENSIM - auto earPosGroup = getChild("ear_location"); // OpenSim has option to not attenuate nearby local voice by distance - if(earPosGroup) + auto earPosGroup = findChild("ear_location"); + if (earPosGroup) { // It seems there is no better way to do this than with magic numbers short of importing the enums in vivoxvoice (which aren't necessarily the same thing). // Index 2 here is the opensim only option to hear nearby chat without attenuation. constexpr int hearNearbyVoiceFullVolume{2}; - earPosGroup->setIndexEnabled(hearNearbyVoiceFullVolume,LLGridManager::instance().isInOpenSim()); + earPosGroup->setIndexEnabled(hearNearbyVoiceFullVolume, LLGridManager::instance().isInOpenSim()); } // getChild("textFSRestartOpenSim")->setVisible(TRUE); From 6ee3a14bb5c1a64635b0d79b59afdd29f39ac035 Mon Sep 17 00:00:00 2001 From: Ansariel Date: Sat, 22 Jan 2022 23:06:37 +0100 Subject: [PATCH 28/48] Update German translation --- .../xui/de/panel_preferences_sound.xml | 58 +++++++++---------- 1 file changed, 29 insertions(+), 29 deletions(-) diff --git a/indra/newview/skins/default/xui/de/panel_preferences_sound.xml b/indra/newview/skins/default/xui/de/panel_preferences_sound.xml index 8cdf0fa6dd..06df86e757 100644 --- a/indra/newview/skins/default/xui/de/panel_preferences_sound.xml +++ b/indra/newview/skins/default/xui/de/panel_preferences_sound.xml @@ -10,8 +10,8 @@ Maustaste 5 - - + + @@ -57,7 +57,7 @@ - + @@ -72,23 +72,23 @@