Skip to content

Upstream child frame preview#338

Open
aikrahguzar wants to merge 93 commits intovedang:masterfrom
aikrahguzar:upstream-child-frame-preview
Open

Upstream child frame preview#338
aikrahguzar wants to merge 93 commits intovedang:masterfrom
aikrahguzar:upstream-child-frame-preview

Conversation

@aikrahguzar
Copy link
Copy Markdown
Contributor

@vedang I am opening the pr as you asked me to. However, I am not sure how to present it in a good way relative to the current master. I can't rebase it since all the commits that were on the upstream-pdf-roll are also here. If you know what git incantations can make the situation better, please let me know.

I will also mark this PR as draft since some changes beyong 7e6c74e need a discussion.

@haji-ali
Copy link
Copy Markdown

haji-ali commented Feb 5, 2026

To rebase correctly (assuming all commits up to b2a4fd2 "Be more defensive during pre-redisplay" were already merged into master), you do

git rebase --onto master b2a4fd2^

@aikrahguzar
Copy link
Copy Markdown
Contributor Author

To rebase correctly (assuming all commits up to b2a4fd2 "Be more defensive during pre-redisplay" were already merged into master), you do

git rebase --onto master b2a4fd2^

I tried this but this gives me a lot of conflicts. Is there a way to tell git that the end result should be what is in the branch of this pr?

When `pdf-view-roll-minor-mode` is active, narrow to page is taken
to mean narrow to visible pages
Also allow following the link being previewed by pressing f.
Plus store link and link id in frame parameters.
pdf-view-current-slice can now be a function which accepts
a page number and returns the slice to use.

pdf-view-auto-slice-minor-mode set it to such a function.
Since pdf-info-gettext use ipc, other process filters
might run during the the time the text is obtained, and get
tripped by narrowing. So we restrict narrowing to the
smallest body possible.
Bug reported by Visuwesh <visuweshm@gmail.com>
Also disable tooltip if the child frame preview activates.
Previously this caused preview not to close.
Rahguzar and others added 21 commits February 6, 2026 10:16
This ensures that we don't use lot of memory in
scenarios such as the following:
1) Scrolling through lot of pages
2) Frequent reverting e.g. when writing a TeX documents
3) Frequent change of buffers

I have seen image cache grow as large as 5-6 gb in such
circumstances.

For me this change doesn't seems to impact performance
while it reduces memory pressure. However, this might not
be the universal experience so this change might be
revisited in the future.
This is a bit too involved since finding the dimension of the
displayed image is a bit complicated in this case.

I would like this to be possible since this means that buffers
that are being displayed in a non-current tab can be bookmarked
but that requires a bit more thought.

The current approach resulted in errors for non-current tabs.
Take into account the part of the page above the window
and avoid errors if mouse goes outside the frame.
We don't need it and for some reason it is slow enough that
it shows up on profiles during scrolling
It is expensive and causes stutter during scrolling
When there are no hotspots it causes error. So we just set
it to hotspots which is wrong but with  pdf-tools it should
not be used anyway.
@aikrahguzar aikrahguzar force-pushed the upstream-child-frame-preview branch from fdce212 to 8ba82ee Compare February 6, 2026 05:17
@aikrahguzar
Copy link
Copy Markdown
Contributor Author

I have now reverted the changes that tried to aggressively flush the images in order to conserve memory. So, this branch now only includes fixes to the pdf-roll and new features:

  1. A child-frame based preview for links.
  2. Improvement to forward and backward sync.

I am now removing the draft status.

@aikrahguzar aikrahguzar marked this pull request as ready for review February 13, 2026 10:19
This reverts commits:

Don't try to flush when there is no image
8b5350c

Flush previous images without pdf-roll too
eee10f1

Aggressively flush images
0ee3bbc

Don't create image when caching image data
4452e4b

From 0ee3bbc
the change to pdf-roll-displayed-pages is not reverted,
since it is needed for pdf-view-displayed-pages to
work correctly.
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.

2 participants