Conversation
This was referenced Sep 1, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
This removes the SWT/AWT embedding used by the visual signature positioning step and replaces the preview with a native SWT
Canvas.The change is intended to fix the Wayland-specific positioning failure tracked in:
Background
PDF-Over's main Linux UI already uses SWT/GTK, which can run as a native Wayland client. The positioning step was different: it created an
SWT.EMBEDDEDcomposite, calledSWT_AWT.new_Frame(...), and embedded a SwingJPanelfor the PDF preview/signature placement UI.That mixed SWT/AWT path depends on X11/XEmbed-style embedding and does not work correctly when the surrounding SWT/GTK shell is running natively on Wayland. The visible result is that step 2 (
Positionierung/Positioning) can stay grey and visual signature placement is not possible.The same embedding is also related to the existing fallback path in
PositioningState, which logs"Failed to create composite (probably a mac...)"and showserror.PositioningNotPossible("Manual positioning currently not possible due to a Java Bug. Using automatic positioning."). This change removes theSWT_AWTdependency from positioning, so that specific failure mode should no longer apply. I have not tested macOS, so the fallback path is left in place.Changes
Positioning Preview
SignaturePanelfrom SwingJPanelto SWTCanvas.PDFRenderer.BufferedImages to SWTImageDatausing the existingImageUtil.convertToSWT(...)helper.SWT.EMBEDDED/SWT_AWT.new_Frame(...)dependency from the positioning screen.Behaviour Changes Worth Reviewing
MOUSE_WHEEL_PAGE_THRESHOLD(3), which is one notch at the default "lines per scroll" setting. This replaces the old AWT workaround that de-duplicated wheel events by timestamp because they fired twice on Linux. Shift-wheel still jumps 5 pages.getShell().getMonitor()) instead of AWT'sToolkit.getScreenSize().Lifecycle and Correctness Fixes
PositioningCompositecaches theDisplayinstead of callingWidget.getDisplay()from worker-thread callbacks.PositioningState.closePDFDocument()now clears the viewer's document, synchronising with the render lock before closing thePDDocument, so a background render does not run against a closed document.Notes
The implementation still uses AWT classes for off-screen image processing and geometry where appropriate, such as
BufferedImageandPoint2D. It no longer creates or embeds AWT/Swing UI components for the positioning view.Validation
Tested manually on Linux aarch64 in a native Wayland session using
GDK_BACKEND=wayland:Not manually tested: X11, Windows, and macOS. The change uses portable SWT APIs and removes X11-specific SWT/AWT embedding from the positioning view, but I have not verified those platforms locally.
Also verified locally:
mvn -q -pl pdf-over-gui -am compile mvn -q test git diff --check upstream/main...HEAD