Compare commits

..

1 Commits

Author SHA1 Message Date
Vitaly Provodin
c628622ceb update exclude list on results of 25.0.2 test runs 2026-01-31 05:43:29 +04:00
7 changed files with 39 additions and 99 deletions

View File

@@ -24,7 +24,6 @@
* questions.
*/
#include <math.h>
#include "sun_font_StrikeCache.h"
#include "sun_java2d_pipe_BufferedOpCodes.h"
#include "sun_java2d_pipe_BufferedRenderPipe.h"
@@ -316,23 +315,11 @@ JNIEXPORT void JNICALL Java_sun_java2d_vulkan_VKRenderQueue_flushBuffer
}
if (ginfo->format != sun_font_StrikeCache_PIXEL_FORMAT_GREYSCALE) continue;
if (ginfo->height*ginfo->rowBytes == 0) continue;
// Calculate subpixel offset.
int rx = ginfo->subpixelResolutionX, ry = ginfo->subpixelResolutionY;
int x = floor(glyphx), y = floor(glyphy);
int xOffset, yOffset;
if ((rx == 1 && ry == 1) || rx <= 0 || ry <= 0) {
xOffset = yOffset = 0;
} else {
xOffset = (int) ((glyphx - (float) x) * (float) rx);
yOffset = (int) ((glyphy - (float) y) * (float) ry);
}
VKRenderer_MaskFill(x, y,
VKRenderer_MaskFill((int) glyphx, (int) glyphy,
ginfo->width, ginfo->height,
0, ginfo->rowBytes,
ginfo->height * ginfo->rowBytes,
ginfo->image + (ginfo->rowBytes * ginfo->height) * (xOffset + yOffset * rx));
ginfo->image);
}
SKIP_BYTES(b, numGlyphs * bytesPerGlyph);
}

View File

