Commit Graph

87973 Commits

Author SHA1 Message Date
Vitaly Provodin
1ce356a296 update exclude list on results of main.3839 test runs 2025-12-06 01:03:50 +01:00
Maxim Kartashev
e1a7d9ea65 JBR-9730 Wayland: to add a secondary expression in assertions 2025-12-06 01:03:50 +01:00
Maxim Kartashev
682558af02 JBR-9733 Wayland: enable unconstrained popup positioning
Use getRootPane()
.putClientProperty("wlawt.popup_position_unconstrained", Boolean.TRUE)
to enable unconstrained popup positioning.
2025-12-06 01:03:49 +01:00
Anton Shangareev
2a88cbe4cf JBR-8947 Reimplement CArrayUtils in a MSVC-compatible way 2025-12-06 01:03:49 +01:00
Anton Shangareev
4a6ca52fc9 Fix incorrect use of 'inline' in place of 'static'/'static inline' in some C files 2025-12-06 01:03:49 +01:00
Anton Shangareev
a7714f7369 Fix stray unsigned comparison warning 2025-12-06 01:03:49 +01:00
Maxim Kartashev
ce17ffe26f JBR-9728 Wayland: AssertionError in WLGraphicsDevice. 2025-12-06 01:03:49 +01:00
Maxim Kartashev
ed768386ab JBR-9727 Wayland: assertion error in ShadowImpl.updateSurfaceData 2025-12-06 01:03:49 +01:00
Nikita Tsarev
5f3db1e190 JBR-9483 Wayland: Support toplevel icons
This patch implements support for the xdg_toplevel_icon_v1 protocol.
The image choosing logic is just to pick the largest square image for
now. The image scale factor is also not set, since it's unclear if it's
needed and how it interacts with multi-monitor setups.

NOTE: this patch introduces a dependency on wayland-protocols 1.37+.
2025-12-06 01:03:49 +01:00
Nikita Provotorov
c17ffe0e22 JBR-9719: Wayland: input methods in Speed search don't work if WLInputMethodZwpTextInputV3 logger is enabled
Resetting the text iterator of each InputMethodEvent after it gets logged.

(cherry picked from commit 3355214b43)
2025-12-06 01:03:49 +01:00
Maxim Kartashev
2e68c254c4 Revert "JBR-9301 Vulkan: SwingSet2 crash window server"
This reverts commit 7d3c3b33b8.
2025-12-06 01:03:49 +01:00
Maxim Kartashev
082b4e9597 Revert "JBR-9503 Wayland: IDE frame disappears after click on 'Cancel'"
This reverts commit f25d35abec.
2025-12-06 01:03:49 +01:00
Vitaly Provodin
85a7834cfd update exclude list on results of main.3838 test runs 2025-12-06 01:03:49 +01:00
Nikita Tsarev
631f1c3949 JBR-9699 Build with newer wayland-protocols
Updates the CI build scripts to look for wayland protocols in
/opt/wayland-protocols
2025-12-06 01:03:48 +01:00
Maxim Kartashev
7566699bf5 JBR-9698 Wayland: session auto-detection doesn't work with binary launcher 2025-12-06 01:03:48 +01:00
Vladimir Lagunov
5fa04d3671 JBR-9531 Prevent unexpected recursive usage of java.io over nio wrappers
Shortly said, we don't need to handle recursive invocations of the `java.io` to nio adapters, while this recursion leads to problems.

# Problem 

Since we're not allowed to modify public API of Java classes, an unreliable workaround `IoOverNio.PARENT_FOR_FILE_CHANNEL_IMPL` had been introduced. This trick lets us pass some object into a called function without adding a new function argument.

The trick backfired at the following code:

```java
// at java.base/java.io.IoOverNioFileSystem.initializeStreamUsingNio (simplified code)
IoOverNio.PARENT_FOR_FILE_CHANNEL_IMPL.set(owner);
return initializeStreamsUsingNio0(owner, nioFs, file, nioPath, optionsForChannel, channelCleanable);


// at java.base/java.io.IoOverNioFileSystem.initializeStreamsUsingNio0
channel = nioFs.provider().newFileChannel(nioPath, optionsForChannel);
```

The intention of setting `PARENT_FOR_FILE_CHANNEL_IMPL` is to path `owner` inside a constructor of `sun.nio.ch.FileChannelImpl` which may be called by `newFileChannel(nioPath, optionsForChannel)`.

The implementation of `newFileChannel` in IntelliJ triggered class loading. The classloader of IntelliJ triggered the call `java.nio.file.Files.readAllBytes`. The latter code also invoked the constructor of `FileChannelImpl`, and the constructor got from the thread-local variable the value for the field `parent`. That value was supposed to be passed to a different invocation of the constructor.

The observable result of this bug was a `NullPointerExceptions` from `java.io.FileOutputStream.close`. Hypothetically, this bug could also lead to closing file descriptors earlier as expected in other unpredictable places.

# Rejected approaches

