RSyntaxTextArea Display and Cursor Behavior During Cross-Monitor Usage
Description When using an RSyntaxTextArea-based editor on a multi-monitor setup with different scaling factors, we observe significant rendering anomalies and cursor behavior issues:
Text Rendering Artifacts: When moving the editor window from a laptop display (125% scaling) to a secondary desktop monitor (100% scaling), SQL keywords scale appropriately but punctuation marks fail to reposition correctly. This causes overlapping where punctuation collides with adjacent words in the same line.
Selection Rendering Failure: Partial text selection becomes visually corrupted during cross-monitor transitions. Selected character ranges display erratically with improper highlighting boundaries.
Cursor Positioning Errors: The text cursor frequently renders directly over characters instead of maintaining its position between them. This ambiguous placement makes it impossible to determine whether:
The cursor is positioned before a character
The character itself is selected
The cursor is positioned after the character
Cursor Shape Inconsistency: The cursor intermittently switches to a hollow (unfilled) rectangle shape instead of maintaining the standard solid vertical bar indicator during these display transitions.
Java version jdk17
@outlier922 - sorry for the late reply, I haven't worked on this project for awhile due to difficulties publishing updated artifacts. I hope to take another look shortly.
Can you clarify these points for me (I can't reproduce immediatley)?
- this only happens if each monitor has a different scaling applied?
- Do the issues correct themselves after e.g. a window resize, or minimize/maximize? I assume not but want to confirm
- Do these issues not occur with a standard JTextArea?
- Does rendering always work correctly if you stay in the "starting" monitor, even if it's the 125% scaled one? (to confirm if it's just scaled displays in general that it's broken for, or if it's the swap from one scaling to another)
- Shot in the dark, but if you use the java-11 branch, does the issue persist? This is a major update to use the newer subpixel APIs, but it may still have the same, or similar issues