On Sun, 14 Jun 2026 14:47:51 GMT, Michael Strauß <[email protected]> wrote:

>> Thiago Milczarek Sayao has updated the pull request with a new target base 
>> due to a merge or a rebase. The pull request now contains 39 commits:
>> 
>>  - Remove configurable delays
>>  - Fix test
>>  - Xorg fixes
>>  - Revert "Rewrite WrongStageFocusWithApplicationModalityTest because it 
>> fails intermittently"
>>    
>>    This reverts commit c6b9dd745e5d762adb89a3b596e53b0d8a790d7f.
>>  - Rewrite WrongStageFocusWithApplicationModalityTest because it fails 
>> intermittently
>>  - Use existing verbose flag for GTK
>>  - Fix window size update
>>  - StageOwnershipTest: Update Y_DELTA
>>  - Copyright year
>>  - Merge branch 'master' into 8354943_v2
>>  - ... and 29 more: https://git.openjdk.org/jfx/compare/b690b3c4...68d684f9
>
> modules/javafx.graphics/src/main/native-glass/gtk/glass_window.cpp line 803:
> 
>> 801: 
>> 802:     if (gdk_cursor) {
>> 803:         g_object_unref(gdk_cursor);
> 
> The `gdk_cursor` field is unref'd here and in the destructor of 
> `WindowContext`, but `_setCustomCursor()` passes in a cursor owned by 
> `com.sun.glass.ui.Cursor` on the Java side. This may potentially destroy a 
> cursor that is still used on the Java side. If `WindowContext` needs to 
> participate in refcounting, it should probably take its own `g_object_ref()` 
> for incoming cursors.

Looking at the GTK code, `gdk_window_set_cursor()` already unreferences the 
currently assigned cursor, so I removed the explicit unref. The custom cursor 
unref was causing a crash.

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

PR Review Comment: https://git.openjdk.org/jfx/pull/2139#discussion_r3410018576

Reply via email to