RSyntaxTextArea icon indicating copy to clipboard operation
RSyntaxTextArea copied to clipboard

RSyntaxTextArea Display and Cursor Behavior During Cross-Monitor Usage

Open outlier922 opened this issue 7 months ago • 1 comments

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 avatar Aug 04 '25 02:08 outlier922

@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)?

  1. this only happens if each monitor has a different scaling applied?
  2. Do the issues correct themselves after e.g. a window resize, or minimize/maximize? I assume not but want to confirm
  3. Do these issues not occur with a standard JTextArea?
  4. 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)
  5. 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

bobbylight avatar Dec 06 '25 20:12 bobbylight