mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 1120358 - Part 1: Handle scroll position change that is not triggered by APZ. r=roc
This commit is contained in:
parent
5e51099400
commit
6660d30c24
@ -78,6 +78,7 @@ SelectionCarets::SelectionCarets(nsIPresShell* aPresShell)
|
||||
, mCaretCenterToDownPointOffsetY(0)
|
||||
, mDragMode(NONE)
|
||||
, mAsyncPanZoomEnabled(false)
|
||||
, mInAsyncPanZoomGesture(false)
|
||||
, mEndCaretVisible(false)
|
||||
, mStartCaretVisible(false)
|
||||
, mSelectionVisibleInScrollFrames(true)
|
||||
@ -1183,6 +1184,7 @@ DispatchScrollViewChangeEvent(nsIPresShell *aPresShell, const dom::ScrollState a
|
||||
void
|
||||
SelectionCarets::AsyncPanZoomStarted(const mozilla::CSSIntPoint aScrollPos)
|
||||
{
|
||||
mInAsyncPanZoomGesture = true;
|
||||
SetVisibility(false);
|
||||
|
||||
SELECTIONCARETS_LOG("Dispatch scroll started with position x=%d, y=%d",
|
||||
@ -1193,6 +1195,7 @@ SelectionCarets::AsyncPanZoomStarted(const mozilla::CSSIntPoint aScrollPos)
|
||||
void
|
||||
SelectionCarets::AsyncPanZoomStopped(const mozilla::CSSIntPoint aScrollPos)
|
||||
{
|
||||
mInAsyncPanZoomGesture = false;
|
||||
SELECTIONCARETS_LOG("Update selection carets after APZ is stopped!");
|
||||
UpdateSelectionCarets();
|
||||
|
||||
@ -1209,12 +1212,20 @@ SelectionCarets::AsyncPanZoomStopped(const mozilla::CSSIntPoint aScrollPos)
|
||||
void
|
||||
SelectionCarets::ScrollPositionChanged()
|
||||
{
|
||||
if (!mAsyncPanZoomEnabled && mVisible) {
|
||||
SetVisibility(false);
|
||||
//TODO: handling scrolling for selection bubble when APZ is off
|
||||
if (mVisible) {
|
||||
if (!mAsyncPanZoomEnabled) {
|
||||
SetVisibility(false);
|
||||
//TODO: handling scrolling for selection bubble when APZ is off
|
||||
|
||||
SELECTIONCARETS_LOG("Launch scroll end detector");
|
||||
LaunchScrollEndDetector();
|
||||
SELECTIONCARETS_LOG("Launch scroll end detector");
|
||||
LaunchScrollEndDetector();
|
||||
} else {
|
||||
if (!mInAsyncPanZoomGesture) {
|
||||
UpdateSelectionCarets();
|
||||
DispatchSelectionStateChangedEvent(GetSelection(),
|
||||
SelectionState::Updateposition);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -260,6 +260,8 @@ private:
|
||||
|
||||
// True if AsyncPanZoom is enabled
|
||||
bool mAsyncPanZoomEnabled;
|
||||
// True if AsyncPanZoom is started
|
||||
bool mInAsyncPanZoomGesture;
|
||||
|
||||
bool mEndCaretVisible;
|
||||
bool mStartCaretVisible;
|
||||
|
Loading…
Reference in New Issue
Block a user