aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/linden/indra/llwindow/llwindowsdl.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'linden/indra/llwindow/llwindowsdl.cpp')
-rw-r--r--linden/indra/llwindow/llwindowsdl.cpp45
1 files changed, 35 insertions, 10 deletions
diff --git a/linden/indra/llwindow/llwindowsdl.cpp b/linden/indra/llwindow/llwindowsdl.cpp
index 7d42bce..f8a87c4 100644
--- a/linden/indra/llwindow/llwindowsdl.cpp
+++ b/linden/indra/llwindow/llwindowsdl.cpp
@@ -116,7 +116,9 @@ BOOL ll_try_gtk_init(void)
116 if (!tried_gtk_init) 116 if (!tried_gtk_init)
117 { 117 {
118 tried_gtk_init = TRUE; 118 tried_gtk_init = TRUE;
119#if LL_GSTREAMER_ENABLED
119 if (!g_thread_supported ()) g_thread_init (NULL); 120 if (!g_thread_supported ()) g_thread_init (NULL);
121#endif // LL_GSTREAMER_ENABLED
120 maybe_lock_display(); 122 maybe_lock_display();
121 gtk_is_good = gtk_init_check(NULL, NULL); 123 gtk_is_good = gtk_init_check(NULL, NULL);
122 maybe_unlock_display(); 124 maybe_unlock_display();
@@ -503,6 +505,9 @@ BOOL LLWindowSDL::createContext(int x, int y, int width, int height, int bits, B
503 SDL_GL_SetAttribute(SDL_GL_BLUE_SIZE, 8); 505 SDL_GL_SetAttribute(SDL_GL_BLUE_SIZE, 8);
504#if !LL_SOLARIS 506#if !LL_SOLARIS
505 SDL_GL_SetAttribute(SDL_GL_DEPTH_SIZE, (bits <= 16) ? 16 : 24); 507 SDL_GL_SetAttribute(SDL_GL_DEPTH_SIZE, (bits <= 16) ? 16 : 24);
508 // We need stencil support for a few (minor) things.
509 if (!getenv("LL_GL_NO_STENCIL"))
510 SDL_GL_SetAttribute(SDL_GL_STENCIL_SIZE, 8);
506#else 511#else
507 // NOTE- use smaller Z-buffer to enable more graphics cards 512 // NOTE- use smaller Z-buffer to enable more graphics cards
508 // - This should not affect better GPUs and has been proven 513 // - This should not affect better GPUs and has been proven
@@ -585,6 +590,11 @@ BOOL LLWindowSDL::createContext(int x, int y, int width, int height, int bits, B
585 } 590 }
586 591
587 mWindow = SDL_SetVideoMode(width, height, bits, sdlflags | SDL_FULLSCREEN); 592 mWindow = SDL_SetVideoMode(width, height, bits, sdlflags | SDL_FULLSCREEN);
593 if (!mWindow && bits > 16)
594 {
595 SDL_GL_SetAttribute(SDL_GL_DEPTH_SIZE, 16);
596 mWindow = SDL_SetVideoMode(width, height, bits, sdlflags | SDL_FULLSCREEN);
597 }
588 598
589 if (mWindow) 599 if (mWindow)
590 { 600 {
@@ -627,6 +637,11 @@ BOOL LLWindowSDL::createContext(int x, int y, int width, int height, int bits, B
627 637
628 llinfos << "createContext: creating window " << width << "x" << height << "x" << bits << llendl; 638 llinfos << "createContext: creating window " << width << "x" << height << "x" << bits << llendl;
629 mWindow = SDL_SetVideoMode(width, height, bits, sdlflags); 639 mWindow = SDL_SetVideoMode(width, height, bits, sdlflags);
640 if (!mWindow && bits > 16)
641 {
642 SDL_GL_SetAttribute(SDL_GL_DEPTH_SIZE, 16);
643 mWindow = SDL_SetVideoMode(width, height, bits, sdlflags);
644 }
630 645
631 if (!mWindow) 646 if (!mWindow)
632 { 647 {
@@ -1985,7 +2000,7 @@ void LLWindowSDL::gatherInput()
1985 static Uint32 lastRightDown = 0; 2000 static Uint32 lastRightDown = 0;
1986 SDL_Event event; 2001 SDL_Event event;
1987 2002
1988#if LL_GTK && LL_LIBXUL_ENABLED 2003#if LL_GTK && LL_LLMOZLIB_ENABLED
1989 // Pump GTK events so embedded Gecko doesn't starve. 2004 // Pump GTK events so embedded Gecko doesn't starve.
1990 if (ll_try_gtk_init()) 2005 if (ll_try_gtk_init())
1991 { 2006 {
@@ -2004,7 +2019,7 @@ void LLWindowSDL::gatherInput()
2004 2019
2005 setlocale(LC_ALL, saved_locale.c_str() ); 2020 setlocale(LC_ALL, saved_locale.c_str() );
2006 } 2021 }
2007#endif // LL_GTK && LL_LIBXUL_ENABLED 2022#endif // LL_GTK && LL_LLMOZLIB_ENABLED
2008 2023
2009 // Handle all outstanding SDL events 2024 // Handle all outstanding SDL events
2010 while (SDL_PollEvent(&event)) 2025 while (SDL_PollEvent(&event))
@@ -2358,6 +2373,9 @@ void LLWindowSDL::initCursors()
2358 mSDLCursors[UI_CURSOR_TOOLBUY] = makeSDLCursorFromBMP("toolbuy.BMP",0,0); 2373 mSDLCursors[UI_CURSOR_TOOLBUY] = makeSDLCursorFromBMP("toolbuy.BMP",0,0);
2359 mSDLCursors[UI_CURSOR_TOOLPAY] = makeSDLCursorFromBMP("toolpay.BMP",0,0); 2374 mSDLCursors[UI_CURSOR_TOOLPAY] = makeSDLCursorFromBMP("toolpay.BMP",0,0);
2360 mSDLCursors[UI_CURSOR_TOOLOPEN] = makeSDLCursorFromBMP("toolopen.BMP",0,0); 2375 mSDLCursors[UI_CURSOR_TOOLOPEN] = makeSDLCursorFromBMP("toolopen.BMP",0,0);
2376 mSDLCursors[UI_CURSOR_TOOLPLAY] = makeSDLCursorFromBMP("toolplay.BMP",0,0);
2377 mSDLCursors[UI_CURSOR_TOOLPAUSE] = makeSDLCursorFromBMP("toolpause.BMP",0,0);
2378 mSDLCursors[UI_CURSOR_TOOLMEDIAOPEN] = makeSDLCursorFromBMP("toolmediaopen.BMP",0,0);
2361 mSDLCursors[UI_CURSOR_PIPETTE] = makeSDLCursorFromBMP("lltoolpipette.BMP",2,28); 2379 mSDLCursors[UI_CURSOR_PIPETTE] = makeSDLCursorFromBMP("lltoolpipette.BMP",2,28);
2362} 2380}
2363 2381
@@ -2744,20 +2762,27 @@ void spawn_web_browser(const char* escaped_url)
2744 2762
2745void *LLWindowSDL::getPlatformWindow() 2763void *LLWindowSDL::getPlatformWindow()
2746{ 2764{
2747#if LL_GTK && LL_LIBXUL_ENABLED 2765#if LL_GTK && LL_LLMOZLIB_ENABLED
2748 if (ll_try_gtk_init()) 2766 if (ll_try_gtk_init())
2749 { 2767 {
2750 maybe_lock_display(); 2768 maybe_lock_display();
2751 GtkWidget *win = gtk_window_new(GTK_WINDOW_TOPLEVEL);
2752 2769
2753 // show the hidden-widget while debugging (needs mozlib change) 2770 GtkWidget *owin = gtk_window_new(GTK_WINDOW_POPUP);
2754 //gtk_widget_show_all(GTK_WIDGET(win)); 2771 // Why a layout widget? A MozContainer would be ideal, but
2755 2772 // it involves exposing Mozilla headers to mozlib-using apps.
2756 gtk_widget_realize(GTK_WIDGET(win)); 2773 // A layout widget with a GtkWindow parent has the desired
2774 // properties of being plain GTK, having a window, and being
2775 // derived from a GtkContainer.
2776 GtkWidget *rtnw = gtk_layout_new(NULL, NULL);
2777 gtk_container_add(GTK_CONTAINER(owin), rtnw);
2778 gtk_widget_realize(rtnw);
2779 GTK_WIDGET_UNSET_FLAGS(GTK_WIDGET(rtnw), GTK_NO_WINDOW);
2780
2757 maybe_unlock_display(); 2781 maybe_unlock_display();
2758 return win; 2782
2783 return rtnw;
2759 } 2784 }
2760#endif // LL_GTK && LL_LIBXUL_ENABLED 2785#endif // LL_GTK && LL_LLMOZLIB_ENABLED
2761 // Unixoid mozilla really needs GTK. 2786 // Unixoid mozilla really needs GTK.
2762 return NULL; 2787 return NULL;
2763} 2788}