Skip to content
Snippets Groups Projects
Commit cf36b826 authored by Rye Mutt's avatar Rye Mutt :bread:
Browse files

Hook up more of the IME

parent 91f80f8b
No related branches found
No related tags found
No related merge requests found
......@@ -1665,7 +1665,6 @@ BOOL LLWindowSDL::SDLReallyCaptureInput(BOOL capture)
}
bool newGrab = wantGrab;
#if LL_X11
if (!mFullscreen) /* only bother if we're windowed anyway */
{
if (mSDL_Display)
......@@ -1696,7 +1695,6 @@ BOOL LLWindowSDL::SDLReallyCaptureInput(BOOL capture)
}
}
}
#endif // LL_X11
// pretend we got what we wanted, when really we don't care.
// return boolean success for whether we ended up in the desired state
......@@ -2730,6 +2728,48 @@ void LLWindowSDL::allowLanguageTextInput(LLPreeditor *preeditor, BOOL b)
}
}
void LLWindowSDL::updateLanguageTextInputArea()
{
if (mLanguageTextInputAllowed && mPreeditor)
{
LLCoordGL caret_coord;
LLRect preedit_bounds;
if (mPreeditor->getPreeditLocation(-1, &caret_coord, &preedit_bounds, NULL))
{
LLCoordWindow window_pos;
convertCoords(caret_coord, &window_pos);
SDL_Rect coords;
coords.x = window_pos.mX;
coords.y = window_pos.mY;
coords.w = preedit_bounds.getWidth() - coords.x;
coords.h = preedit_bounds.getHeight() - coords.y;
SDL_SetTextInputRect(&coords);
}
}
}
void LLWindowSDL::setLanguageTextInput( const LLCoordGL & pos )
{
if (mLanguageTextInputAllowed && mPreeditor)
{
LLCoordGL caret_coord;
LLRect preedit_bounds;
if (mPreeditor->getPreeditLocation(-1, &caret_coord, &preedit_bounds, NULL))
{
LLCoordWindow window_pos;
convertCoords(pos, &window_pos);
SDL_Rect coords;
coords.x = window_pos.mX;
coords.y = window_pos.mY;
coords.w = preedit_bounds.getWidth() - coords.x;
coords.h = preedit_bounds.getHeight() - coords.y;
SDL_SetTextInputRect(&coords);
}
}
}
//static
std::vector<std::string> LLWindowSDL::getDynamicFallbackFontList()
{
......
......@@ -31,6 +31,7 @@
#include "llwindow.h"
#include "lltimer.h"
#include "llpreeditor.h"
#ifndef SDL_MAIN_HANDLED
#define SDL_MAIN_HANDLED 1
......@@ -127,6 +128,8 @@ class LLWindowSDL final : public LLWindow
/*virtual*/ void bringToFront();
void allowLanguageTextInput(LLPreeditor *preeditor, BOOL b) override;
/*virtual*/ void updateLanguageTextInputArea() override;
/*virtual*/ void setLanguageTextInput( const LLCoordGL & pos ) override;
/*virtual*/ void spawnWebBrowser(const std::string& escaped_url, bool async);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment