Merge viewer-lynx

master
Ansariel 2019-10-16 22:48:57 +02:00
commit 3789a192dc
11 changed files with 35 additions and 28 deletions

View File

@ -666,12 +666,14 @@ bool LLPluginClassMedia::keyEvent(EKeyEventType type, int key_code, MASK modifie
return result;
}
void LLPluginClassMedia::scrollEvent(int x, int y, MASK modifiers)
void LLPluginClassMedia::scrollEvent(int x, int y, int clicks_x, int clicks_y, MASK modifiers)
{
LLPluginMessage message(LLPLUGIN_MESSAGE_CLASS_MEDIA, "scroll_event");
message.setValueS32("x", x);
message.setValueS32("y", y);
message.setValueS32("clicks_x", clicks_x);
message.setValueS32("clicks_y", clicks_y);
message.setValue("modifiers", translateModifiers(modifiers));
sendMessage(message);

View File

@ -118,7 +118,7 @@ public:
bool keyEvent(EKeyEventType type, int key_code, MASK modifiers, LLSD native_key_data);
void scrollEvent(int x, int y, MASK modifiers);
void scrollEvent(int x, int y, int clicks_x, int clicks_y, MASK modifiers);
// enable/disable media plugin debugging messages and info spam
void enableMediaPluginDebugging( bool enable );

View File

@ -663,12 +663,18 @@ void MediaPluginCEF::receiveMessage(const char* message_string)
}
else if (message_name == "scroll_event")
{
S32 x = message_in.getValueS32("x");
S32 y = message_in.getValueS32("y");
// Mouse coordinates for cef to be able to scroll 'containers'
//S32 x = message_in.getValueS32("x");
//S32 y = message_in.getValueS32("y");
// Wheel's clicks
S32 delta_x = message_in.getValueS32("clicks_x");
S32 delta_y = message_in.getValueS32("clicks_y");
const int scaling_factor = 40;
y *= -scaling_factor;
delta_x *= -scaling_factor;
delta_y *= -scaling_factor;
mCEFLib->mouseWheel(x, y);
// mCEFLib->mouseWheel(x, y, delta_x, delta_y);
mCEFLib->mouseWheel(delta_x, delta_y);
}
else if (message_name == "text_event")
{

View File

@ -7551,7 +7551,7 @@
<key>Type</key>
<string>String</string>
<key>Value</key>
<string>https://secondlife-status.statuspage.io/history.atom</string>
<string>https://status.secondlifegrid.net/history.atom</string>
</map>
<key>GridStatusUpdateDelay</key>
<map>

View File

@ -40,7 +40,7 @@
std::map<std::string, std::string> LLFloaterGridStatus::sItemsMap;
// <FS:Ansariel> FIRE-21236 - Help Menu - Check Grid Status doesn't open using External Browser
//const std::string DEFAULT_GRID_STATUS_URL = "http://secondlife-status.statuspage.io/";
//const std::string DEFAULT_GRID_STATUS_URL = "http://status.secondlifegrid.net/";
LLFloaterGridStatus::LLFloaterGridStatus(const Params& key) :
LLFloaterWebContent(key),

View File

@ -35,7 +35,7 @@
class LLMediaCtrl;
// <FS:Ansariel> FIRE-21236 - Help Menu - Check Grid Status doesn't open using External Browser
const std::string DEFAULT_GRID_STATUS_URL = "http://secondlife-status.statuspage.io/";
const std::string DEFAULT_GRID_STATUS_URL = "http://status.secondlifegrid.net/";
class LLFloaterGridStatus :
public LLFloaterWebContent

View File

@ -202,7 +202,10 @@ BOOL LLMediaCtrl::handleScrollWheel( S32 x, S32 y, S32 clicks )
{
if (LLPanel::handleScrollWheel(x, y, clicks)) return TRUE;
if (mMediaSource && mMediaSource->hasMedia())
mMediaSource->getMediaPlugin()->scrollEvent(0, clicks, gKeyboard->currentMask(TRUE));
{
convertInputCoords(x, y);
mMediaSource->scrollWheel(x, y, 0, clicks, gKeyboard->currentMask(TRUE));
}
return TRUE;
}
@ -214,7 +217,8 @@ BOOL LLMediaCtrl::handleScrollHWheel(S32 x, S32 y, S32 clicks)
if (LLPanel::handleScrollHWheel(x, y, clicks)) return TRUE;
if (mMediaSource && mMediaSource->hasMedia())
{
mMediaSource->getMediaPlugin()->scrollEvent(clicks, 0, gKeyboard->currentMask(TRUE));
convertInputCoords(x, y);
mMediaSource->scrollWheel(x, y, clicks, 0, gKeyboard->currentMask(TRUE));
}
return TRUE;

View File

@ -547,17 +547,17 @@ void LLPanelPrimMediaControls::updateShape()
switch (mScrollState)
{
case SCROLL_UP:
media_impl->scrollWheel(0, -1, MASK_NONE);
media_impl->scrollWheel(0, 0, 0, -1, MASK_NONE);
break;
case SCROLL_DOWN:
media_impl->scrollWheel(0, 1, MASK_NONE);
media_impl->scrollWheel(0, 0, 0, 1, MASK_NONE);
break;
case SCROLL_LEFT:
media_impl->scrollWheel(1, 0, MASK_NONE);
media_impl->scrollWheel(0, 0, 1, 0, MASK_NONE);
// media_impl->handleKeyHere(KEY_LEFT, MASK_NONE);
break;
case SCROLL_RIGHT:
media_impl->scrollWheel(-1, 0, MASK_NONE);
media_impl->scrollWheel(0, 0, -1, 0, MASK_NONE);
// media_impl->handleKeyHere(KEY_RIGHT, MASK_NONE);
break;
case SCROLL_NONE:
@ -1136,7 +1136,7 @@ void LLPanelPrimMediaControls::onScrollUp(void* user_data)
if(impl)
{
impl->scrollWheel(0, -1, MASK_NONE);
impl->scrollWheel(0, 0, 0, -1, MASK_NONE);
}
}
void LLPanelPrimMediaControls::onScrollUpHeld(void* user_data)
@ -1153,7 +1153,7 @@ void LLPanelPrimMediaControls::onScrollRight(void* user_data)
if(impl)
{
impl->scrollWheel(-1, 0, MASK_NONE);
impl->scrollWheel(0, 0, -1, 0, MASK_NONE);
// impl->handleKeyHere(KEY_RIGHT, MASK_NONE);
}
}
@ -1172,7 +1172,7 @@ void LLPanelPrimMediaControls::onScrollLeft(void* user_data)
if(impl)
{
impl->scrollWheel(1, 0, MASK_NONE);
impl->scrollWheel(0, 0, 1, 0, MASK_NONE);
// impl->handleKeyHere(KEY_LEFT, MASK_NONE);
}
}
@ -1191,7 +1191,7 @@ void LLPanelPrimMediaControls::onScrollDown(void* user_data)
if(impl)
{
impl->scrollWheel(0, 1, MASK_NONE);
impl->scrollWheel(0, 0, 0, 1, MASK_NONE);
}
}
void LLPanelPrimMediaControls::onScrollDownHeld(void* user_data)

View File

@ -2373,14 +2373,14 @@ void LLViewerMediaImpl::mouseDoubleClick(S32 x, S32 y, MASK mask, S32 button)
}
//////////////////////////////////////////////////////////////////////////////////////////
void LLViewerMediaImpl::scrollWheel(S32 x, S32 y, MASK mask)
void LLViewerMediaImpl::scrollWheel(S32 x, S32 y, S32 scroll_x, S32 scroll_y, MASK mask)
{
scaleMouse(&x, &y);
mLastMouseX = x;
mLastMouseY = y;
if (mMediaSource)
{
mMediaSource->scrollEvent(x, y, mask);
mMediaSource->scrollEvent(x, y, scroll_x, scroll_y, mask);
}
}

View File

@ -229,7 +229,7 @@ public:
void mouseMove(const LLVector2& texture_coords, MASK mask);
void mouseDoubleClick(const LLVector2& texture_coords, MASK mask);
void mouseDoubleClick(S32 x, S32 y, MASK mask, S32 button = 0);
void scrollWheel(S32 x, S32 y, MASK mask);
void scrollWheel(S32 x, S32 y, S32 scroll_x, S32 scroll_y, MASK mask);
void mouseCapture();
void navigateBack();

View File

@ -377,12 +377,7 @@ BOOL LLViewerMediaFocus::handleScrollWheel(S32 x, S32 y, S32 clicks)
LLViewerMediaImpl* media_impl = getFocusedMediaImpl();
if(media_impl && media_impl->hasMedia())
{
// the scrollEvent() API's x and y are not the same as handleScrollWheel's x and y.
// The latter is the position of the mouse at the time of the event
// The former is the 'scroll amount' in x and y, respectively.
// All we have for 'scroll amount' here is 'clicks'.
// We're also not passed the keyboard modifier mask, but we can get that from gKeyboard.
media_impl->getMediaPlugin()->scrollEvent(0, clicks, gKeyboard->currentMask(TRUE));
media_impl->scrollWheel(x, y, 0, clicks, gKeyboard->currentMask(TRUE));
retval = TRUE;
}
return retval;