diff options
author | Steven Bennetts <steve@lindenlab.com> | 2008-08-12 17:29:50 +0000 |
---|---|---|
committer | Steven Bennetts <steve@lindenlab.com> | 2008-08-12 17:29:50 +0000 |
commit | 80be4c1d2d73982ea2df6dd7ef3fc3465416c882 (patch) | |
tree | 9c5958572368be494b6302db8b03967a2c67b7ad /indra/llwindow | |
parent | a09f7d41efdb945755efaeb07f7418c1f6e2a78b (diff) |
QAR-767 Combined maint-render-7 and maint-viewer-9 merge
merge release@93398 viewer-merge-1@94007 -> release
dataserver-is-deprecated
Diffstat (limited to 'indra/llwindow')
-rw-r--r-- | indra/llwindow/llmousehandler.h | 7 | ||||
-rw-r--r-- | indra/llwindow/llwindow.cpp | 6 | ||||
-rw-r--r-- | indra/llwindow/llwindow.h | 5 | ||||
-rw-r--r-- | indra/llwindow/llwindowmacosx.cpp | 28 | ||||
-rw-r--r-- | indra/llwindow/llwindowmacosx.h | 3 | ||||
-rw-r--r-- | indra/llwindow/llwindowsdl.cpp | 6 |
6 files changed, 43 insertions, 12 deletions
diff --git a/indra/llwindow/llmousehandler.h b/indra/llwindow/llmousehandler.h index 6fbdbe3c3e..3ede7e7830 100644 --- a/indra/llwindow/llmousehandler.h +++ b/indra/llwindow/llmousehandler.h @@ -43,7 +43,11 @@ class LLMouseHandler public: LLMouseHandler() {} virtual ~LLMouseHandler() {} - + typedef enum { + SHOW_NEVER, + SHOW_IF_NOT_BLOCKED, + SHOW_ALWAYS, + } EShowToolTip; virtual BOOL handleMouseDown(S32 x, S32 y, MASK mask) = 0; virtual BOOL handleMouseUp(S32 x, S32 y, MASK mask) = 0; virtual BOOL handleHover(S32 x, S32 y, MASK mask) = 0; @@ -52,6 +56,7 @@ public: virtual BOOL handleRightMouseDown(S32 x, S32 y, MASK mask) = 0; virtual BOOL handleRightMouseUp(S32 x, S32 y, MASK mask) = 0; virtual BOOL handleToolTip(S32 x, S32 y, std::string& msg, LLRect* sticky_rect_screen) = 0; + virtual EShowToolTip getShowToolTip() { return SHOW_IF_NOT_BLOCKED; }; virtual const std::string& getName() const = 0; virtual void onMouseCaptureLost() = 0; diff --git a/indra/llwindow/llwindow.cpp b/indra/llwindow/llwindow.cpp index 5f46b36c68..6b1cabc505 100644 --- a/indra/llwindow/llwindow.cpp +++ b/indra/llwindow/llwindow.cpp @@ -285,6 +285,12 @@ void LLWindow::setCallbacks(LLWindowCallbacks *callbacks) } } +void *LLWindow::getMediaWindow() +{ + // Default to returning the platform window. + return getPlatformWindow(); +} + // static std::string LLWindow::getFontListSans() { diff --git a/indra/llwindow/llwindow.h b/indra/llwindow/llwindow.h index 84ea9755fd..ec09234c83 100644 --- a/indra/llwindow/llwindow.h +++ b/indra/llwindow/llwindow.h @@ -219,8 +219,11 @@ public: // opens system default color picker virtual BOOL dialog_color_picker (F32 *r, F32 *g, F32 *b) { return FALSE; }; -// return a platform-specific window reference (HWND on Windows, WindowRef on the Mac) +// return a platform-specific window reference (HWND on Windows, WindowRef on the Mac, Gtk window on Linux) virtual void *getPlatformWindow() = 0; + +// return the platform-specific window reference we use to initialize llmozlib (HWND on Windows, WindowRef on the Mac, Gtk window on Linux) + virtual void *getMediaWindow(); // control platform's Language Text Input mechanisms. virtual void allowLanguageTextInput(LLPreeditor *preeditor, BOOL b) {} diff --git a/indra/llwindow/llwindowmacosx.cpp b/indra/llwindow/llwindowmacosx.cpp index df3fb2e240..72623a17f2 100644 --- a/indra/llwindow/llwindowmacosx.cpp +++ b/indra/llwindow/llwindowmacosx.cpp @@ -61,6 +61,7 @@ const S32 MAX_NUM_RESOLUTIONS = 32; // BOOL LLWindowMacOSX::sUseMultGL = FALSE; +WindowRef LLWindowMacOSX::sMediaWindow = NULL; // Cross-platform bits: @@ -3201,22 +3202,31 @@ BOOL LLWindowMacOSX::dialog_color_picker ( F32 *r, F32 *g, F32 *b) return (retval); } -static WindowRef dummywindowref = NULL; void *LLWindowMacOSX::getPlatformWindow() { - if(mWindow != NULL) - return (void*)mWindow; + // NOTE: this will be NULL in fullscreen mode. Plan accordingly. + return (void*)mWindow; +} + +void *LLWindowMacOSX::getMediaWindow() +{ + /* + Mozilla needs to be initialized with a WindowRef to function properly. + (There's no good reason for this, since it shouldn't be interacting with our window in any way, but that's another issue.) + If we're in windowed mode, we _could_ hand it our actual window pointer, but a subsequent switch to fullscreen will destroy that window, + which trips up Mozilla. + Instead of using our actual window, we create an invisible window which will persist for the lifetime of the application and pass that to Mozilla. + This satisfies its deep-seated need to latch onto a WindowRef and solves the issue with switching between fullscreen and windowed modes. - // If we're in fullscreen mode, there's no window pointer available. - // Since Mozilla needs one to function, create a dummy window here. - // Note that we will never destroy it, but since only one will be created per run of the application, that's okay. + Note that we will never destroy this window (by design!), but since only one will ever be created per run of the application, that's okay. + */ - if(dummywindowref == NULL) + if(sMediaWindow == NULL) { Rect window_rect = {100, 100, 200, 200}; - dummywindowref = NewCWindow( + sMediaWindow = NewCWindow( NULL, &window_rect, (ConstStr255Param) "\p", @@ -3227,7 +3237,7 @@ void *LLWindowMacOSX::getPlatformWindow() 0); } - return (void*)dummywindowref; + return (void*)sMediaWindow; } void LLWindowMacOSX::stopDockTileBounce() diff --git a/indra/llwindow/llwindowmacosx.h b/indra/llwindow/llwindowmacosx.h index 10955b1288..24cdb54a9e 100644 --- a/indra/llwindow/llwindowmacosx.h +++ b/indra/llwindow/llwindowmacosx.h @@ -105,6 +105,7 @@ public: /*virtual*/ BOOL dialog_color_picker(F32 *r, F32 *g, F32 *b); /*virtual*/ void *getPlatformWindow(); + /*virtual*/ void *getMediaWindow(); /*virtual*/ void bringToFront() {}; /*virtual*/ void allowLanguageTextInput(LLPreeditor *preeditor, BOOL b); @@ -201,6 +202,8 @@ protected: static BOOL sUseMultGL; friend class LLWindowManager; + static WindowRef sMediaWindow; + }; diff --git a/indra/llwindow/llwindowsdl.cpp b/indra/llwindow/llwindowsdl.cpp index 42a9144d58..e2d114245d 100644 --- a/indra/llwindow/llwindowsdl.cpp +++ b/indra/llwindow/llwindowsdl.cpp @@ -2830,14 +2830,18 @@ std::string LLWindowSDL::getFontListSans() { if (success >= 2 && locale->lang) // confident! { + LL_INFOS("AppInit") << "Language " << locale->lang << LL_ENDL; + LL_INFOS("AppInit") << "Location " << locale->country << LL_ENDL; + LL_INFOS("AppInit") << "Variant " << locale->variant << LL_ENDL; + llinfos << "Preferring fonts of language: " << locale->lang << llendl; sort_order = "lang=" + std::string(locale->lang) + ":" + sort_order; } - FL_FreeLocale(&locale); } + FL_FreeLocale(&locale); if (!FcInit()) { |