On Tue, 30 Dec 2025 23:01:55 GMT, notzed <[email protected]> wrote:

>> As discussed on the mailing list.
>> 
>> OpenGL requires an explicit glFinish() to synchronise with the video 
>> refresh.  The current usage is incorrect and against the specification.  
>> This patch calls glFinish() after all windows have been drawn following a 
>> pulse.
>
> notzed has updated the pull request incrementally with one additional commit 
> since the last revision:
> 
>   Merge part of #1929, call glXSwapIntervalEXT in preference to 
> glXSwapIntervalSGI if available.

Hi,
I came across your changes while investigating an unrelated problem - a 
somewhat random SIGSEGV crash inside the native graphics driver, preceded by a 
BadAlloc error from glXMakeCurrent. I applied your patch to the 17u branch 
(which is what we currently work with) to see if by any chance it would help :)

With regards to my crash it did help, but in my application I noticed visible 
artifacts around menu items from a menu bar when hovering over those items. The 
items themselves were readable, but around the popup a different part of the 
main screen was shown, rotated and mirrored. So the graphics content between 
the main window and the popup was not completely separated. Sadly, I cannot 
share an image of the artifacts.

What helped in my case: 
https://github.com/openjdk/jfx/compare/master...tsx84:jfx:GLX_MakeCurrent_Bug

I figured that it might be necessary to invalidate the Java-side tracking of 
the current drawable after presenting, so that glContext.makeCurrent and 
glContext.bindFBO(0) are called reliably on the next createGraphics() call — 
while still avoiding the extra glXMakeCurrent call to the dummy drawable.

I did not test my fix combined with your other changes, just wanted to share my 
observation :)

Greetings

modules/javafx.graphics/src/main/java/com/sun/javafx/tk/quantum/PaintCollector.java
 line 444:

> 442:                 // swap on a per-window basis
> 443:                 gs.setDoPresent(true);
> 444:                 gs.setDoVSync(needsHint && dirtyScenes.getLast() == gs);

a minor note: maybe the compiler is clever enough to pull dirtyScenes.getLast() 
out of the loop, but I would to it explicitly

-------------

PR Comment: https://git.openjdk.org/jfx/pull/1981#issuecomment-4266681705
PR Review Comment: https://git.openjdk.org/jfx/pull/1981#discussion_r3099048079

Reply via email to