* The cleanest solution could be passing specific function arguments through function arguments. 
  
  However, we may neither create a new public function in the module `java.base`, nor add an argument to an existing one. Thus, we have to keep dealing with thread-local variables.
* To hold several values in the thread-local variable. 

  In this case, the constructor of `FileChannelImpl` should somehow choose the right value from the list. The only possible way for filtering values is by the provided path. It doesn't look like a performant and reliable solution.
 
# Chosen solution
 
This commit disables recursive invocations of `java.io` from `java.nio` adapters.
  
The chosen solution is tied to specifics of IntelliJ. The reason for introducing java.io over java.nio adapter was to be able to access files from remote machines without rewriting old code. It is not expected that an implementation of `java.nio.file.spi.FileSystemProvider` accesses the file system using `java.io`. The only imaginable way to get a `java.io` call from `java.nio` is class loading. In case of IntelliJ, it's assumed that the class loader never accesses classes and jars from a remote machine.
2025-12-06 01:03:48 +01:00
Maxim Kartashev
288c6cd6ac JBR-9672 Wayland: popup focus broken in Plasma 6.5.2, with Focus Stealing prevention >= Medium 2025-12-06 01:03:48 +01:00
Maxim Kartashev
b9d03f68c4 JBR-9656 Wayland: toFront() does not work on KDE Plasma 6.5.2
KWin does not accept the serial number from a "keyboard enter" event in
a window activation request, while a recent input event serial is OK.
Gnome, however, requires the "keyboard enter" event serial.
2025-12-06 01:03:48 +01:00
Vitaly Provodin
4ecc121a64 Update README.md 2025-12-06 01:03:48 +01:00
Maxim Kartashev
dcec46b442 JBR-6187 Wayland: implement server-side decoration support
Use -Dsun.awt.wl.WindowDecorationStyle=server to activate
2025-12-06 01:03:48 +01:00
Nikita Tsarev
93db525803 JBR-9642 Wayland: Call wl_data_offer.finish()
This patch adds a call to wl_data_offer.finish() upon a successful
completion of a drag-and-drop operation, as well as more synchronized
annotations in WLDataOffer, to match the existing ones.

Calling finish() doesn't seem to be required by most compositors when
performing drag-and-drop, at least within the same window. Other
toolkits, such as Qt, only call it when dealing with cross-application
drag-and-drop. In the interest of maximal compatibility, this patch
implements calling finish() always when a drag-and-drop operation
succeeds.
2025-12-06 01:03:48 +01:00
Nikita Tsarev
0157189e36 JBR-9591 Wayland: Fix wrong DnD action on KWin
This patch implements a workaround for a bug that exists on KWin 6.5. For
some reason, KWin sends a wl_data_source.action(0) event immediately
after wl_data_source.dnd_drop_finished(). This makes the drag source
think that the DnD operation failed, even though it succeeded.
The workaround it to ignore the wl_data_source.action() events
after a successful wl_data_source.dnd_drop_finished()

In addition to this, this patch also fixes some inconsistency with
translating between AWT and Wayland DnD operation masks. This doesn't
have any visible effect though, since the mask values happen to be the
same.
2025-12-06 01:03:48 +01:00
Vitaly Provodin
23febad80e JBR-9637 revert test/jdk changes made in 8370344, 8371315, 8371474 2025-12-06 01:03:48 +01:00
Maxim Kartashev
24f5af205b JBR-9577 Extra info on JVM crash to the terminal 2025-12-06 01:03:48 +01:00
Dmitry Drobotov
511efb0b42 JBR-9580 Fix crash in [MenuAccessibility accessibilityChildren]
* Add null checks for variables that can have null values to prevent hard crash
* Add missing CHECK_EXCEPTION after JNI call
* Add missing DeleteLocalRef for axComponent

(cherry picked from commit 96fcd9e591)
2025-12-06 01:03:47 +01:00
Alexey Ushakov
1fde6c7cc0 JBR-9612 Update fontconfigmanager.c with upstream changes in fontpath.c
Applied changes from JDK-8357252
2025-12-06 01:03:47 +01:00
bourgesl
ecd99e1765 JBR-9609 JBR Metal compilation error on Intel MacBooks
Wrapped MTLDrawable.drawableID usages in getDrawableId to check macOS version
2025-12-06 01:03:47 +01:00
Maxim Kartashev
6eff797dbc JBR-9598 Wayland: auto-detect Wayland session at startup
Adds -Dawt.toolkit.name=auto to prefer WLToolkit over XToolkit when
available. The default is still XToolkit.
2025-12-06 01:03:47 +01:00
Sergey Shelomentsev
cb9880fa8c JBR-9610 Set TimerQueue thread exclusion for BugJBR9563.java 2025-12-06 01:03:47 +01:00
Maxim Kartashev
25532ba2f9 JBR-5989 Wayland: added more tests to jdk_awt_wayland 2025-12-06 01:03:47 +01:00
Maxim Kartashev
bfdf23a972 JBR-9608 Correct README.md to suggest contributing through OpenJDK 2025-12-06 01:03:47 +01:00
Vitaly Provodin
6358ad8f35 Update README.md 2025-12-06 01:03:47 +01:00
Vitaly Provodin
c1d8ff0d3c Update README.md 2025-12-06 01:03:47 +01:00
Vitaly Provodin
f2ab006391 Update README.md 2025-12-06 01:03:47 +01:00
Dmitrii Morskii
c2e71a0234 JBR-6044 handle absence of fontConfig library in setupRenderingFontHints
(cherry picked from commit 6d41e07ffa)
2025-12-06 01:03:47 +01:00
Dmitrii Morskii
10aee6f99f JBR-6041 started using correct type inside FcPatternGetValueFuncType
(cherry picked from commit fc2b096811)
2025-12-06 01:03:47 +01:00
Dmitrii Morskii
47a88f7a01 JBR-5844: fixed other part of issue. Added missing implementation of native methods in fontconfigmanager
(cherry picked from commit dbd70b4401)
2025-12-06 01:03:46 +01:00
Nikita Tsarev
197cf3ff56 JBR-9581 Wayland: Find xkbcommon at configure time
This commit changes how WLToolkit loads libxkbcommon. It will now be
linked as a normal dynamic library at build time, instead of being
loaded via dlopen. This commit also introduces dependency on
libxkbcommon headers and removes the corresponding declarations from
WLKeyboard.c.
2025-12-06 01:03:46 +01:00
bourgesl
3e05196204 JBR-8651 Pycharm Crashing after lock/sleep: SIGABRT at # C [libsystem_kernel.dylib+0x9388] __pthread_kill / __displaycb_handle_block_invoke
Minimal changes for JBR-21: added @try/&@catch(nsexception) in ThreadUtilities.processQueuedCallbacks() to handle any native or java exception and avoid crashing the main run loop
2025-12-06 01:03:46 +01:00
bourgesl
ef22561af0 Revert "JBR-8651 Pycharm Crashing after lock/sleep: SIGABRT at # C [libsystem_kernel.dylib+0x9388] __pthread_kill / __displaycb_handle_block_invoke"
This reverts commit 986d578731.
2025-12-06 01:03:46 +01:00
bourgesl
0fe8c94936 Revert "JBR-8651 remove logging producing warnings in stderr"
This reverts commit d919ba4864.
2025-12-06 01:03:46 +01:00
Sergey Shelomentsev
90a44e14ed JBR-9563 Add test to verify that new threads aren't spawned infinitely 2025-12-06 01:03:46 +01:00
Nikita Gubarkov
318bfa96c5 JBR-5594 Pass display configuration from outside on full display update 2025-12-06 01:03:46 +01:00
Nikita Gubarkov
0a3bb8842e JBR-5594 Pass display configuration info from AppKit to EDT 2025-12-06 01:03:46 +01:00
Nikita Tsarev
b284fad1b4 JBR-9542 Wayland: Fix modifier mask on modifier key press/release
When pressing a modifier key such as Shift or Alt, other toolkits
include the corresponding bit in the modifier mask. Similiarly, when
releasing a modifier key, other toolkits will not include this bit if
the just released modifier key was the last key producing this bit.

When pressing such a key, Wayland compositors first send the
wl_keyboard.key event, and only then the wl_keyboard.modifiers event.
This causes the reported AWT modifier mask to be inconsistent with
XToolkit. This patch fixes this.
2025-12-06 01:03:46 +01:00
Vitaly Provodin
e9f866ecef JBR-8651 remove logging producing warnings in stderr 2025-12-06 01:03:46 +01:00
bourgesl
0ad833eafe JBR-8651 Pycharm Crashing after lock/sleep: SIGABRT at # C [libsystem_kernel.dylib+0x9388] __pthread_kill / __displaycb_handle_block_invoke
Rewritten exception handling to adopt the improved NSApplicationAWT exception handler (log all exceptions, avoid crash GUI)
Fixed JNI_COCOA_EXIT(env) usages to test also pending JNI exceptions
Added JNI_COCOA_EXIT_FATAL(message) used by NSApplicationAWT.sendEvent to report a crash with full details
Unified logException to report both crash and exceptions
Added isAWTCrashOnException() using the system property 'apple.awt.crashOnException' to crash on any exception occuring in NSApplication level
Added missing CHECK_EXCEPTION after (*env)->Call...Method()
Intercept all exception in NSApplicationAWT as NSExceptionHandlerDelegate + added tests in LWCToolkit (native) and Java code to test all exceptions are reported in logs and caught properly
2025-12-06 01:03:46 +01:00
Nikita Tsarev
b831a14938 JBR-9547: Fix macOS build failure with Xcode 26.0.1 2025-12-06 01:03:45 +01:00
Vitaly Provodin
eaad013e5d Update README.md 2025-12-06 01:03:45 +01:00
Vitaly Provodin
160ed0d2c6 update exclude list on results of main.3734 test runs 2025-12-06 01:03:45 +01:00