@@ -151,9 +151,6 @@ public class WLToolkit extends UNIXToolkit implements Runnable {
private static native void initIDs(long displayPtr);
static {
// This field must be initialized BEFORE initIDs is called because it'll be read there
ENABLE_NATIVE_IM_SUPPORT = obtainWhetherToEnableNativeIMSupport();
if (!GraphicsEnvironment.isHeadless()) {
keyboard = new WLKeyboard();
long display = WLDisplay.getInstance().getDisplayPtr();
@@ -259,39 +256,6 @@ public class WLToolkit extends UNIXToolkit implements Runnable {
return peer;
}
// This method is directly used by native code at the class loading stage, be careful with changing it in any way.
public static boolean isNativeInputMethodSupportEnabled() {
return ENABLE_NATIVE_IM_SUPPORT;
}
/**
* This flag allows disabling ALL integrations with native IMs. The idea is to allow users to disable
* unnecessary for them functionality if they face any problems because of it.
* Therefore, if it's {@code false}, the Toolkit code shouldn't use (directly or indirectly)
* any of Wayland's input methods-related APIs (e.g. the "text-input" protocol).
*/
private final static boolean ENABLE_NATIVE_IM_SUPPORT;
private static boolean obtainWhetherToEnableNativeIMSupport() {
// NB: make sure this default value is synchronized with the one used in the native function
// isNativeInputMethodSupportEnabled() in WLToolkit.c
boolean result = true;
try {
result = Boolean.parseBoolean(System.getProperty("sun.awt.wl.im.enabled", "true"));
} catch (Exception err) {
log.severe(
String.format(
"Failed to read the value of the system property \"sun.awt.wl.im.enabled\". Assuming the default value(=%b).",
result
),
err
);
}
return result;
}
/**
* Wayland events coming to queues other that the default are handled here.
* The code is executed on a separate thread and must not call any user code.
@@ -929,15 +893,7 @@ public class WLToolkit extends UNIXToolkit implements Runnable {
*/
@Override
public InputMethodDescriptor getInputMethodAdapterDescriptor() {
final InputMethodDescriptor result = ENABLE_NATIVE_IM_SUPPORT
? WLInputMethodMetaDescriptor.getInstanceIfAvailableOnPlatform()
: null;
if (log.isLoggable(PlatformLogger.Level.FINE)) {
log.fine("getInputMethodAdapterDescriptor(): ENABLE_NATIVE_IM_SUPPORT={0}, result={1}.", ENABLE_NATIVE_IM_SUPPORT, result);
}
return result;
return WLInputMethodMetaDescriptor.getInstanceIfAvailableOnPlatform();
}
/**

View File

@@ -25,7 +25,6 @@
package sun.awt.wl.im;
import sun.awt.wl.WLToolkit;
import sun.awt.wl.im.text_input_unstable_v3.WLInputMethodDescriptorZwpTextInputV3;
import sun.util.logging.PlatformLogger;
@@ -89,9 +88,8 @@ public final class WLInputMethodMetaDescriptor implements InputMethodDescriptor
public static WLInputMethodMetaDescriptor getInstanceIfAvailableOnPlatform() {
final WLInputMethodMetaDescriptor result;
final boolean enableNativeImSupport = WLToolkit.isNativeInputMethodSupportEnabled();
if (!enableNativeImSupport) {
if (!ENABLE_NATIVE_IM_SUPPORT) {
result = null;
} else {
// For now there's only 1 possible implementation of IM,
@@ -106,6 +104,10 @@ public final class WLInputMethodMetaDescriptor implements InputMethodDescriptor
}
}
if (log.isLoggable(PlatformLogger.Level.FINE)) {
log.fine("getInstanceIfAvailableOnPlatform(): result={0}, ENABLE_NATIVE_IM_SUPPORT={1}.", result, ENABLE_NATIVE_IM_SUPPORT);
}
return result;
}
@@ -184,6 +186,25 @@ public final class WLInputMethodMetaDescriptor implements InputMethodDescriptor
TextAttribute.SWAP_COLORS, TextAttribute.SWAP_COLORS_ON
);
/**
* This flag allows disabling ALL integrations with native IMs. The idea is to allow users to disable
* unnecessary for them functionality if they face any problems because of it.
* Therefore, if it's {@code false}, the Toolkit code shouldn't use (directly or indirectly)
* any of Wayland's input methods-related APIs (e.g. the "text-input" protocol).
*/
private final static boolean ENABLE_NATIVE_IM_SUPPORT;
static {
boolean enableNativeImSupportInitializer = true;
try {
enableNativeImSupportInitializer = Boolean.parseBoolean(System.getProperty("sun.awt.wl.im.enabled", "true"));
} catch (Exception err) {
log.severe("Failed to read the value of the system property \"sun.awt.wl.im.enabled\". Assuming the default value(=true).", err);
}
ENABLE_NATIVE_IM_SUPPORT = enableNativeImSupportInitializer;
}
private final InputMethodDescriptor realImDescriptor;

View File

@@ -28,6 +28,8 @@ package sun.awt.wl.im.text_input_unstable_v3;
import sun.awt.UNIXToolkit;
import java.awt.Toolkit;
import java.security.AccessController;
import java.security.PrivilegedAction;
import java.util.Objects;
import java.util.concurrent.atomic.AtomicReference;
@@ -68,7 +70,12 @@ final class CurrentDesktopInfo {
result = -1;
} else if (Toolkit.getDefaultToolkit() instanceof UNIXToolkit unixToolkit) {
try {
result = Objects.requireNonNullElse(unixToolkit.getGnomeShellMajorVersion(), -1);
@SuppressWarnings("removal")
final Integer version = AccessController.doPrivileged(
(PrivilegedAction<Integer>)unixToolkit::getGnomeShellMajorVersion
);
result = Objects.requireNonNullElse(version, -1);
} catch (Exception ignored) {
result = -1;
}

View File

@@ -139,8 +139,6 @@ static jmethodID dispatchKeyboardLeaveEventMID;
static jmethodID dispatchRelativePointerEventMID;
static jmethodID handleToplevelIconSizeMID;
static jmethodID isNativeInputMethodSupportEnabledMID;
JNIEnv *getEnv() {
JNIEnv *env;
// assuming we're always called from a Java thread
@@ -604,29 +602,6 @@ static const struct xdg_toplevel_icon_manager_v1_listener xdg_toplevel_icon_mana
.done = xdg_toplevel_icon_manager_icon_size_done,
};
static bool isNativeInputMethodSupportEnabled(void) {
// NB: make sure this default value is synchronized with the one used in
// sun.awt.wl.WLToolkit#obtainWhetherToEnableNativeIMSupport
const bool deflt = true;
JNIEnv * const env = getEnv();
jboolean upcallResult;
if (env == NULL) {
return deflt;
}
upcallResult = (*env)->CallStaticBooleanMethod(env, tkClass, isNativeInputMethodSupportEnabledMID);
if ((*env)->ExceptionCheck(env) == JNI_TRUE) {
(*env)->ExceptionDescribe(env);
(*env)->ExceptionClear(env);
return deflt;
}
return (upcallResult == JNI_TRUE) ? true : false;
}
static void
registry_global(void *data, struct wl_registry *wl_registry,
uint32_t name, const char *interface, uint32_t version)
@@ -688,11 +663,8 @@ registry_global(void *data, struct wl_registry *wl_registry,
// the event loop may shut down as soon as it gets launched (wl_display_dispatch will return -1),
// so let's protect from this since the component being obtained is not vital for work.
const uint32_t versionToBind = 1;
if (isNativeInputMethodSupportEnabled()) {
if (versionToBind <= version) {
zwp_text_input_manager = wl_registry_bind(wl_registry, name, &zwp_text_input_manager_v3_interface, versionToBind);
}
if (versionToBind <= version) {
zwp_text_input_manager = wl_registry_bind(wl_registry, name, &zwp_text_input_manager_v3_interface, versionToBind);
}
} else if (strcmp(interface, zxdg_decoration_manager_v1_interface.name) == 0) {
xdg_decoration_manager = wl_registry_bind(wl_registry, name, &zxdg_decoration_manager_v1_interface, 1);
@@ -845,11 +817,6 @@ initJavaRefs(JNIEnv *env, jclass clazz)
"(DD)V"),
JNI_FALSE);
CHECK_NULL_RETURN(isNativeInputMethodSupportEnabledMID = (*env)->GetStaticMethodID(env, tkClass,
"isNativeInputMethodSupportEnabled",
"()Z"),
JNI_FALSE);
jclass wlgeClass = (*env)->FindClass(env, "sun/awt/wl/WLGraphicsEnvironment");
CHECK_NULL_RETURN(wlgeClass, JNI_FALSE);

View File

@@ -1110,6 +1110,7 @@ jdk_awt_wayland = \
-java/awt/Toolkit/DesktopProperties/rfe4758438.java \
-java/awt/Toolkit/DynamicLayout/bug7172833.java \
-java/awt/Toolkit/Headless/GetPrintJob/GetPrintJob.java \
-java/awt/Toolkit/Headless/WrappedToolkitTest/TestWrapped.java \
-java/awt/Toolkit/LockingKeyStateTest/LockingKeyStateTest.java \
-java/awt/Toolkit/RealSync/Test.java \
-java/awt/Toolkit/ScreenInsetsTest/ScreenInsetsTest.java \

View File

@@ -139,6 +139,7 @@ java/awt/Focus/InactiveFocusRace.java 8023263,JBR-8586 linux-all,windows-x64
java/awt/Focus/InputVerifierTest3/InputVerifierTest3.java JBR-7311 linux-6.8.0-1036-aws,linux-6.8.0-1039-aws,linux-6.8.0-1040-aws,linux-6.8.0-1043-aws,linux-6.8.0-1044-aws
java/awt/Focus/AutoRequestFocusTest/AutoRequestFocusToFrontTest.java 6848406 generic-all
java/awt/Focus/AutoRequestFocusTest/AutoRequestFocusSetVisibleTest.java 6848407 generic-all
java/awt/Frame/BogusFocusableWindowState/BogusFocusableWindowState.java 8361521 linux-all
java/awt/Focus/LabelScrollBarFocus.java JBR-8027 linux-all
java/awt/Focus/OwnedWindowFocusIMECrashTest/OwnedWindowFocusIMECrashTest.java 8169110 linux-all
java/awt/Focus/UnaccessibleChoice/AccessibleChoiceTest.java JBR-5178 windows-all