Skip to content

pdf-view-roll-minor-mode corrupts overlays (including highlight overlays) #345

@haji-ali

Description

@haji-ali

Describe the bug
One of the many issues that are seemingly fixed on @aikrahguzar fork, but not here, is that the overlays at position with window property get clobbered by pdf-roll.

Steps to Reproduce the behaviour
Tested on emacs 31.0.50

  1. Open a pdf
  2. Enable pdf-view-roll-minor-mode
  3. Select any text and scroll window with mouse scroll.
  4. Navigate to another buffer in the same window
  5. Select any text and see that the pdf image now appears in this unrelated buffer.

Additional context
The issue is that pdf-roll-display-image sets the display property of all overlays in position to the pdf image. What this means is that the highlight overlay at position (which happens to have the window property) also has its display property set to the pdf image. This overlay is window specific (being set in redisplay--update-region-highlight) and navigating to another buffer displays the same overlay with the pdf image.

I can see that the code is changed in the child-frame-preview fork to also condition on a cateogry being pdf-roll or similar (this is standard practice to avoid modifying unintended overlays).
Until this fix is merged, the pdf-roll remains unusable and very distruptive.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions