Sync with Alchemy, includes much awaited lib updates for Linux

Applies ALCH-420 - Replace all invisiprims with fully transparent texture and remove dead code paths
-ARC no longer takes invisis into consideration.

Syncs some script keywords updates.

Changes all "\n" in llfloaterabout.cpp to '\n' because screw.dat
This commit is contained in:
Lirusaito
2016-03-27 23:24:17 -04:00
parent af58abb7ec
commit e62261edb2
34 changed files with 1191 additions and 707 deletions

View File

@@ -45,7 +45,10 @@
#if LL_GTK
extern "C" {
# include "gtk/gtk.h"
# include <gtk/gtk.h>
#if GTK_CHECK_VERSION(2, 24, 0)
#include <gdk/gdkx.h>
#endif
}
#include <locale.h>
#endif // LL_GTK
@@ -86,23 +89,6 @@ static bool ATIbug = false;
// be only one object of this class at any time. Currently this is true.
static LLWindowSDL *gWindowImplementation = NULL;
void maybe_lock_display(void)
{
if (gWindowImplementation && gWindowImplementation->Lock_Display) {
gWindowImplementation->Lock_Display();
}
}
void maybe_unlock_display(void)
{
if (gWindowImplementation && gWindowImplementation->Unlock_Display) {
gWindowImplementation->Unlock_Display();
}
}
#if LL_GTK
// Lazily initialize and check the runtime GTK version for goodness.
// static
@@ -116,9 +102,7 @@ bool LLWindowSDL::ll_try_gtk_init(void)
if (!done_setlocale)
{
LL_INFOS() << "Starting GTK Initialization." << LL_ENDL;
maybe_lock_display();
gtk_disable_setlocale();
maybe_unlock_display();
done_setlocale = TRUE;
}
@@ -128,9 +112,7 @@ bool LLWindowSDL::ll_try_gtk_init(void)
#if !GLIB_CHECK_VERSION(2, 32, 0)
if (!g_thread_supported ()) g_thread_init (NULL);
#endif
maybe_lock_display();
gtk_is_good = gtk_init_check(NULL, NULL);
maybe_unlock_display();
if (!gtk_is_good)
LL_WARNS() << "GTK Initialization failed." << LL_ENDL;
}
@@ -146,12 +128,10 @@ bool LLWindowSDL::ll_try_gtk_init(void)
<< gtk_major_version << "."
<< gtk_minor_version << "."
<< gtk_micro_version << LL_ENDL;
maybe_lock_display();
const gchar* gtk_warning = gtk_check_version(
GTK_MAJOR_VERSION,
GTK_MINOR_VERSION,
GTK_MICRO_VERSION);
maybe_unlock_display();
if (gtk_warning)
{
LL_WARNS() << "- GTK COMPATIBILITY WARNING: " <<
@@ -198,13 +178,13 @@ LLWindowSDL::LLWindowSDL(LLWindowCallbacks* callbacks,
BOOL ignore_pixel_depth, U32 fsaa_samples)
: LLWindow(callbacks, fullscreen, flags),
Lock_Display(NULL),
Unlock_Display(NULL), mGamma(1.0f)
{
// Initialize the keyboard
gKeyboard = new LLKeyboardSDL();
gKeyboard->setCallbacks(callbacks);
// Note that we can't set up key-repeat until after SDL has init'd video
// Ignore use_gl for now, only used for drones on PC
mWindow = NULL;
mNeedsResize = FALSE;
mOverrideAspectRatio = 0.f;
@@ -230,7 +210,7 @@ LLWindowSDL::LLWindowSDL(LLWindowCallbacks* callbacks,
mOriginalAspectRatio = 1024.0 / 768.0;
if (title.empty())
mWindowTitle = "SDL Window"; // *FIX: (???)
mWindowTitle = "SDL Window"; // *FIX: (?)
else
mWindowTitle = title;
@@ -315,7 +295,7 @@ static int x11_detect_VRAM_kb()
#if LL_SOLARIS && defined(__sparc)
// NOTE: there's no Xorg server on SPARC so just return 0
// and allow SDL to attempt to get the amount of VRAM
return(0);
return 0;
#else
std::string x_log_location("/var/log/");
@@ -594,7 +574,6 @@ BOOL LLWindowSDL::createContext(int x, int y, int width, int height, int bits, B
mWindow = SDL_SetVideoMode(width, height, bits, sdlflags);
}
if (!mWindow)
{
LL_WARNS() << "createContext: window creation failure. SDL: " << SDL_GetError() << LL_ENDL;
@@ -607,13 +586,14 @@ BOOL LLWindowSDL::createContext(int x, int y, int width, int height, int bits, B
}
// Detect video memory size.
# if LL_X11
#if LL_X11
gGLManager.mVRAM = x11_detect_VRAM_kb() / 1024;
if (gGLManager.mVRAM != 0)
{
LL_INFOS() << "X11 log-parser detected " << gGLManager.mVRAM << "MB VRAM." << LL_ENDL;
} else
# endif // LL_X11
}
else
#endif // LL_X11
{
// fallback to letting SDL detect VRAM.
// note: I've not seen SDL's detection ever actually find
@@ -677,23 +657,6 @@ BOOL LLWindowSDL::createContext(int x, int y, int width, int height, int bits, B
return FALSE;
}
#if 0 // *FIX: we're going to brave it for now...
if (alphaBits < 8)
{
close();
setupFailure(
"Second Life is unable to run because it can't get an 8 bit alpha\n"
"channel. Usually this is due to video card driver issues.\n"
"Please make sure you have the latest video card drivers installed.\n"
"Also be sure your monitor is set to True Color (32-bit) in\n"
"Control Panels -> Display -> Settings.\n"
"If you continue to receive this message, contact customer service.",
"Error",
OSMB_OK);
return FALSE;
}
#endif
#if LL_X11
/* Grab the window manager specific information */
SDL_SysWMinfo info;
@@ -705,8 +668,6 @@ BOOL LLWindowSDL::createContext(int x, int y, int width, int height, int bits, B
{
mSDL_Display = info.info.x11.display;
mSDL_XWindowID = info.info.x11.wmwindow;
Lock_Display = info.info.x11.lock_func;
Unlock_Display = info.info.x11.unlock_func;
}
else
{
@@ -804,8 +765,6 @@ void LLWindowSDL::destroyContext()
#if LL_X11
mSDL_Display = NULL;
mSDL_XWindowID = None;
Lock_Display = NULL;
Unlock_Display = NULL;
#endif // LL_X11
// Clean up remaining GL state before blowing away window
@@ -960,7 +919,7 @@ BOOL LLWindowSDL::setPosition(const LLCoordScreen position)
{
if(mWindow)
{
// *FIX: (???)
// *FIX: (?)
//MacMoveWindow(mWindow, position.mX, position.mY, false);
}
@@ -1206,9 +1165,7 @@ void LLWindowSDL::beforeDialog()
{
// Everything that we/SDL asked for should happen before we
// potentially hand control over to GTK.
maybe_lock_display();
XSync(mSDL_Display, False);
maybe_unlock_display();
}
#endif // LL_X11
@@ -1217,8 +1174,6 @@ void LLWindowSDL::beforeDialog()
// diagnostics, if not already done.
ll_try_gtk_init();
#endif // LL_GTK
maybe_lock_display();
}
void LLWindowSDL::afterDialog()
@@ -1230,8 +1185,6 @@ void LLWindowSDL::afterDialog()
LL_INFOS() << "LLWindowSDL::afterDialog()" << LL_ENDL;
maybe_unlock_display();
if (mFullscreen)
{
// need to restore fullscreen mode after dialog - only works
@@ -1254,7 +1207,6 @@ void LLWindowSDL::x11_set_urgent(BOOL urgent)
LL_INFOS() << "X11 hint for urgency, " << urgent << LL_ENDL;
maybe_lock_display();
wm_hints = XGetWMHints(mSDL_Display, mSDL_XWindowID);
if (!wm_hints)
wm_hints = XAllocWMHints();
@@ -1267,7 +1219,6 @@ void LLWindowSDL::x11_set_urgent(BOOL urgent)
XSetWMHints(mSDL_Display, mSDL_XWindowID, wm_hints);
XFree(wm_hints);
XSync(mSDL_Display, False);
maybe_unlock_display();
}
}
#endif // LL_X11
@@ -1567,12 +1518,10 @@ BOOL LLWindowSDL::SDLReallyCaptureInput(BOOL capture)
{
//LL_INFOS() << "X11 POINTER GRABBY" << LL_ENDL;
//newmode = SDL_WM_GrabInput(wantmode);
maybe_lock_display();
result = XGrabPointer(mSDL_Display, mSDL_XWindowID,
True, 0, GrabModeAsync,
GrabModeAsync,
None, None, CurrentTime);
maybe_unlock_display();
if (GrabSuccess == result)
newmode = SDL_GRAB_ON;
else
@@ -1583,11 +1532,9 @@ BOOL LLWindowSDL::SDLReallyCaptureInput(BOOL capture)
newmode = SDL_GRAB_OFF;
//newmode = SDL_WM_GrabInput(SDL_GRAB_OFF);
maybe_lock_display();
XUngrabPointer(mSDL_Display, CurrentTime);
// Make sure the ungrab happens RIGHT NOW.
XSync(mSDL_Display, False);
maybe_unlock_display();
} else
{
newmode = SDL_GRAB_QUERY; // neutral
@@ -1784,6 +1731,7 @@ void LLWindowSDL::gatherInput()
mKeyScanCode = event.key.keysym.scancode;
mKeyVirtualKey = event.key.keysym.unicode;
mKeyModifiers = event.key.keysym.mod;
mKeySym = event.key.keysym.sym;
gKeyboard->handleKeyDown(event.key.keysym.sym, event.key.keysym.mod);
// part of the fix for SL-13243
@@ -1801,6 +1749,7 @@ void LLWindowSDL::gatherInput()
mKeyScanCode = event.key.keysym.scancode;
mKeyVirtualKey = event.key.keysym.unicode;
mKeyModifiers = event.key.keysym.mod;
mKeySym = event.key.keysym.sym;
if (SDLCheckGrabbyKeys(event.key.keysym.sym, FALSE) == 0)
SDLReallyCaptureInput(FALSE); // part of the fix for SL-13243
@@ -2312,8 +2261,7 @@ S32 OSMessageBoxSDL(const std::string& text, const std::string& caption, U32 typ
{
gtk_widget_realize(GTK_WIDGET(win)); // so we can get its gdkwin
GdkWindow *gdkwin = gdk_window_foreign_new(gWindowImplementation->mSDL_XWindowID);
gdk_window_set_transient_for(GTK_WIDGET(win)->window,
gdkwin);
gdk_window_set_transient_for(GTK_WIDGET(win)->window, gdkwin);
}
# endif //LL_X11
@@ -2402,6 +2350,7 @@ LLSD LLWindowSDL::getNativeKeyData()
result["scan_code"] = (S32)mKeyScanCode;
result["virtual_key"] = (S32)mKeyVirtualKey;
result["modifiers"] = (S32)modifiers;
result[ "sdl_sym" ] = (S32)mKeySym;
return result;
}
@@ -2427,8 +2376,7 @@ BOOL LLWindowSDL::dialogColorPicker( F32 *r, F32 *g, F32 *b)
{
gtk_widget_realize(GTK_WIDGET(win)); // so we can get its gdkwin
GdkWindow *gdkwin = gdk_window_foreign_new(mSDL_XWindowID);
gdk_window_set_transient_for(GTK_WIDGET(win)->window,
gdkwin);
gdk_window_set_transient_for(GTK_WIDGET(win)->window, gdkwin);
}
# endif //LL_X11
@@ -2551,10 +2499,8 @@ void LLWindowSDL::spawnWebBrowser(const std::string& escaped_url, bool async)
# if LL_X11
if (mSDL_Display)
{
maybe_lock_display();
// Just in case - before forking.
XSync(mSDL_Display, False);
maybe_unlock_display();
}
# endif // LL_X11
@@ -2571,19 +2517,12 @@ void LLWindowSDL::spawnWebBrowser(const std::string& escaped_url, bool async)
LL_INFOS() << "spawn_web_browser returning." << LL_ENDL;
}
void LLWindowSDL::setTitle(const std::string &title)
{
mWindowTitle = title;
SDL_WM_SetCaption(mWindowTitle.c_str(),mWindowTitle.c_str());
}
void *LLWindowSDL::getPlatformWindow()
{
#if LL_GTK && LL_LLMOZLIB_ENABLED
if (LLWindowSDL::ll_try_gtk_init())
{
maybe_lock_display();
GtkWidget *owin = gtk_window_new(GTK_WINDOW_POPUP);
// Why a layout widget? A MozContainer would be ideal, but
// it involves exposing Mozilla headers to mozlib-using apps.
@@ -2595,8 +2534,6 @@ void *LLWindowSDL::getPlatformWindow()
gtk_widget_realize(rtnw);
GTK_WIDGET_UNSET_FLAGS(GTK_WIDGET(rtnw), GTK_NO_WINDOW);
maybe_unlock_display();
return rtnw;
}
#endif // LL_GTK && LL_LLMOZLIB_ENABLED
@@ -2612,10 +2549,8 @@ void LLWindowSDL::bringToFront()
#if LL_X11
if (mSDL_Display && !mFullscreen)
{
maybe_lock_display();
XRaiseWindow(mSDL_Display, mSDL_XWindowID);
XSync(mSDL_Display, False);
maybe_unlock_display();
}
#endif // LL_X11
}
@@ -2626,7 +2561,7 @@ std::vector<std::string> LLWindowSDL::getDynamicFallbackFontList()
// Use libfontconfig to find us a nice ordered list of fallback fonts
// specific to this system.
std::string final_fallback("/usr/share/fonts/truetype/kochi/kochi-gothic.ttf");
const int max_font_count_cutoff = 100; // fonts are expensive in the current system, don't enumerate an arbitrary number of them
const int max_font_count_cutoff = 40; // fonts are expensive in the current system, don't enumerate an arbitrary number of them
// Our 'ideal' font properties which define the sorting results.
// slant=0 means Roman, index=0 means the first face in a font file
// (the one we actually use), weight=80 means medium weight,
@@ -2721,4 +2656,10 @@ std::vector<std::string> LLWindowSDL::getDynamicFallbackFontList()
return rtns;
}
void LLWindowSDL::setTitle(const std::string& title)
{
mWindowTitle = title;
SDL_WM_SetCaption(mWindowTitle.c_str(),mWindowTitle.c_str());
}
#endif // LL_SDL