Skip to content

Sync from Fork repo#8

Open
venkatareddyboya-highspot wants to merge 827 commits into
highspot:v1.1.11-windowsfrom
espresso3389:master
Open

Sync from Fork repo#8
venkatareddyboya-highspot wants to merge 827 commits into
highspot:v1.1.11-windowsfrom
espresso3389:master

Conversation

@venkatareddyboya-highspot

Copy link
Copy Markdown
Collaborator

No description provided.

espresso3389 and others added 30 commits June 11, 2026 00:48
Remove ffi and move http to dev_dependencies in pdfrx
Fix inverted guard in selectAllText() causing null dereference
Fix PDFium initialization flag set in the wrong isolate
The text selection GestureDetector used the default DragStartBehavior.start,
so onPanStart reported the post-slop position (~kTouchSlop, 18px). Free
text-drag selection therefore began 1-2 characters after the touch-down on
touch devices (notably iPad/tablets), skipping the first character(s).

Setting dragStartBehavior: DragStartBehavior.down makes onPanStart report the
original pointer-down position, so selection starts exactly where the user
pressed.
fix: use DragStartBehavior.down for free text-drag selection (off-by-slop start anchor on touch)
Bumps [actions/setup-java](https://github.com/actions/setup-java) from 5.2.0 to 5.3.0.
- [Release notes](https://github.com/actions/setup-java/releases)
- [Commits](actions/setup-java@be666c2...ad2b381)

---
updated-dependencies:
- dependency-name: actions/setup-java
  dependency-version: 5.3.0
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Bumps [softprops/action-gh-release](https://github.com/softprops/action-gh-release) from 3.0.0 to 3.0.1.
- [Release notes](https://github.com/softprops/action-gh-release/releases)
- [Changelog](https://github.com/softprops/action-gh-release/blob/master/CHANGELOG.md)
- [Commits](softprops/action-gh-release@b430933...718ea10)

---
updated-dependencies:
- dependency-name: softprops/action-gh-release
  dependency-version: 3.0.1
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Bumps [actions/checkout](https://github.com/actions/checkout) from 6.0.3 to 7.0.0.
- [Release notes](https://github.com/actions/checkout/releases)
- [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md)
- [Commits](actions/checkout@df4cb1c...9c091bb)

---
updated-dependencies:
- dependency-name: actions/checkout
  dependency-version: 7.0.0
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
…ctions/setup-java-5.3.0

Bump actions/setup-java from 5.2.0 to 5.3.0
…oftprops/action-gh-release-3.0.1

Bump softprops/action-gh-release from 3.0.0 to 3.0.1
…ctions/checkout-7.0.0

Bump actions/checkout from 6.0.3 to 7.0.0
Bumps [actions/setup-java](https://github.com/actions/setup-java) from 5.3.0 to 5.4.0.
- [Release notes](https://github.com/actions/setup-java/releases)
- [Commits](actions/setup-java@ad2b381...1bcf9fb)

---
updated-dependencies:
- dependency-name: actions/setup-java
  dependency-version: 5.4.0
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
…ctions/setup-java-5.4.0

Bump actions/setup-java from 5.3.0 to 5.4.0
PDFium inserts zero-width generated spaces to represent large gaps
between text runs sharing the same baseline (e.g. table column gaps).
PdfTextFormatter interpolated the space rect between the surrounding
characters, so a single selectable space could cover the entire gap
(~180pt measured on a real table PDF), causing drag selection to
highlight the whole gap and jump across it at once.

Clamp the combined space rect to 1.5x the line height (line width for
vertical text), keeping it attached to the preceding character.
Follow-up to the previous clamp: a generated space (degenerate
point char box) still produced a visible 1.5x-line-height tail
after the preceding word, so selecting a word next to a table
column gap looked like it selected extra blank space.

Distinguish generated spaces (all char boxes degenerate) from real
space glyphs: generated spaces are clamped to 0.25x line height
(~a typical space advance), real spaces keep spanning their gap up
to the existing 1.5x line height limit.
The widgets returned by _placeTextSelectionWidgets (anchor handles,
magnifier, context menu) are keyless Positioned/AnimatedPositioned
siblings. When selection handles appear or disappear while the context
menu is visible (e.g. an app hot-swaps
textSelectionParams.enableSelectionHandles after a selection settles),
keyless index matching updates the old context menu slot into an anchor
handle, unmounting and re-inflating the context menu subtree. A stateful
context menu (async dictionary popup etc.) then loses its state and
visibly flickers/reloads.

Give each of the four children a stable key so Flutter reconciles them
by key and the context menu element survives sibling insertions.
…pstream

fix: clamp generated space rects to avoid huge selectable gaps (table column gaps)
fix: key text selection stack children to avoid context menu remount
_loadTextAsync defers work into a synchronized() closure; if the
document is unloaded or replaced before the queued closure runs,
the closure dereferences _document! and throws
"Null check operator used on a null value".

Guard _document (and the page index, in case the document was
swapped for one with fewer pages) in both _loadTextAsync and
_getCachedTextOrDelayLoadText, and re-check inside the queued
closure where the original race occurs.

Stack trace observed in production (pdfrx 2.2.24, Android arm64):

  #0 _PdfViewerState._loadTextAsync.<closure> (pdf_viewer.dart:1425)
  #1 objectSynchronized.<closure> (synchronized/extension_impl.dart:37)
  #2 BasicLock.synchronized (synchronized/basic_lock.dart:36)
  #4 _PdfViewerState._loadTextAsync (pdf_viewer.dart:1423)

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Fix null check crash in _loadTextAsync when document is unloaded
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.