Compare commits

..

27 Commits

Author SHA1 Message Date
Maxim Kartashev
258cf006bc JBR-6117 Wayland: JVM shutdown hang 2023-09-28 09:01:26 +04:00
Nikita Provotorov
a240282285 JBR-5984: IM's candidate window is placed under popup windows.
- Implements the optional method [NSTextInputClient windowLevel] to tell the macOS IM subsystem correct level of the window;
- Adds a regression test ImWindowIsPlacedUnderPopup5984.java.

(cherry picked from commit 5a91aae9c2)
2023-09-26 22:01:45 +02:00
Dmitrii Morskii
edfe753192 JBR-6044 handle absence of fontConfig library in setupRenderingFontHints 2023-09-25 12:51:03 +02:00
Dmitrii Morskii
7d8ca546f4 JBR-6041 started using correct type inside FcPatternGetValueFuncType 2023-09-25 12:50:59 +02:00
ghostflyby
b9d1c0e801 JBR-6124 Fix macOS services writing text back to textfield 2023-09-25 11:37:53 +02:00
Dmitry Batrak
d47223ddd9 JBR-5961 Wayland: can't switch between projects using menu
prevent using a pointer to destroyed surface
2023-09-25 09:33:15 +03:00
Vitaly Provodin
862b0d9195 update exclude list on results of 21_b240.22 test runs 2023-09-22 17:31:35 +07:00
Nikita Gubarkov
0457603fb6 JBR-6098 x64 docker images with glslc. 2023-09-21 10:21:40 +02:00
Sergey Shelomentsev
12c88c770d exclude FocusTraversalOrderTest 2023-09-20 21:34:29 +03:00
Sergey Shelomentsev
ac57aef98b JBR-6060 add focus traversal order test 2023-09-20 21:21:41 +03:00
Vitaly Provodin
40da69a5fb JBR-6070 update docker images for Alpine Linux 2023-09-16 08:35:57 +07:00
Vitaly Provodin
e4596e18e9 update exclude list on results of 21_b231.1 commit test runs 2023-09-16 08:35:57 +07:00
Dmitry Batrak
a24ed041aa JBR-5961 Wayland: can't switch between projects using menu
fix typo
2023-09-15 14:45:03 +03:00
Dmitry Batrak
d0bf4506c0 JBR-5961 Wayland: can't switch between projects using menu
support Window.toFront in Wayland toolkit
2023-09-15 12:44:26 +03:00
Maxim Kartashev
836f44fded JBR-6071 Alpine Linux compilation: error: implicit declaration of function 'pthread_getname_np' 2023-09-15 12:52:05 +04:00
Vitaly Provodin
f0bbcfc492 update exclude list on results of 21.231.1 test runs 2023-09-15 04:13:18 +07:00
Maxim Kartashev
e829d44cb9 JBR-5989 Wayland: jdk_awt_wayland test group 2023-09-13 08:26:46 +04:00
Maxim Kartashev
df095ab6db JBR-6025 Wayland: miscellaneous small improvements 2023-09-13 08:26:32 +04:00
Nikita Gubarkov
c301e17244 JBR-6016 doPrivileged for JBR API internal services.
(cherry picked from commit 19917e72086f091ef845959a29e7814ff6d88aa7)
2023-09-11 15:07:25 +02:00
Alexey Ushakov
f66a111d13 JBR-6045 WLToolkit(Vulkan): Add options to select physical device
Changed access to _name field, minor corrections in verbose print
2023-09-08 12:28:07 +02:00
Vitaly Provodin
6db1b3ec3c update exclude list on results of 21_b218.1 test runs 2023-09-08 17:06:59 +07:00
Alexey Ushakov
a19d03327a JBR-6045 WLToolkit(Vulkan): Add options to select physical device
Implemented -Dsun.java2d.vulkan=True and -Dsun.java2d.vulkan.deviceNumber=n VM options
2023-09-07 21:47:40 +02:00
Dmitrii Morskii
6d63ee0477 JBR-5502: optimize stringWidth & charsWidth methods of FontDesignMetrics 2023-09-07 17:23:55 +02:00
Dmitrii Morskii
60928807c8 JBR-6018 removed incorrect test testFeaturesZeroFrac 2023-09-07 14:51:20 +02:00
Maxim Kartashev
da11c5e526 JBR-6036 Wayland: Cannot invoke "java.awt.Component.getWidth()" because "popupParent" is null
Not all POPUP Window's have their parent set. And only those who do
shall be treated as popups in the Wayland's sense.
2023-09-06 19:23:07 +04:00
Nikita Tsarev
c56af99364 JBR-6028: Check before attempting to switch to a layout that might not exist in KeyCodesTest 2023-09-06 17:01:24 +02:00
Nikita Gubarkov
492fddd948 JBR-5973 Implement rendering of no-AA shapes with Vulkan pipeline
Get rid of maxTextureSize in Vulkan code. This concept was introduced to fix macOS-specific bugs and don't map well to Vulkan implementation, as this value is tied to specific device and texture format, so get rid of it for now and see whether we need it at all.

Refactored native surface data hierarchy. There was a C-style "inheritance" model with VKSDOps having an SurfaceDataOps as its first member and conversions back and forth between them. And then also privOps - pointer to the platform-specific part (WLVK). This was refactored into plain inheritance: SurfaceDataOps -> VKSurfaceData -> VKSwapchainSurfaceData -> WLVKSurfaceData

State management, synchronization & layout transition. Now using dynamic rendering and synchronization2 extensions.
Each device has a single timeline semaphore (basically 64-bit counter), monotonically increasing as device executes our commands, allowing us to track the state of the submitted batches and reuse resources which are no longer in use.

Split command recording into primary and secondary command buffers.
This allows us to record commands "in the past", before current render pass started, which gives possibility for some heavy optimizations:
1. When we suddenly need some texture in the middle of the render pass - no need to stop render pass in order to insert necessary synchronization - we can do it as if we knew it beforehand.
2. When we draw something and then clear the surface - just erase all commands inside current render pass we recorded earlier, so the actual drawing will never happen.

Shaders are compiled with glslc or glslangValidator and bytecode is inlined directly into libawt_wlawt

Memory management via VMA, vertex buffer pool, shader push constants.

Other refactoring.
2023-09-06 15:26:12 +02:00
43 changed files with 1907 additions and 281 deletions

View File

@@ -8,15 +8,36 @@
FROM arm64v8/alpine:3.12
# Install the necessary build tools
RUN apk --no-cache add --update bash grep tar zip bzip2 rsync fontconfig build-base \
git libx11-dev libxext-dev libxrandr-dev libxrender-dev libxt-dev \
libxtst-dev autoconf freetype-dev cups-dev alsa-lib-dev file \
fontconfig fontconfig-dev linux-headers
RUN apk --no-cache add --update \
alsa-lib-dev=1.2.2-r0 \
autoconf=2.69-r2 \
bash=5.0.17-r0 \
build-base=0.5-r2 \
bzip2=1.0.8-r1 \
cups-dev=2.3.3-r0 \
file=5.38-r0 \
fontconfig=2.13.1-r2 \
fontconfig-dev=2.13.1-r2 \
freetype-dev=2.10.4-r2 \
git=2.26.3-r1 \
grep=3.4-r0 \
libx11-dev=1.6.12-r1 \
libxext-dev=1.3.4-r0 \
libxrandr-dev=1.5.2-r0 \
libxrender-dev=0.9.10-r3 \
libxt-dev=1.2.0-r0 \
libxtst-dev=1.2.3-r3 \
linux-headers=5.4.5-r1 \
rsync=3.1.3-r3 \
tar=1.32-r2 \
wayland-dev=1.18.0-r4 \
zip=3.0-r8
# Set up boot JDK for building
COPY boot_jdk_musl_aarch64.tar.gz /jdk17/
RUN cd /jdk17 && tar --strip-components=1 -xzf boot_jdk_musl_aarch64.tar.gz && rm /jdk17/boot_jdk_musl_aarch64.tar.gz
ENV BOOT_JDK=/jdk17
COPY boot_jdk_musl_aarch64.tar.gz /jdk20/
RUN cd /jdk20 && tar --strip-components=1 -xzf boot_jdk_musl_aarch64.tar.gz && rm /jdk20/boot_jdk_musl_aarch64.tar.gz
ENV BOOT_JDK=/jdk20
RUN git config --global user.email "teamcity@jetbrains.com" && \
git config --global user.name "builduser"

View File

@@ -8,15 +8,35 @@
FROM alpine:3.14
# Install the necessary build tools
RUN apk --no-cache add --update bash grep tar zip bzip2 rsync fontconfig build-base \
git libx11-dev libxext-dev libxrandr-dev libxrender-dev libxt-dev \
libxtst-dev autoconf freetype-dev cups-dev alsa-lib-dev file \
fontconfig fontconfig-dev linux-headers
RUN apk --no-cache add --update \
alsa-lib-dev=1.2.5-r2 \
autoconf=2.71-r0 \
bash=5.1.16-r0 \
build-base=0.5-r3 \
bzip2=1.0.8-r1 \
cups-dev=2.3.3-r3 \
file=5.40-r1 \
fontconfig=2.13.1-r4 \
fontconfig-dev=2.13.1-r4 \
freetype-dev=2.10.4-r3 \
git=2.32.7-r0 \
grep=3.7-r0 \
libx11-dev=1.7.3.1-r0 \
libxext-dev=1.3.4-r0 \
libxrandr-dev=1.5.2-r1 \
libxrender-dev=0.9.10-r3 \
libxt-dev=1.2.1-r0 \
libxtst-dev=1.2.3-r3 \
linux-headers=5.10.41-r0 \
rsync=3.2.5-r0 \
tar=1.34-r1 \
wayland-dev=1.19.0-r0 \
zip=3.0-r9
# Set up boot JDK for building
COPY boot_jdk_musl_amd64.tar.gz /jdk17/
RUN cd /jdk17 && tar --strip-components=1 -xzf boot_jdk_musl_amd64.tar.gz && rm /jdk17/boot_jdk_musl_amd64.tar.gz
ENV BOOT_JDK=/jdk17
COPY boot_jdk_musl_amd64.tar.gz /jdk20/
RUN cd /jdk20 && tar --strip-components=1 -xzf boot_jdk_musl_amd64.tar.gz && rm /jdk20/boot_jdk_musl_amd64.tar.gz
ENV BOOT_JDK=/jdk20
RUN git config --global user.email "teamcity@jetbrains.com" && \
git config --global user.name "builduser"

View File

@@ -25,7 +25,8 @@ RUN yum -y install centos-release-scl; \
wayland-devel-1.15.0-1.el7 \
wget-1.14-18.el7_6.1 \
which-2.20-7.el7 \
zip-3.0-11.el7
zip-3.0-11.el7 \
python3-3.6.8-17.el7
RUN mkdir .git && \
git config user.email "teamcity@jetbrains.com" && \
@@ -33,4 +34,24 @@ RUN mkdir .git && \
ENV LD_LIBRARY_PATH="/opt/rh/devtoolset-10/root/usr/lib64:/opt/rh/devtoolset-10/root/usr/lib:/opt/rh/devtoolset-10/root/usr/lib64/dyninst:/opt/rh/devtoolset-10/root/usr/lib/dyninst:/opt/rh/devtoolset-10/root/usr/lib64:/opt/rh/devtoolset-10/root/usr/lib"
ENV PATH="/opt/rh/devtoolset-10/root/usr/bin::${PATH}"
ENV PKG_CONFIG_PATH="/opt/rh/devtoolset-10/root/usr/lib64/pkgconfig"
ENV PKG_CONFIG_PATH="/opt/rh/devtoolset-10/root/usr/lib64/pkgconfig"
# Build GLSLC
RUN curl -OL https://github.com/Kitware/CMake/releases/download/v3.27.5/cmake-3.27.5-linux-x86_64.tar.gz \
&& echo 138c68addae825b16ed78d792dafef5e0960194833f48bd77e7e0429c6bc081c *cmake-3.27.5-linux-x86_64.tar.gz | sha256sum -c - \
&& tar -xzf cmake-3.27.5-linux-x86_64.tar.gz \
&& rm cmake-3.27.5-linux-x86_64.tar.gz \
&& git clone https://github.com/google/shaderc --branch v2023.6 \
&& cd shaderc \
&& ./utils/git-sync-deps \
&& mkdir build \
&& cd build \
&& /cmake-3.27.5-linux-x86_64/bin/cmake \
-DCMAKE_BUILD_TYPE=Release \
-DCMAKE_INSTALL_PREFIX=/usr/local \
-DSHADERC_SKIP_TESTS=ON \
-DSHADERC_SKIP_EXAMPLES=ON \
-DSHADERC_SKIP_COPYRIGHT_CHECK=ON \
.. \
&& make install
ENV PATH="/cmake-3.27.5-linux-x86_64/bin::${PATH}"

View File

@@ -4,10 +4,10 @@ set -euo pipefail
set -x
# This script creates a Docker image suitable for building musl AArch64 variant
# of the JetBrains Runtime version 17.
# of the JetBrains Runtime version 21.
BOOT_JDK_REMOTE_FILE=zulu17.32.13-ca-jdk17.0.2-linux_musl_aarch64.tar.gz
BOOT_JDK_SHA=6b920559abafbe9bdef386a20ecf3a2f318bc1f0d8359eb1f95aee26606bbc70
BOOT_JDK_REMOTE_FILE=zulu20.32.11-ca-jdk20.0.2-linux_musl_aarch64.tar.gz
BOOT_JDK_SHA=eec57cf744c2438f695221f041d4804de3033ad33b6dba769d3359813ba3f90d
BOOT_JDK_LOCAL_FILE=boot_jdk_musl_aarch64.tar.gz
if [ ! -f $BOOT_JDK_LOCAL_FILE ]; then
@@ -22,7 +22,7 @@ sha256sum -c - <<EOF
$BOOT_JDK_SHA *$BOOT_JDK_LOCAL_FILE
EOF
docker build -t jbr17buildenv -f Dockerfile.musl_aarch64 .
docker build -t jetbrains/runtime:jbr21env_musl_aarch64 -f Dockerfile.musl_aarch64 .
# NB: the resulting container can (and should) be used without the network
# connection (--network none) during build in order to reduce the chance

View File

@@ -4,10 +4,10 @@ set -euo pipefail
set -x
# This script creates a Docker image suitable for building musl-x64 variant
# of the JetBrains Runtime version 17.
# of the JetBrains Runtime version 21.
BOOT_JDK_REMOTE_FILE=zulu17.32.13-ca-jdk17.0.2-linux_musl_x64.tar.gz
BOOT_JDK_SHA=bcc5342011bd9f3643372aadbdfa68d47463ff0d8621668a0bdf2910614d95c6
BOOT_JDK_REMOTE_FILE=zulu20.32.11-ca-jdk20.0.2-linux_musl_x64.tar.gz
BOOT_JDK_SHA=fca5081dd6da847fcd06f5b755e58edae22d6784f21b81bf73da2b538f842c07
BOOT_JDK_LOCAL_FILE=boot_jdk_musl_amd64.tar.gz
if [ ! -f $BOOT_JDK_LOCAL_FILE ]; then
@@ -22,7 +22,7 @@ sha256sum -c - <<EOF
$BOOT_JDK_SHA *$BOOT_JDK_LOCAL_FILE
EOF
docker build -t jbr17buildenv -f Dockerfile.musl_x64 .
docker build -t jetbrains/runtime:jbr21env_musl_x64 -f Dockerfile.musl_x64 .
# NB: the resulting container can (and should) be used without the network
# connection (--network none) during build in order to reduce the chance

View File

@@ -25,9 +25,13 @@
package com.jetbrains.internal;
import sun.security.action.GetBooleanAction;
import java.io.Serial;
import java.lang.invoke.MethodHandle;
import java.lang.invoke.MethodHandles;
import java.security.AccessController;
import java.security.PrivilegedAction;
import java.util.*;
import java.util.concurrent.ConcurrentHashMap;
import java.util.concurrent.ConcurrentMap;
@@ -97,7 +101,8 @@ import static java.lang.invoke.MethodHandles.Lookup;
* user to directly create proxy object.
*/
public class JBRApi {
static final boolean VERBOSE = Boolean.getBoolean("jetbrains.api.verbose");
@SuppressWarnings("removal")
static final boolean VERBOSE = AccessController.doPrivileged(new GetBooleanAction("jetbrains.api.verbose"));
private static final Map<String, RegisteredProxyInfo> registeredProxyInfoByInterfaceName = new HashMap<>();
private static final Map<String, RegisteredProxyInfo> registeredProxyInfoByTargetName = new HashMap<>();
@@ -205,19 +210,22 @@ public class JBRApi {
return this;
}
@SuppressWarnings("removal")
public Object build() {
ProxyInfo info = ProxyInfo.resolve(this.info);
if (info == null) return null;
ProxyGenerator generator = new ProxyGenerator(info);
if (!generator.areAllMethodsImplemented()) return null;
generator.defineClasses();
MethodHandle constructor = generator.findConstructor();
generator.init();
try {
return constructor.invoke();
} catch (Throwable e) {
throw new RuntimeException(e);
}
return AccessController.doPrivileged((PrivilegedAction<Object>) () -> {
ProxyInfo info = ProxyInfo.resolve(this.info);
if (info == null) return null;
ProxyGenerator generator = new ProxyGenerator(info);
if (!generator.areAllMethodsImplemented()) return null;
generator.defineClasses();
MethodHandle constructor = generator.findConstructor();
generator.init();
try {
return constructor.invoke();
} catch (Throwable e) {
throw new RuntimeException(e);
}
});
}
}

View File

@@ -190,6 +190,10 @@ public final class LWCToolkit extends LWToolkit {
return getKeyboardLayoutList(false).contains(layoutName);
}
public static boolean isKeyboardLayoutInstalled(String layoutName) {
return getKeyboardLayoutList(true).contains(layoutName);
}
// Listens to EDT state in invokeAndWait() and disposes the invocation event
// when EDT becomes free but the invocation event is not yet dispatched (considered lost).
// This prevents a deadlock and makes the invocation return some default result.

View File

@@ -35,6 +35,7 @@
#import "JNIUtilities.h"
#import "jni_util.h"
#import "PropertiesUtilities.h"
#import "sun_lwawt_macosx_CPlatformWindow.h"
#import <Carbon/Carbon.h>
@@ -850,7 +851,7 @@ static void debugPrintNSEvent(NSEvent* event, const char* comment) {
- (BOOL)replaceAccessibleTextSelection:(NSString *)text
{
id focused = [self accessibilityFocusedUIElement];
if (![focused respondsToSelector:@selector(setAccessibilitySelectedText)]) return NO;
if (![focused respondsToSelector:@selector(setAccessibilitySelectedText:)]) return NO;
[focused setAccessibilitySelectedText:text];
return YES;
}
@@ -1096,6 +1097,43 @@ static jclass jc_CInputMethod = NULL;
#define GET_CIM_CLASS_RETURN(ret) \
GET_CLASS_RETURN(jc_CInputMethod, "sun/lwawt/macosx/CInputMethod", ret);
- (NSInteger) windowLevel
{
#ifdef IM_DEBUG
fprintf(stderr, "AWTView InputMethod Selector Called : [windowLevel]\n");
#endif // IM_DEBUG
NSWindow* const ownerWindow = [self window];
if (ownerWindow == nil) {
return NSNormalWindowLevel;
}
const NSWindowLevel ownerWindowLevel = [ownerWindow level];
if ( (ownerWindowLevel != NSNormalWindowLevel) && (ownerWindowLevel != NSFloatingWindowLevel) ) {
// the window level has been overridden, let's believe it
return ownerWindowLevel;
}
AWTWindow* const delegate = (AWTWindow*)[ownerWindow delegate];
if (delegate == nil) {
return ownerWindowLevel;
}
const jint styleBits = [delegate styleBits];
const BOOL isPopup = ( (styleBits & sun_lwawt_macosx_CPlatformWindow_IS_POPUP) != 0 );
if (isPopup) {
return NSPopUpMenuWindowLevel;
}
const BOOL isModal = ( (styleBits & sun_lwawt_macosx_CPlatformWindow_IS_MODAL) != 0 );
if (isModal) {
return NSFloatingWindowLevel;
}
return ownerWindowLevel;
}
- (void) insertText:(id)aString replacementRange:(NSRange)replacementRange
{
#ifdef IM_DEBUG

View File

@@ -36,9 +36,14 @@ import java.util.stream.Collectors;
public class FontExtensions {
private interface FontExtension {
FontExtension INSTANCE = (FontExtension) JBRApi.internalServiceBuilder(MethodHandles.lookup())
.withStatic("getFeatures", "getFeatures", "java.awt.Font").build();
.withStatic("getFeatures", "getFeatures", "java.awt.Font")
.withStatic("isComplexRendering", "isComplexRendering", "java.awt.Font")
.withStatic("isKerning", "isKerning", "java.awt.Font")
.build();
TreeMap<String, Integer> getFeatures(Font font);
boolean isComplexRendering(Font font);
boolean isKerning(Font font);
}
public static String[] featuresToStringArray(Map<String, Integer> features) {
@@ -49,4 +54,12 @@ public class FontExtensions {
public static TreeMap<String, Integer> getFeatures(Font font) {
return FontExtension.INSTANCE.getFeatures(font);
}
public static boolean isComplexRendering(Font font) {
return FontExtension.INSTANCE.isComplexRendering(font);
}
public static boolean isKerning(Font font) {
return FontExtension.INSTANCE.isKerning(font);
}
}

View File

@@ -2719,29 +2719,17 @@ public class Font implements java.io.Serializable
(limit - beginIndex));
}
// this code should be in textlayout
// quick check for simple text, assume GV ok to use if simple
FontDesignMetrics metrics = FontDesignMetrics.getMetrics(this, frc);
return metrics.charsBounds(chars, beginIndex, limit - beginIndex);
}
boolean simple = (values == null ||
(values.getKerning() == 0
&& values.getLigatures() == 0
&& values.getTracking() == 0
&& values.getBaselineTransform() == null)) && !anyEnabledFeatures();
if (simple) {
simple = ! FontUtilities.isComplexText(chars, beginIndex, limit);
}
private static boolean isComplexRendering(Font font) {
return (font.values != null && (font.values.getLigatures() != 0 || font.values.getTracking() != 0 ||
font.values.getBaselineTransform() != null)) || font.anyEnabledFeatures();
}
if (simple || ((limit - beginIndex) == 0)) {
FontDesignMetrics metrics = FontDesignMetrics.getMetrics(this, frc);
return metrics.getSimpleBounds(chars, beginIndex, limit-beginIndex);
} else {
// need char array constructor on textlayout
String str = new String(chars, beginIndex, limit - beginIndex);
TextLayout tl = new TextLayout(str, this, frc);
return new Rectangle2D.Float(0, -tl.getAscent(), tl.getAdvance(),
tl.getAscent() + tl.getDescent() +
tl.getLeading());
}
private static boolean isKerning(Font font) {
return font.values != null && (font.values.getKerning() != 0);
}
/**

View File

@@ -38,8 +38,11 @@ import java.io.ObjectOutputStream;
import java.io.Serial;
import java.lang.ref.ReferenceQueue;
import java.lang.ref.SoftReference;
import java.util.HashMap;
import java.util.Map;
import java.util.concurrent.ConcurrentHashMap;
import com.jetbrains.desktop.FontExtensions;
import sun.java2d.Disposer;
import sun.java2d.DisposerRecord;
@@ -432,16 +435,13 @@ public final class FontDesignMetrics extends FontMetrics {
return frc;
}
public int charWidth(char ch) {
private float preciseCharWidth(char ch) {
// default metrics for compatibility with legacy code
float w;
if (ch < 0x100) {
w = getLatinCharWidth(ch);
}
else {
w = handleCharWidth(ch);
}
return (int)(0.5 + w);
return (ch < 0x100) ? getLatinCharWidth(ch) : handleCharWidth(ch);
}
public int charWidth(char ch) {
return Math.round(preciseCharWidth(ch));
}
public int charWidth(int ch) {
@@ -451,93 +451,111 @@ public final class FontDesignMetrics extends FontMetrics {
float w = handleCharWidth(ch);
return (int)(0.5 + w);
return Math.round(w);
}
private Rectangle2D.Float textLayoutBounds(Object data, int off, int len) {
String str = data instanceof String ? ((String) data).substring(off, off + len) :
new String((char[]) data, off, len);
TextLayout tl = new TextLayout(str, font, frc);
return new Rectangle2D.Float(0, -tl.getAscent(),
tl.getAdvance(), tl.getAscent() + tl.getDescent() + tl.getLeading());
}
private char getChar(Object data, int i) {
return data instanceof String ? ((String) data).charAt(i) : ((char[]) data)[i];
}
final int ADVANCES_FAST_KEY_LIMIT = 0x100;
private HashMap<Integer, Float> advances = new HashMap<>();
private float[] advancesFast = new float[ADVANCES_FAST_KEY_LIMIT * ADVANCES_FAST_KEY_LIMIT];
private Rectangle2D.Float dataBounds(Object data, int off, int len) {
assert (data instanceof String || data instanceof char[]);
float width = 0;
if (FontExtensions.isComplexRendering(font) && len > 0) {
return textLayoutBounds(data, off, len);
}
float height = ascent + descent + leading;
if (len == 0 || len == 1 && !FontUtilities.isNonSimpleChar(getChar(data, off))) {
width = len > 0 ? preciseCharWidth(getChar(data, off)) : 0f;
return new Rectangle2D.Float(0f, -ascent, width, height);
}
boolean isKerning = FontExtensions.isKerning(font);
float consecutiveDoubleCharacterWidth = 0f;
char prev = 0;
for (int i = off; i < off + len; i++) {
char cur = getChar(data, i);
if (FontUtilities.isNonSimpleChar(cur)) {
return textLayoutBounds(data, off, len);
} else {
// Correct width of string with kerning calculates by text LayoutBounds but it could be slow.
// Below is description of optimized algorithm for correct calculating width of text with kerning:
// proof:
// base: kerningWidth('c1') = plainWidth('c1')
// induction: kerningWidth('c1..cN-1cN') =
// kerningWidth('c1..cN-1') + kerningWidth('cN-1cN') - plainWidth('cN-1')
// final: kerningWidth('c1..cN') = kerningWidth('c1c2') + ... + kerningWidth('cN-1cN')
// - (plainWidth('c2') + ... + plainWidth('cN-1'))
// remark: for reducing calculation of kerningWidth('c1c2') using caching
if (isKerning && i > off) {
// fast path
if (prev < ADVANCES_FAST_KEY_LIMIT && cur < ADVANCES_FAST_KEY_LIMIT) {
int key = (prev << 8) | cur;
if (advancesFast[key] == 0.0f) {
advancesFast[key] = textLayoutBounds(data, i - 1, 2).width;
}
consecutiveDoubleCharacterWidth += advancesFast[key];
// common solution
} else {
int key = (prev << 16) | (0xffff & cur);
advances.putIfAbsent(key, textLayoutBounds(data, i - 1, 2).width);
consecutiveDoubleCharacterWidth += advances.get(key);
}
}
width += preciseCharWidth(cur);
}
prev = cur;
}
if (isKerning) {
width = consecutiveDoubleCharacterWidth -
(width - preciseCharWidth(getChar(data, off)) - preciseCharWidth(getChar(data, off + len - 1)));
}
return new Rectangle2D.Float(0f, -ascent, width, height);
}
public Rectangle2D.Float charsBounds(char[] data, int off, int len) {
return dataBounds(data, off, len);
}
private int dataWidth(Object data, int off, int len) {
return Math.round((float) dataBounds(data, off, len).getWidth());
}
public int stringWidth(String str) {
float width = 0;
if (font.hasLayoutAttributes()) {
/* TextLayout throws IAE for null, so throw NPE explicitly */
if (str == null) {
throw new NullPointerException("str is null");
}
if (str.length() == 0) {
return 0;
}
width = new TextLayout(str, font, frc).getAdvance();
} else {
int length = str.length();
for (int i=0; i < length; i++) {
char ch = str.charAt(i);
if (ch < 0x100) {
width += getLatinCharWidth(ch);
} else if (FontUtilities.isNonSimpleChar(ch)) {
width = new TextLayout(str, font, frc).getAdvance();
break;
} else {
width += handleCharWidth(ch);
}
}
if (str == null) {
throw new NullPointerException("str is null");
}
return (int) (0.5 + width);
return dataWidth(str, 0, str.length());
}
public int charsWidth(char[] data, int off, int len) {
float width = 0;
if (font.hasLayoutAttributes()) {
if (len == 0) {
return 0;
}
String str = new String(data, off, len);
width = new TextLayout(str, font, frc).getAdvance();
} else {
/* Explicit test needed to satisfy superclass spec */
if (len < 0) {
throw new IndexOutOfBoundsException("len="+len);
}
int limit = off + len;
for (int i=off; i < limit; i++) {
char ch = data[i];
if (ch < 0x100) {
width += getLatinCharWidth(ch);
} else if (FontUtilities.isNonSimpleChar(ch)) {
String str = new String(data, off, len);
width = new TextLayout(str, font, frc).getAdvance();
break;
} else {
width += handleCharWidth(ch);
}
}
/* Explicit test needed to satisfy superclass spec */
if (len < 0) {
throw new IndexOutOfBoundsException("len="+len);
}
return (int) (0.5 + width);
return dataWidth(data, off, len);
}
/**
* This method is called from java.awt.Font only after verifying
* the arguments and that the text is simple and there are no
* layout attributes, font transform etc.
*/
public Rectangle2D getSimpleBounds(char[] data, int off, int len) {
float width = 0;
int limit = off + len;
for (int i=off; i < limit; i++) {
char ch = data[i];
if (ch < 0x100) {
width += getLatinCharWidth(ch);
} else {
width += handleCharWidth(ch);
}
}
float height = ascent + descent + leading;
return new Rectangle2D.Float(0f, -ascent, width, height);
}
/**
* Gets the advance widths of the first 256 characters in the
* {@code Font}. The advance is the
@@ -557,7 +575,7 @@ public final class FontDesignMetrics extends FontMetrics {
if (w == UNKNOWN_WIDTH) {
w = advCache[ch] = handleCharWidth(ch);
}
widths[ch] = (int) (0.5 + w);
widths[ch] = Math.round(w);
}
return widths;
}

View File

@@ -34,6 +34,8 @@
#define VALIDATION_LAYER_NAME "VK_LAYER_KHRONOS_validation"
static const uint32_t REQUIRED_VULKAN_VERSION = VK_MAKE_API_VERSION(0, 1, 2, 0);
bool VKGraphicsEnvironment::_verbose = false;
int VKGraphicsEnvironment::_requested_device_number = -1;
std::unique_ptr<VKGraphicsEnvironment> VKGraphicsEnvironment::_ge_instance = nullptr;
// ========== Graphics environment ==========
@@ -187,11 +189,33 @@ VKGraphicsEnvironment::VKGraphicsEnvironment() :
throw std::runtime_error("Vulkan: No suitable device found");
}
// Create virtual device for a physical device.
// TODO system property for manual choice of GPU
// TODO integrated/discrete presets
// TODO performance/power saving mode switch on the fly?
_default_device = &*_devices[0]; // TODO pick first just to check hat virtual device creation works
int _default_device_number = 0; // TODO pick first just to check that virtual device creation works
if (_verbose) {
fprintf(stderr, "Vulkan graphics devices:\n");
}
_requested_device_number = (_requested_device_number == -1) ? 0 : _requested_device_number;
if (_requested_device_number < 0 || _requested_device_number >= static_cast<int>(_devices.size())) {
if (_verbose) {
fprintf(stderr, " Requested device number (%d) not found, fallback to 0\n", _requested_device_number);
}
_requested_device_number = 0;
}
_default_device_number = _requested_device_number;
if (_verbose) {
for (auto devIter = _devices.begin(); devIter != _devices.end(); devIter++) {
auto devNum = std::distance(begin(_devices), devIter);
fprintf(stderr, " %c%ld: %s\n", devNum == _default_device_number ? '*' : ' ',
devNum, (*devIter)->name().c_str());
}
fprintf(stderr, "\n");
}
_default_device = &*_devices[_default_device_number]; // TODO pick first just to check hat virtual device creation works
_default_device->init();
}
vk::raii::Instance& VKGraphicsEnvironment::vk_instance() {
@@ -414,8 +438,9 @@ void VKDevice::submitCommandBuffer(vk::raii::CommandBuffer&& primary,
waitStages.clear();
}
extern "C" jboolean VK_Init() {
extern "C" jboolean VK_Init(jboolean verbose, jint requestedDevice) {
VKGraphicsEnvironment::set_verbose(verbose);
VKGraphicsEnvironment::set_requested_device(requestedDevice);
if (VKGraphicsEnvironment::graphics_environment() != nullptr) {
return true;
}

View File

@@ -126,6 +126,10 @@ public:
explicit operator bool() const { // Initialized or not
return *((const vk::raii::Device&) *this);
}
const std::string& name() {
return _name;
}
};
class VKGraphicsEnvironment {
@@ -136,9 +140,13 @@ class VKGraphicsEnvironment {
#endif
std::vector<std::unique_ptr<VKDevice>> _devices;
VKDevice* _default_device;
static bool _verbose;
static int _requested_device_number;
static std::unique_ptr<VKGraphicsEnvironment> _ge_instance;
VKGraphicsEnvironment();
public:
static void set_verbose(bool verbose) { _verbose = verbose; }
static void set_requested_device(int requested_device) { _requested_device_number = requested_device; }
static VKGraphicsEnvironment* graphics_environment();
static void dispose();
VKDevice& default_device();
@@ -148,7 +156,7 @@ public:
extern "C" {
#endif //__cplusplus
jboolean VK_Init();
jboolean VK_Init(jboolean verbose, jint requestedDevice);
#ifdef __cplusplus
}

View File

@@ -28,7 +28,7 @@
#ifndef VULKAN_ENABLED
#include "jni.h"
jboolean VK_Init() {
jboolean VK_Init(jboolean verbose, jint requestedDevice) {
return 0;
}

View File

@@ -234,11 +234,11 @@ public class WLComponentPeer implements ComponentPeer {
this.visible = v;
if (this.visible) {
final String title = getTitle();
final boolean isPopup = target instanceof Window window && window.getType() == Window.Type.POPUP;
final boolean isWlPopup = targetIsWlPopup();
final int thisWidth = getWidth();
final int thisHeight = getHeight();
performLocked(() -> {
if (isPopup) {
if (isWlPopup) {
Window popup = (Window) target;
final Component popupParent = AWTAccessor.getWindowAccessor().getPopupParent(popup);
final int parentWidth = popupParent.getWidth();
@@ -281,6 +281,16 @@ public class WLComponentPeer implements ComponentPeer {
}
}
/**
* Returns true if our target should be treated as a popup in Wayland's sense,
* i.e. it has to have a parent to position relative to.
*/
private boolean targetIsWlPopup() {
return target instanceof Window window
&& window.getType() == Window.Type.POPUP
&& AWTAccessor.getWindowAccessor().getPopupParent(window) != null;
}
void configureWLSurface() {
synchronized (sizeLock) {
if (log.isLoggable(PlatformLogger.Level.FINE)) {
@@ -373,23 +383,24 @@ public class WLComponentPeer implements ComponentPeer {
WLToolkit.postEvent(new ComponentEvent(getTarget(), ComponentEvent.COMPONENT_MOVED));
}
synchronized(sizeLock) {
final boolean sizeChanged = this.width != width || this.height != height;
if (sizeChanged) {
Rectangle oldBounds = getVisibleBounds();
final boolean sizeChanged = oldBounds.width != width || oldBounds.height != height;
if (sizeChanged) {
synchronized (sizeLock) {
this.width = width;
this.height = height;
if (log.isLoggable(PlatformLogger.Level.FINE)) {
log.fine(String.format("%s is resizing its buffer to %dx%d with %dx scale", this, getBufferWidth(), getBufferHeight(), getBufferScale()));
}
SurfaceData.convertTo(WLSurfaceDataExt.class, surfaceData).revalidate(
getBufferWidth(), getBufferHeight(), getBufferScale());
updateWindowGeometry();
layout();
WLToolkit.postEvent(new ComponentEvent(getTarget(), ComponentEvent.COMPONENT_RESIZED));
}
postPaintEvent();
if (log.isLoggable(PlatformLogger.Level.FINE)) {
log.fine(String.format("%s is resizing its buffer to %dx%d with %dx scale", this, getBufferWidth(), getBufferHeight(), getBufferScale()));
}
SurfaceData.convertTo(WLSurfaceDataExt.class, surfaceData).revalidate(
getBufferWidth(), getBufferHeight(), getBufferScale());
updateWindowGeometry();
layout();
WLToolkit.postEvent(new ComponentEvent(getTarget(), ComponentEvent.COMPONENT_RESIZED));
}
postPaintEvent();
}
public Rectangle getVisibleBounds() {
@@ -642,6 +653,12 @@ public class WLComponentPeer implements ComponentPeer {
@Override
public void dispose() {
SurfaceData oldData = surfaceData;
surfaceData = null;
if (oldData != null) {
oldData.invalidate();
}
WLToolkit.targetDisposedPeer(target, this);
performLocked(() -> {
assert(!isVisible());
nativeDisposeFrame(nativePtr);
@@ -819,6 +836,10 @@ public class WLComponentPeer implements ComponentPeer {
performLocked(() -> nativeRequestUnsetFullScreen(nativePtr));
}
final void activate() {
performLocked(() -> nativeActivate(nativePtr));
}
private static native void initIDs();
protected native long nativeCreateFrame();
@@ -853,6 +874,7 @@ public class WLComponentPeer implements ComponentPeer {
private static native void nativeSetCursor(long pData);
private static native long nativeGetPredefinedCursor(String name);
private native void nativeShowWindowMenu(long ptr, int x, int y);
private native void nativeActivate(long ptr);
static long getParentNativePtr(Component target) {
Component parent = target.getParent();
@@ -1002,11 +1024,11 @@ public class WLComponentPeer implements ComponentPeer {
log.fine(String.format("%s configured to %dx%d", this, newWidth, newHeight));
}
final boolean isPopup = target instanceof Window window && window.getType() == Window.Type.POPUP;
boolean isWlPopup = targetIsWlPopup();
if (newWidth != 0 && newHeight != 0) performUnlocked(() ->target.setSize(newWidth, newHeight));
if (newWidth == 0 || newHeight == 0 || isPopup) {
if (newWidth == 0 || newHeight == 0 || isWlPopup) {
// From xdg-shell.xml: "If the width or height arguments are zero,
// it means the client should decide its own window dimension".

View File

@@ -127,11 +127,6 @@ public class WLFramePeer extends WLDecoratedPeer implements FramePeer {
throw new UnsupportedOperationException();
}
@Override
public void toFront() {
//throw new UnsupportedOperationException();
}
@Override
public void toBack() {
throw new UnsupportedOperationException();

View File

@@ -73,10 +73,9 @@ public abstract class WLGraphicsConfig extends GraphicsConfiguration {
@Override
public AffineTransform getNormalizingTransform() {
// TODO: may not be able to implement this fully, but we can try
// obtaining physical width/height from wl_output.geometry event.
// Those may be 0, of course.
return getDefaultTransform();
double xScale = device.getResolutionX(this) / 72.0;
double yScale = device.getResolutionY(this) / 72.0;
return new AffineTransform(xScale, 0.0, 0.0, yScale, 0.0, 0.0);
}
@Override

View File

@@ -31,6 +31,7 @@ import sun.java2d.vulkan.WLVKGraphicsConfig;
import java.awt.GraphicsConfiguration;
import java.awt.GraphicsDevice;
import java.awt.Insets;
import java.awt.Rectangle;
import java.awt.Window;
@@ -39,6 +40,7 @@ import java.awt.Window;
* in the multi-monitor setup. Whenever those change, this device is re-created.
*/
public class WLGraphicsDevice extends GraphicsDevice {
private static final double MM_IN_INCH = 25.4;
/**
* ID of the corresponding wl_output object received from Wayland.
*/
@@ -60,16 +62,21 @@ public class WLGraphicsDevice extends GraphicsDevice {
*/
private volatile int y; // only changes when the device gets invalidated
private final int widthMm;
private final int heightMm;
// Configs are always the same in size and scale
private volatile WLGraphicsConfig[] configs = null;
private volatile GraphicsConfiguration[] configs = null;
// The default config is an object from the configs array
private volatile WLGraphicsConfig defaultConfig = null;
private WLGraphicsDevice(int id, int x, int y) {
private WLGraphicsDevice(int id, int x, int y, int widthMm, int heightMm) {
this.wlID = id;
this.x = x;
this.y = y;
this.widthMm = widthMm;
this.heightMm = heightMm;
}
int getID() {
@@ -77,23 +84,30 @@ public class WLGraphicsDevice extends GraphicsDevice {
}
void updateConfiguration(String name, int width, int height, int scale) {
this.name = name == null ? "wl_output." + wlID : name;
this.name = name;
if (configs == null || configs[0].differsFrom(width, height, scale)) {
WLGraphicsConfig config = defaultConfig;
// Note that all configs are of equal size and scale
if (config == null || config.differsFrom(width, height, scale)) {
GraphicsConfiguration[] newConfigs;
WLGraphicsConfig newDefaultConfig;
// It is necessary to create a new object whenever config changes as its
// identity is used to detect changes in scale, among other things.
if (WLGraphicsEnvironment.isVulkanEnabled()) {
defaultConfig = WLVKGraphicsConfig.getConfig(this, width, height, scale);
configs = new WLGraphicsConfig[1];
configs[0] = defaultConfig;
newDefaultConfig = WLVKGraphicsConfig.getConfig(this, width, height, scale);
newConfigs = new GraphicsConfiguration[1];
newConfigs[0] = newDefaultConfig;
} else {
// TODO: Actually, Wayland may support a lot more shared memory buffer configurations, need to
// subscribe to the wl_shm:format event and get the list from there.
defaultConfig = WLSMGraphicsConfig.getConfig(this, width, height, scale, false);
configs = new WLGraphicsConfig[2];
configs[0] = defaultConfig;
configs[1] = WLSMGraphicsConfig.getConfig(this, width, height, scale, true);
newDefaultConfig = WLSMGraphicsConfig.getConfig(this, width, height, scale, false);
newConfigs = new GraphicsConfiguration[2];
newConfigs[0] = newDefaultConfig;
newConfigs[1] = WLSMGraphicsConfig.getConfig(this, width, height, scale, true);
}
configs = newConfigs;
defaultConfig = newDefaultConfig;
}
}
@@ -107,13 +121,17 @@ public class WLGraphicsDevice extends GraphicsDevice {
this.x = similarDevice.x;
this.y = similarDevice.y;
final int newScale = similarDevice.getScale();
final Rectangle newBounds = similarDevice.defaultConfig.getBounds();
int newScale = similarDevice.getScale();
Rectangle newBounds = similarDevice.defaultConfig.getBounds();
updateConfiguration(similarDevice.name, newBounds.width, newBounds.height, newScale);
}
public static WLGraphicsDevice createWithConfiguration(int id, String name, int x, int y, int width, int height, int scale) {
final WLGraphicsDevice device = new WLGraphicsDevice(id, x, y);
public static WLGraphicsDevice createWithConfiguration(int id, String name,
int x, int y,
int width, int height,
int widthMm, int heightMm,
int scale) {
WLGraphicsDevice device = new WLGraphicsDevice(id, x, y, widthMm, heightMm);
device.updateConfiguration(name, width, height, scale);
return device;
}
@@ -127,11 +145,17 @@ public class WLGraphicsDevice extends GraphicsDevice {
}
boolean hasSameNameAs(WLGraphicsDevice otherDevice) {
return name != null && otherDevice.name != null && name.equals(otherDevice.name);
var localName = name;
var otherName = otherDevice.name;
return localName != null && localName.equals(otherName);
}
boolean hasSameSizeAs(WLGraphicsDevice modelDevice) {
return defaultConfig != null && modelDevice.defaultConfig != null && defaultConfig.getBounds().equals(modelDevice.defaultConfig.getBounds());
var config = defaultConfig;
var modelConfig = modelDevice.defaultConfig;
return config != null
&& modelConfig != null
&& config.getBounds().equals(modelConfig.getBounds());
}
@Override
@@ -163,6 +187,27 @@ public class WLGraphicsDevice extends GraphicsDevice {
return defaultConfig.getScale();
}
int getResolution() {
Rectangle bounds = defaultConfig.getBounds();
if (bounds.width == 0 || bounds.height == 0) return 0;
double diagonalPixel = Math.sqrt(bounds.width * bounds.width + bounds.height * bounds.height);
double diagonalMm = Math.sqrt(widthMm * widthMm + heightMm * heightMm);
return (int) (diagonalPixel / diagonalMm * MM_IN_INCH);
}
int getResolutionX(WLGraphicsConfig config) {
Rectangle bounds = config.getBounds();
if (bounds.width == 0) return 0;
return (int)((double)bounds.width / widthMm * MM_IN_INCH);
}
int getResolutionY(WLGraphicsConfig config) {
Rectangle bounds = config.getBounds();
if (bounds.height == 0) return 0;
return (int)((double)bounds.height / heightMm * MM_IN_INCH);
}
@Override
public boolean isFullScreenSupported() {
return true;
@@ -211,8 +256,13 @@ public class WLGraphicsDevice extends GraphicsDevice {
@Override
public String toString() {
return String.format("WLGraphicsDevice: id=%d at (%d, %d) with %s",
wlID, x, y,
defaultConfig != null ? defaultConfig : "<no configs>");
var config = defaultConfig;
return String.format("WLGraphicsDevice: '%s' id=%d at (%d, %d) with %s",
name, wlID, x, y,
config != null ? config : "<no configs>");
}
public Insets getInsets() {
return new Insets(0, 0, 0, 0);
}
}

View File

@@ -45,23 +45,43 @@ public class WLGraphicsEnvironment extends SunGraphicsEnvironment {
private static final PlatformLogger log = PlatformLogger.getLogger("sun.awt.wl.WLGraphicsEnvironment");
private static boolean vulkanEnabled = false;
private static boolean verboseVulkanStatus = false;
private static boolean vulkanRequested = false;
private static int vulkanRequestedDeviceNumber = -1;
@SuppressWarnings("removal")
private static boolean vulkanRequested =
private static String vulkanOption =
AccessController.doPrivileged(
(PrivilegedAction<Boolean>) () ->
"true".equals(System.getProperty("sun.java2d.vulkan")));
(PrivilegedAction<String>) () -> System.getProperty("sun.java2d.vulkan", ""));
@SuppressWarnings("removal")
private static String vulkanOptionDeviceNumber =
AccessController.doPrivileged(
(PrivilegedAction<String>) () -> System.getProperty("sun.java2d.vulkan.deviceNumber", "0"));
static {
vulkanRequested = "true".equalsIgnoreCase(vulkanOption);
try {
vulkanRequestedDeviceNumber = Integer.parseInt(vulkanOptionDeviceNumber);
} catch (NumberFormatException e) {
log.warning("Invalid Vulkan device number:" + vulkanOptionDeviceNumber);
}
verboseVulkanStatus = "True".equals(vulkanOption);
System.loadLibrary("awt");
SurfaceManagerFactory.setInstance(new UnixSurfaceManagerFactory());
if (vulkanRequested) {
vulkanEnabled = initVKWL();
vulkanEnabled = initVKWL(verboseVulkanStatus, vulkanRequestedDeviceNumber);
}
if (log.isLoggable(Level.FINE)) {
log.fine("Vulkan rendering enabled: " + (vulkanEnabled?"YES":"NO"));
}
// Make sure the toolkit is loaded because otherwise this GE is going to be empty
WLToolkit.isInitialized();
}
private static native boolean initVKWL();
private static native boolean initVKWL(boolean verbose, int deviceNumber);
private WLGraphicsEnvironment() {
}
@@ -100,7 +120,8 @@ public class WLGraphicsEnvironment extends SunGraphicsEnvironment {
private final List<WLGraphicsDevice> devices = new ArrayList<>(5);
private void notifyOutputConfigured(String name, int wlID, int x, int y, int width, int height,
private void notifyOutputConfigured(String name, String make, String model, int wlID,
int x, int y, int width, int height, int widthMm, int heightMm,
int subpixel, int transform, int scale) {
// Called from native code whenever a new output appears or an existing one changes its properties
// NB: initially called during WLToolkit.initIDs() on the main thread; later on EDT.
@@ -108,6 +129,10 @@ public class WLGraphicsEnvironment extends SunGraphicsEnvironment {
log.fine(String.format("Output configured id=%d at (%d, %d) %dx%d %dx scale", wlID, x, y, width, height, scale));
}
String humanID =
(name != null ? name + " " : "")
+ (make != null ? make + " " : "")
+ (model != null ? model : "");
synchronized (devices) {
boolean newOutput = true;
for (int i = 0; i < devices.size(); i++) {
@@ -115,9 +140,10 @@ public class WLGraphicsEnvironment extends SunGraphicsEnvironment {
if (gd.getID() == wlID) {
newOutput = false;
if (gd.isSameDeviceAs(wlID, x, y)) {
gd.updateConfiguration(name, width, height, scale);
gd.updateConfiguration(humanID, width, height, scale);
} else {
final WLGraphicsDevice updatedDevice = WLGraphicsDevice.createWithConfiguration(wlID, name, x, y, width, height, scale);
final WLGraphicsDevice updatedDevice = WLGraphicsDevice.createWithConfiguration(wlID, humanID,
x, y, width, height, widthMm, heightMm, scale);
devices.set(i, updatedDevice);
gd.invalidate(updatedDevice);
}
@@ -125,7 +151,8 @@ public class WLGraphicsEnvironment extends SunGraphicsEnvironment {
}
}
if (newOutput) {
final WLGraphicsDevice gd = WLGraphicsDevice.createWithConfiguration(wlID, name, x, y, width, height, scale);
final WLGraphicsDevice gd = WLGraphicsDevice.createWithConfiguration(wlID, humanID, x, y,
width, height, widthMm, heightMm, scale);
devices.add(gd);
}
}

View File

@@ -35,7 +35,7 @@ public class WLKeyboardFocusManagerPeer extends KeyboardFocusManagerPeerImpl {
@Override
public void setCurrentFocusOwner(Component comp) {
if (comp != currentFocusedWindow) {
if (comp != null && comp != currentFocusedWindow) {
// In Wayland, only Window can be focused, not any widget in it.
focusLog.severe("Unexpected focus owner set in a Window: " + comp);
}

View File

@@ -28,6 +28,7 @@ package sun.awt.wl;
import jdk.internal.misc.InnocuousThread;
import sun.awt.AWTAccessor;
import sun.awt.AWTAutoShutdown;
import sun.awt.AppContext;
import sun.awt.LightweightFrame;
import sun.awt.PeerEvent;
@@ -204,12 +205,14 @@ public class WLToolkit extends UNIXToolkit implements Runnable {
@Override
public void run() {
while(true) {
AWTAutoShutdown.notifyToolkitThreadFree(); // will now wait for events
int result = readEvents();
if (result == READ_RESULT_ERROR) {
log.severe("Wayland protocol I/O error");
// TODO: display disconnect handling here?
break;
} else if (result == READ_RESULT_FINISHED_WITH_EVENTS) {
AWTAutoShutdown.notifyToolkitThreadBusy(); // busy processing events
SunToolkit.postEvent(AppContext.getAppContext(), new PeerEvent(this, () -> {
WLToolkit.awtLock();
try {
@@ -234,7 +237,7 @@ public class WLToolkit extends UNIXToolkit implements Runnable {
* the next click is considered separate and not part of multi-click event.
* @return maximum milliseconds between same mouse button clicks for them to be a multiclick
*/
static long getMulticlickTime() {
static int getMulticlickTime() {
/* TODO: get from the system somehow */
return AWT_MULTICLICK_DEFAULT_TIME_MS;
}
@@ -814,8 +817,8 @@ public class WLToolkit extends UNIXToolkit implements Runnable {
@Override
public int getScreenResolution() {
// TODO
return 150;
var defaultScreen = (WLGraphicsDevice)WLGraphicsEnvironment.getSingleInstance().getDefaultScreenDevice();
return defaultScreen.getResolution();
}
/**
@@ -855,8 +858,14 @@ public class WLToolkit extends UNIXToolkit implements Runnable {
protected void initializeDesktopProperties() {
super.initializeDesktopProperties();
desktopProperties.put("DnD.Autoscroll.initialDelay", 50);
desktopProperties.put("DnD.Autoscroll.interval", 50);
desktopProperties.put("DnD.Autoscroll.cursorHysteresis", 5);
desktopProperties.put("Shell.shellFolderManager", "sun.awt.shell.ShellFolderManager");
if (!GraphicsEnvironment.isHeadless()) {
desktopProperties.put("awt.mouse.numButtons", MOUSE_BUTTONS_COUNT);
desktopProperties.put("awt.multiClickInterval", getMulticlickTime());
desktopProperties.put("awt.mouse.numButtons", getNumberOfButtons());
}
}
@@ -996,6 +1005,17 @@ public class WLToolkit extends UNIXToolkit implements Runnable {
flushImpl();
}
@Override
public Insets getScreenInsets(final GraphicsConfiguration gc) {
final GraphicsDevice gd = gc.getDevice();
if (gd instanceof WLGraphicsDevice device) {
Insets insets = device.getInsets();
return (Insets) insets.clone();
} else {
return super.getScreenInsets(gc);
}
}
private native int readEvents();
private native void dispatchEventsOnEDT();
private native void flushImpl();

View File

@@ -89,7 +89,7 @@ public class WLWindowPeer extends WLComponentPeer implements WindowPeer {
@Override
public void toFront() {
// TODO
activate();
}
@Override

View File

@@ -82,22 +82,9 @@ ReportFatalError(const char* file, int line, const char *msg)
assert(0);
}
static inline void
AssertCalledOnEDT(const char* file, int line)
{
char threadName[16];
pthread_getname_np(pthread_self(), threadName, sizeof(threadName));
if (strncmp(threadName, "AWT-EventQueue", 14) != 0) {
fprintf(stderr, "Assert failed (called on %s instead of EDT) at %s:%d\n", threadName, file, line);
fflush(stderr);
assert(0);
}
}
static void
AssertDrawLockIsHeld(WLSurfaceBufferManager* manager, const char * file, int line);
#define ASSERT_ON_EDT() AssertCalledOnEDT(__FILE__, __LINE__)
#define WL_FATAL_ERROR(msg) ReportFatalError(__FILE__, __LINE__, msg)
#define ASSERT_DRAW_LOCK_IS_HELD(manager) AssertDrawLockIsHeld(manager, __FILE__, __LINE__)
#define ASSERT_SHOW_LOCK_IS_HELD(manager) AssertShowLockIsHeld(manager, __FILE__, __LINE__)
@@ -770,7 +757,7 @@ WLSBM_Create(jint width, jint height, jint scale, jint bgPixel, jint wlShmFormat
// both read from and written to (when scrolling, for instance).
// So it needs to be able to be "locked" twice: once for writing and
// once for reading.
pthread_mutexattr_settype(&attr, PTHREAD_MUTEX_RECURSIVE_NP);
pthread_mutexattr_settype(&attr, PTHREAD_MUTEX_RECURSIVE);
pthread_mutex_init(&manager->drawLock, &attr);
DrawBufferCreate(manager);
ShowBufferCreate(manager);

View File

@@ -261,7 +261,7 @@ Java_sun_java2d_wl_WLSMSurfaceData_initOps(JNIEnv *env, jobject wsd,
// Recursive mutex is required because blit can be done with both source
// and destination being the same surface (during scrolling, for example).
// So WLSD_Lock() should be able to lock the same surface twice in a row.
pthread_mutexattr_settype(&attr, PTHREAD_MUTEX_RECURSIVE_NP);
pthread_mutexattr_settype(&attr, PTHREAD_MUTEX_RECURSIVE);
pthread_mutex_init(&wsdo->lock, &attr);
#endif /* !HEADLESS */
}

View File

@@ -280,8 +280,11 @@ JNI_OnUnload(JavaVM *vm, void *reserved) {
#define TEXT_AA_LCD_VRGB 6
#define TEXT_AA_LCD_VBGR 7
static void setRenderingFontHintsField(FcPattern* matchPattern, const char* property, int* value) {
if (FcResultMatch != (*fcPatternGetBool)(matchPattern, property, 0, value)) {
typedef FcResult (*FcPatternGetValueFuncType)(const FcPattern *p, const char *object, int n, void *b);
static void setRenderingFontHintsField(FcPatternGetValueFuncType fcPatternGetValue, FcPattern* matchPattern,
const char* property, int* value) {
if (FcResultMatch != (*fcPatternGetValue)(matchPattern, property, 0, value)) {
*value = -1;
}
}
@@ -292,10 +295,13 @@ JNIEXPORT int setupRenderingFontHints
FcPattern *pattern, *matchPattern;
FcResult result;
if (fcName == NULL) {
if (usingFontConfig() == false) {
return -1;
}
if (fcName == NULL) {
return -1;
}
pattern = (*fcNameParse)((FcChar8 *)fcName);
if (locale != NULL) {
(*fcPatternAddString)(pattern, FC_LANG, (unsigned char*)locale);
@@ -312,13 +318,19 @@ JNIEXPORT int setupRenderingFontHints
*/
if (matchPattern) {
// Extract values from result
setRenderingFontHintsField(matchPattern, FC_HINTING, &renderingFontHints->fcHinting);
setRenderingFontHintsField(matchPattern, FC_HINT_STYLE, &renderingFontHints->fcHintStyle);
setRenderingFontHintsField(matchPattern, FC_ANTIALIAS, &renderingFontHints->fcAntialias);
setRenderingFontHintsField(matchPattern, FC_AUTOHINT, &renderingFontHints->fcAutohint);
setRenderingFontHintsField(matchPattern, FC_LCD_FILTER, &renderingFontHints->fcRGBA);
setRenderingFontHintsField(matchPattern, FC_RGBA, &renderingFontHints->fcLCDFilter);
setRenderingFontHintsField((FcPatternGetValueFuncType)(fcPatternGetBool), matchPattern, FC_HINTING,
&renderingFontHints->fcHinting);
setRenderingFontHintsField((FcPatternGetValueFuncType)(fcPatternGetInteger), matchPattern, FC_HINT_STYLE,
&renderingFontHints->fcHintStyle);
setRenderingFontHintsField((FcPatternGetValueFuncType)(fcPatternGetBool), matchPattern, FC_ANTIALIAS,
&renderingFontHints->fcAntialias);
setRenderingFontHintsField((FcPatternGetValueFuncType)(fcPatternGetBool), matchPattern, FC_AUTOHINT,
&renderingFontHints->fcAutohint);
setRenderingFontHintsField((FcPatternGetValueFuncType)(fcPatternGetInteger), matchPattern, FC_RGBA,
&renderingFontHints->fcRGBA);
setRenderingFontHintsField((FcPatternGetValueFuncType)(fcPatternGetInteger), matchPattern, FC_LCD_FILTER,
&renderingFontHints->fcLCDFilter);
(*fcPatternDestroy)(matchPattern);
}
(*fcPatternDestroy)(pattern);

View File

@@ -44,12 +44,53 @@ static jmethodID notifyConfiguredMID;
static jmethodID notifyEnteredOutputMID;
static jmethodID notifyLeftOutputMID;
struct activation_token_list_item {
struct xdg_activation_token_v1 *token;
struct activation_token_list_item *next_item;
};
static struct activation_token_list_item *add_token(struct activation_token_list_item *list,
struct xdg_activation_token_v1 *token_to_add) {
struct activation_token_list_item *new_item =
(struct activation_token_list_item *) calloc(1, sizeof(struct activation_token_list_item));
new_item->token = token_to_add;
new_item->next_item = list;
return new_item;
}
static struct activation_token_list_item *delete_last_token(struct activation_token_list_item *list) {
assert(list);
xdg_activation_token_v1_destroy(list->token);
struct activation_token_list_item *next_item = list->next_item;
free(list);
return next_item;
}
static struct activation_token_list_item *delete_token(struct activation_token_list_item *list,
struct xdg_activation_token_v1 *token_to_delete) {
if (list == NULL) {
return NULL;
} else if (list->token == token_to_delete) {
return delete_last_token(list);
} else {
list->next_item = delete_token(list->next_item, token_to_delete);
return list;
}
}
static void delete_all_tokens(struct activation_token_list_item *list) {
while (list) {
list = delete_last_token(list);
}
}
struct WLFrame {
jobject nativeFramePeer; // weak reference
struct wl_surface *wl_surface;
struct xdg_surface *xdg_surface;
struct WLFrame *parent;
struct xdg_positioner *xdg_positioner;
struct activation_token_list_item *activation_token_list;
jboolean toplevel;
union {
struct xdg_toplevel *xdg_toplevel;
@@ -224,6 +265,22 @@ static const struct xdg_popup_listener xdg_popup_listener = {
.popup_done = xdg_popup_done,
};
static void
xdg_activation_token_v1_done(void *data,
struct xdg_activation_token_v1 *xdg_activation_token_v1,
const char *token) {
struct WLFrame *frame = (struct WLFrame *) data;
assert(frame);
struct wl_surface *surface = frame->wl_surface;
assert(surface);
xdg_activation_v1_activate(xdg_activation_v1, token, surface);
frame->activation_token_list = delete_token(frame->activation_token_list, xdg_activation_token_v1);
}
static const struct xdg_activation_token_v1_listener xdg_activation_token_v1_listener = {
.done = xdg_activation_token_v1_done,
};
JNIEXPORT void JNICALL
Java_sun_awt_wl_WLComponentPeer_initIDs
(JNIEnv *env, jclass clazz)
@@ -438,8 +495,13 @@ DoHide(struct WLFrame *frame)
} else {
xdg_popup_destroy(frame->xdg_popup);
}
if (wl_surface_in_focus == frame->wl_surface) {
wl_surface_in_focus = NULL;
}
xdg_surface_destroy(frame->xdg_surface);
wl_surface_destroy(frame->wl_surface);
delete_all_tokens(frame->activation_token_list);
frame->activation_token_list = NULL;
frame->wl_surface = NULL;
frame->xdg_surface = NULL;
frame->xdg_toplevel = NULL;
@@ -525,3 +587,20 @@ JNIEXPORT void JNICALL Java_sun_awt_wl_WLComponentPeer_nativeShowWindowMenu
xdg_toplevel_show_window_menu(frame->xdg_toplevel, wl_seat, last_mouse_pressed_serial, x, y);
}
}
JNIEXPORT void JNICALL
Java_sun_awt_wl_WLComponentPeer_nativeActivate
(JNIEnv *env, jobject obj, jlong ptr)
{
struct WLFrame *frame = jlong_to_ptr(ptr);
if (frame->wl_surface && xdg_activation_v1 && wl_seat) {
struct xdg_activation_token_v1 *token = xdg_activation_v1_get_activation_token(xdg_activation_v1);
xdg_activation_token_v1_add_listener(token, &xdg_activation_token_v1_listener, frame);
xdg_activation_token_v1_set_serial(token, last_input_or_focus_serial, wl_seat);
if (wl_surface_in_focus) {
xdg_activation_token_v1_set_surface(token, wl_surface_in_focus);
}
xdg_activation_token_v1_commit(token);
frame->activation_token_list = add_token(frame->activation_token_list, token);
}
}

View File

@@ -43,11 +43,15 @@ typedef struct WLOutput {
int32_t y;
int32_t width;
int32_t height;
int32_t width_mm;
int32_t height_mm;
uint32_t subpixel;
uint32_t transform;
uint32_t scale;
char * make;
char * model;
char * name;
} WLOutput;
@@ -79,6 +83,10 @@ wl_output_geometry(
output->y = y;
output->subpixel = subpixel;
output->transform = transform;
output->width_mm = physical_width;
output->height_mm = physical_height;
output->make = make != NULL ? strdup(make) : NULL;
output->model = model != NULL ? strdup(model) : NULL;
}
static void
@@ -138,16 +146,23 @@ wl_output_done(
JNIEnv *env = getEnv();
jobject obj = (*env)->CallStaticObjectMethod(env, geClass, getSingleInstanceMID);
JNU_CHECK_EXCEPTION(env);
CHECK_NULL_THROW_IE(env, obj, "WLGraphicsEnvironment.getSingleInstance() returned null");
jstring outputName = output->name ? JNU_NewStringPlatform(env, output->name) : NULL;
jstring name = output->name ? JNU_NewStringPlatform(env, output->name) : NULL;
jstring make = output->make ? JNU_NewStringPlatform(env, output->make) : NULL;
jstring model = output->model ? JNU_NewStringPlatform(env, output->model) : NULL;
JNU_CHECK_EXCEPTION(env);
(*env)->CallVoidMethod(env, obj, notifyOutputConfiguredMID,
outputName,
name,
make,
model,
output->id,
output->x,
output->y,
output->width,
output->height,
output->width_mm,
output->height_mm,
(jint)output->subpixel,
(jint)output->transform,
(jint)output->scale);
@@ -182,7 +197,7 @@ WLGraphicsEnvironment_initIDs
CHECK_NULL_RETURN(
notifyOutputConfiguredMID = (*env)->GetMethodID(env, clazz,
"notifyOutputConfigured",
"(Ljava/lang/String;IIIIIIII)V"),
"(Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;IIIIIIIIII)V"),
JNI_FALSE);
CHECK_NULL_RETURN(
notifyOutputDestroyedMID = (*env)->GetMethodID(env, clazz,
@@ -221,6 +236,8 @@ WLOutputDeregister(struct wl_registry *wl_registry, uint32_t id)
wl_output_destroy(cur->wl_output);
WLOutput * next = cur->next;
free(cur->name);
free(cur->make);
free(cur->model);
free(cur);
cur = next;
} else {
@@ -266,7 +283,7 @@ WLOutputByID(uint32_t id)
* Signature: ()Z
*/
JNIEXPORT jboolean JNICALL
Java_sun_awt_wl_WLGraphicsEnvironment_initVKWL(JNIEnv *env, jclass wlge)
Java_sun_awt_wl_WLGraphicsEnvironment_initVKWL(JNIEnv *env, jclass wlge, jboolean verbose, jint requestedDevice)
{
jboolean vkwlAvailable = JNI_FALSE;
/* TODO: The following sequence lead to uninitialized awt lock
@@ -278,7 +295,7 @@ Java_sun_awt_wl_WLGraphicsEnvironment_initVKWL(JNIEnv *env, jclass wlge)
WLGraphicsEnvironment.initVKWL()
*/
//AWT_LOCK();
vkwlAvailable = VK_Init();
vkwlAvailable = VK_Init(verbose, requestedDevice);
//AWT_UNLOCK();
return vkwlAvailable;
}

View File

@@ -58,6 +58,7 @@ struct wl_display *wl_display = NULL;
struct wl_shm *wl_shm = NULL;
struct wl_compositor *wl_compositor = NULL;
struct xdg_wm_base *xdg_wm_base = NULL;
struct xdg_activation_v1 *xdg_activation_v1 = NULL;
struct wl_seat *wl_seat = NULL;
struct wl_keyboard *wl_keyboard;
@@ -65,8 +66,11 @@ struct wl_pointer *wl_pointer;
struct wl_cursor_theme *wl_cursor_theme = NULL;
struct wl_surface *wl_surface_in_focus = NULL;
uint32_t last_mouse_pressed_serial = 0;
uint32_t last_pointer_enter_serial = 0;
uint32_t last_input_or_focus_serial = 0;
static uint32_t num_of_outstanding_sync = 0;
@@ -311,6 +315,7 @@ wl_pointer_button(void *data, struct wl_pointer *wl_pointer, uint32_t serial,
pointer_event.button = button,
pointer_event.state = state;
if (state) {
last_input_or_focus_serial = serial;
last_mouse_pressed_serial = serial;
}
}
@@ -452,6 +457,9 @@ static void
wl_keyboard_enter(void *data, struct wl_keyboard *wl_keyboard,
uint32_t serial, struct wl_surface *surface, struct wl_array *keys)
{
wl_surface_in_focus = surface;
last_input_or_focus_serial = serial;
JNIEnv* env = getEnv();
(*env)->CallStaticVoidMethod(env,
tkClass,
@@ -481,6 +489,8 @@ static void
wl_keyboard_key(void *data, struct wl_keyboard *wl_keyboard,
uint32_t serial, uint32_t time, uint32_t evdev_key, uint32_t state)
{
last_input_or_focus_serial = serial;
const uint32_t scancode = evdev_key + 8;
const uint32_t keychar32 = xkb_ifs.xkb_state_key_get_utf32(xkb_state, scancode);
const xkb_keysym_t keysym = xkb_ifs.xkb_state_key_get_one_sym(xkb_state, scancode);
@@ -503,6 +513,8 @@ static void
wl_keyboard_leave(void *data, struct wl_keyboard *wl_keyboard,
uint32_t serial, struct wl_surface *surface)
{
wl_surface_in_focus = NULL;
JNIEnv* env = getEnv();
(*env)->CallStaticVoidMethod(env,
tkClass,
@@ -518,6 +530,8 @@ wl_keyboard_modifiers(void *data, struct wl_keyboard *wl_keyboard,
uint32_t mods_latched, uint32_t mods_locked,
uint32_t group)
{
last_input_or_focus_serial = serial;
xkb_ifs.xkb_state_update_mask(xkb_state,
mods_depressed,
mods_latched,
@@ -668,6 +682,8 @@ registry_global(void *data, struct wl_registry *wl_registry,
} else if (strcmp(interface, wl_output_interface.name) == 0) {
WLOutputRegister(wl_registry, name);
process_new_listener_before_end_of_init();
} else if (strcmp(interface, xdg_activation_v1_interface.name) == 0) {
xdg_activation_v1 = wl_registry_bind(wl_registry, name, &xdg_activation_v1_interface, 1);
}
#ifdef WAKEFIELD_ROBOT
else if (strcmp(interface, wakefield_interface.name) == 0) {

View File

@@ -26,6 +26,7 @@
#include <wayland-client.h>
#include <wayland-cursor.h>
#include "xdg-shell-client-protocol.h"
#include "xdg-activation-v1-client-protocol.h"
#define CHECK_NULL_THROW_OOME_RETURN(env, x, msg, z)\
do { \
@@ -48,10 +49,14 @@ extern struct wl_display *wl_display;
extern struct wl_pointer *wl_pointer;
extern struct wl_compositor *wl_compositor;
extern struct xdg_wm_base *xdg_wm_base;
extern struct xdg_activation_v1 *xdg_activation_v1;
extern struct wl_cursor_theme *wl_cursor_theme;
extern struct wl_surface *wl_surface_in_focus;
extern uint32_t last_mouse_pressed_serial;
extern uint32_t last_pointer_enter_serial;
extern uint32_t last_input_or_focus_serial;
JNIEnv *getEnv();

View File

@@ -0,0 +1,413 @@
/* Generated by wayland-scanner 1.18.0 */
#ifndef XDG_ACTIVATION_V1_CLIENT_PROTOCOL_H
#define XDG_ACTIVATION_V1_CLIENT_PROTOCOL_H
#include <stdint.h>
#include <stddef.h>
#include "wayland-client.h"
#ifdef __cplusplus
extern "C" {
#endif
/**
* @page page_xdg_activation_v1 The xdg_activation_v1 protocol
* Protocol for requesting activation of surfaces
*
* @section page_desc_xdg_activation_v1 Description
*
* The way for a client to pass focus to another toplevel is as follows.
*
* The client that intends to activate another toplevel uses the
* xdg_activation_v1.get_activation_token request to get an activation token.
* This token is then forwarded to the client, which is supposed to activate
* one of its surfaces, through a separate band of communication.
*
* One established way of doing this is through the XDG_ACTIVATION_TOKEN
* environment variable of a newly launched child process. The child process
* should unset the environment variable again right after reading it out in
* order to avoid propagating it to other child processes.
*
* Another established way exists for Applications implementing the D-Bus
* interface org.freedesktop.Application, which should get their token under
* XDG_ACTIVATION_TOKEN on their platform_data.
*
* In general activation tokens may be transferred across clients through
* means not described in this protocol.
*
* The client to be activated will then pass the token
* it received to the xdg_activation_v1.activate request. The compositor can
* then use this token to decide how to react to the activation request.
*
* The token the activating client gets may be ineffective either already at
* the time it receives it, for example if it was not focused, for focus
* stealing prevention. The activating client will have no way to discover
* the validity of the token, and may still forward it to the to be activated
* client.
*
* The created activation token may optionally get information attached to it
* that can be used by the compositor to identify the application that we
* intend to activate. This can for example be used to display a visual hint
* about what application is being started.
*
* Warning! The protocol described in this file is currently in the testing
* phase. Backward compatible changes may be added together with the
* corresponding interface version bump. Backward incompatible changes can
* only be done by creating a new major version of the extension.
*
* @section page_ifaces_xdg_activation_v1 Interfaces
* - @subpage page_iface_xdg_activation_v1 - interface for activating surfaces
* - @subpage page_iface_xdg_activation_token_v1 - an exported activation handle
* @section page_copyright_xdg_activation_v1 Copyright
* <pre>
*
* Copyright © 2020 Aleix Pol Gonzalez <aleixpol@kde.org>
* Copyright © 2020 Carlos Garnacho <carlosg@gnome.org>
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the "Software"),
* to deal in the Software without restriction, including without limitation
* the rights to use, copy, modify, merge, publish, distribute, sublicense,
* and/or sell copies of the Software, and to permit persons to whom the
* Software is furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice (including the next
* paragraph) shall be included in all copies or substantial portions of the
* Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
* DEALINGS IN THE SOFTWARE.
* </pre>
*/
struct wl_seat;
struct wl_surface;
struct xdg_activation_token_v1;
struct xdg_activation_v1;
/**
* @page page_iface_xdg_activation_v1 xdg_activation_v1
* @section page_iface_xdg_activation_v1_desc Description
*
* A global interface used for informing the compositor about applications
* being activated or started, or for applications to request to be
* activated.
* @section page_iface_xdg_activation_v1_api API
* See @ref iface_xdg_activation_v1.
*/
/**
* @defgroup iface_xdg_activation_v1 The xdg_activation_v1 interface
*
* A global interface used for informing the compositor about applications
* being activated or started, or for applications to request to be
* activated.
*/
extern const struct wl_interface xdg_activation_v1_interface;
/**
* @page page_iface_xdg_activation_token_v1 xdg_activation_token_v1
* @section page_iface_xdg_activation_token_v1_desc Description
*
* An object for setting up a token and receiving a token handle that can
* be passed as an activation token to another client.
*
* The object is created using the xdg_activation_v1.get_activation_token
* request. This object should then be populated with the app_id, surface
* and serial information and committed. The compositor shall then issue a
* done event with the token. In case the request's parameters are invalid,
* the compositor will provide an invalid token.
* @section page_iface_xdg_activation_token_v1_api API
* See @ref iface_xdg_activation_token_v1.
*/
/**
* @defgroup iface_xdg_activation_token_v1 The xdg_activation_token_v1 interface
*
* An object for setting up a token and receiving a token handle that can
* be passed as an activation token to another client.
*
* The object is created using the xdg_activation_v1.get_activation_token
* request. This object should then be populated with the app_id, surface
* and serial information and committed. The compositor shall then issue a
* done event with the token. In case the request's parameters are invalid,
* the compositor will provide an invalid token.
*/
extern const struct wl_interface xdg_activation_token_v1_interface;
#define XDG_ACTIVATION_V1_DESTROY 0
#define XDG_ACTIVATION_V1_GET_ACTIVATION_TOKEN 1
#define XDG_ACTIVATION_V1_ACTIVATE 2
/**
* @ingroup iface_xdg_activation_v1
*/
#define XDG_ACTIVATION_V1_DESTROY_SINCE_VERSION 1
/**
* @ingroup iface_xdg_activation_v1
*/
#define XDG_ACTIVATION_V1_GET_ACTIVATION_TOKEN_SINCE_VERSION 1
/**
* @ingroup iface_xdg_activation_v1
*/
#define XDG_ACTIVATION_V1_ACTIVATE_SINCE_VERSION 1
/** @ingroup iface_xdg_activation_v1 */
static inline void
xdg_activation_v1_set_user_data(struct xdg_activation_v1 *xdg_activation_v1, void *user_data)
{
wl_proxy_set_user_data((struct wl_proxy *) xdg_activation_v1, user_data);
}
/** @ingroup iface_xdg_activation_v1 */
static inline void *
xdg_activation_v1_get_user_data(struct xdg_activation_v1 *xdg_activation_v1)
{
return wl_proxy_get_user_data((struct wl_proxy *) xdg_activation_v1);
}
static inline uint32_t
xdg_activation_v1_get_version(struct xdg_activation_v1 *xdg_activation_v1)
{
return wl_proxy_get_version((struct wl_proxy *) xdg_activation_v1);
}
/**
* @ingroup iface_xdg_activation_v1
*
* Notify the compositor that the xdg_activation object will no longer be
* used.
*
* The child objects created via this interface are unaffected and should
* be destroyed separately.
*/
static inline void
xdg_activation_v1_destroy(struct xdg_activation_v1 *xdg_activation_v1)
{
wl_proxy_marshal((struct wl_proxy *) xdg_activation_v1,
XDG_ACTIVATION_V1_DESTROY);
wl_proxy_destroy((struct wl_proxy *) xdg_activation_v1);
}
/**
* @ingroup iface_xdg_activation_v1
*
* Creates an xdg_activation_token_v1 object that will provide
* the initiating client with a unique token for this activation. This
* token should be offered to the clients to be activated.
*/
static inline struct xdg_activation_token_v1 *
xdg_activation_v1_get_activation_token(struct xdg_activation_v1 *xdg_activation_v1)
{
struct wl_proxy *id;
id = wl_proxy_marshal_constructor((struct wl_proxy *) xdg_activation_v1,
XDG_ACTIVATION_V1_GET_ACTIVATION_TOKEN, &xdg_activation_token_v1_interface, NULL);
return (struct xdg_activation_token_v1 *) id;
}
/**
* @ingroup iface_xdg_activation_v1
*
* Requests surface activation. It's up to the compositor to display
* this information as desired, for example by placing the surface above
* the rest.
*
* The compositor may know who requested this by checking the activation
* token and might decide not to follow through with the activation if it's
* considered unwanted.
*
* Compositors can ignore unknown activation tokens when an invalid
* token is passed.
*/
static inline void
xdg_activation_v1_activate(struct xdg_activation_v1 *xdg_activation_v1, const char *token, struct wl_surface *surface)
{
wl_proxy_marshal((struct wl_proxy *) xdg_activation_v1,
XDG_ACTIVATION_V1_ACTIVATE, token, surface);
}
#ifndef XDG_ACTIVATION_TOKEN_V1_ERROR_ENUM
#define XDG_ACTIVATION_TOKEN_V1_ERROR_ENUM
enum xdg_activation_token_v1_error {
/**
* The token has already been used previously
*/
XDG_ACTIVATION_TOKEN_V1_ERROR_ALREADY_USED = 0,
};
#endif /* XDG_ACTIVATION_TOKEN_V1_ERROR_ENUM */
/**
* @ingroup iface_xdg_activation_token_v1
* @struct xdg_activation_token_v1_listener
*/
struct xdg_activation_token_v1_listener {
/**
* the exported activation token
*
* The 'done' event contains the unique token of this activation
* request and notifies that the provider is done.
* @param token the exported activation token
*/
void (*done)(void *data,
struct xdg_activation_token_v1 *xdg_activation_token_v1,
const char *token);
};
/**
* @ingroup iface_xdg_activation_token_v1
*/
static inline int
xdg_activation_token_v1_add_listener(struct xdg_activation_token_v1 *xdg_activation_token_v1,
const struct xdg_activation_token_v1_listener *listener, void *data)
{
return wl_proxy_add_listener((struct wl_proxy *) xdg_activation_token_v1,
(void (**)(void)) listener, data);
}
#define XDG_ACTIVATION_TOKEN_V1_SET_SERIAL 0
#define XDG_ACTIVATION_TOKEN_V1_SET_APP_ID 1
#define XDG_ACTIVATION_TOKEN_V1_SET_SURFACE 2
#define XDG_ACTIVATION_TOKEN_V1_COMMIT 3
#define XDG_ACTIVATION_TOKEN_V1_DESTROY 4
/**
* @ingroup iface_xdg_activation_token_v1
*/
#define XDG_ACTIVATION_TOKEN_V1_DONE_SINCE_VERSION 1
/**
* @ingroup iface_xdg_activation_token_v1
*/
#define XDG_ACTIVATION_TOKEN_V1_SET_SERIAL_SINCE_VERSION 1
/**
* @ingroup iface_xdg_activation_token_v1
*/
#define XDG_ACTIVATION_TOKEN_V1_SET_APP_ID_SINCE_VERSION 1
/**
* @ingroup iface_xdg_activation_token_v1
*/
#define XDG_ACTIVATION_TOKEN_V1_SET_SURFACE_SINCE_VERSION 1
/**
* @ingroup iface_xdg_activation_token_v1
*/
#define XDG_ACTIVATION_TOKEN_V1_COMMIT_SINCE_VERSION 1
/**
* @ingroup iface_xdg_activation_token_v1
*/
#define XDG_ACTIVATION_TOKEN_V1_DESTROY_SINCE_VERSION 1
/** @ingroup iface_xdg_activation_token_v1 */
static inline void
xdg_activation_token_v1_set_user_data(struct xdg_activation_token_v1 *xdg_activation_token_v1, void *user_data)
{
wl_proxy_set_user_data((struct wl_proxy *) xdg_activation_token_v1, user_data);
}
/** @ingroup iface_xdg_activation_token_v1 */
static inline void *
xdg_activation_token_v1_get_user_data(struct xdg_activation_token_v1 *xdg_activation_token_v1)
{
return wl_proxy_get_user_data((struct wl_proxy *) xdg_activation_token_v1);
}
static inline uint32_t
xdg_activation_token_v1_get_version(struct xdg_activation_token_v1 *xdg_activation_token_v1)
{
return wl_proxy_get_version((struct wl_proxy *) xdg_activation_token_v1);
}
/**
* @ingroup iface_xdg_activation_token_v1
*
* Provides information about the seat and serial event that requested the
* token.
*
* The serial can come from an input or focus event. For instance, if a
* click triggers the launch of a third-party client, the launcher client
* should send a set_serial request with the serial and seat from the
* wl_pointer.button event.
*
* Some compositors might refuse to activate toplevels when the token
* doesn't have a valid and recent enough event serial.
*
* Must be sent before commit. This information is optional.
*/
static inline void
xdg_activation_token_v1_set_serial(struct xdg_activation_token_v1 *xdg_activation_token_v1, uint32_t serial, struct wl_seat *seat)
{
wl_proxy_marshal((struct wl_proxy *) xdg_activation_token_v1,
XDG_ACTIVATION_TOKEN_V1_SET_SERIAL, serial, seat);
}
/**
* @ingroup iface_xdg_activation_token_v1
*
* The requesting client can specify an app_id to associate the token
* being created with it.
*
* Must be sent before commit. This information is optional.
*/
static inline void
xdg_activation_token_v1_set_app_id(struct xdg_activation_token_v1 *xdg_activation_token_v1, const char *app_id)
{
wl_proxy_marshal((struct wl_proxy *) xdg_activation_token_v1,
XDG_ACTIVATION_TOKEN_V1_SET_APP_ID, app_id);
}
/**
* @ingroup iface_xdg_activation_token_v1
*
* This request sets the surface requesting the activation. Note, this is
* different from the surface that will be activated.
*
* Some compositors might refuse to activate toplevels when the token
* doesn't have a requesting surface.
*
* Must be sent before commit. This information is optional.
*/
static inline void
xdg_activation_token_v1_set_surface(struct xdg_activation_token_v1 *xdg_activation_token_v1, struct wl_surface *surface)
{
wl_proxy_marshal((struct wl_proxy *) xdg_activation_token_v1,
XDG_ACTIVATION_TOKEN_V1_SET_SURFACE, surface);
}
/**
* @ingroup iface_xdg_activation_token_v1
*
* Requests an activation token based on the different parameters that
* have been offered through set_serial, set_surface and set_app_id.
*/
static inline void
xdg_activation_token_v1_commit(struct xdg_activation_token_v1 *xdg_activation_token_v1)
{
wl_proxy_marshal((struct wl_proxy *) xdg_activation_token_v1,
XDG_ACTIVATION_TOKEN_V1_COMMIT);
}
/**
* @ingroup iface_xdg_activation_token_v1
*
* Notify the compositor that the xdg_activation_token_v1 object will no
* longer be used.
*/
static inline void
xdg_activation_token_v1_destroy(struct xdg_activation_token_v1 *xdg_activation_token_v1)
{
wl_proxy_marshal((struct wl_proxy *) xdg_activation_token_v1,
XDG_ACTIVATION_TOKEN_V1_DESTROY);
wl_proxy_destroy((struct wl_proxy *) xdg_activation_token_v1);
}
#ifdef __cplusplus
}
#endif
#endif

View File

@@ -0,0 +1,84 @@
/* Generated by wayland-scanner 1.18.0 */
/*
* Copyright © 2020 Aleix Pol Gonzalez <aleixpol@kde.org>
* Copyright © 2020 Carlos Garnacho <carlosg@gnome.org>
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the "Software"),
* to deal in the Software without restriction, including without limitation
* the rights to use, copy, modify, merge, publish, distribute, sublicense,
* and/or sell copies of the Software, and to permit persons to whom the
* Software is furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice (including the next
* paragraph) shall be included in all copies or substantial portions of the
* Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
* DEALINGS IN THE SOFTWARE.
*/
#include <stdlib.h>
#include <stdint.h>
#include "wayland-util.h"
#ifndef __has_attribute
# define __has_attribute(x) 0 /* Compatibility with non-clang compilers. */
#endif
#if (__has_attribute(visibility) || defined(__GNUC__) && __GNUC__ >= 4)
#define WL_PRIVATE __attribute__ ((visibility("hidden")))
#else
#define WL_PRIVATE
#endif
extern const struct wl_interface wl_seat_interface;
extern const struct wl_interface wl_surface_interface;
extern const struct wl_interface xdg_activation_token_v1_interface;
static const struct wl_interface *xdg_activation_v1_types[] = {
NULL,
&xdg_activation_token_v1_interface,
NULL,
&wl_surface_interface,
NULL,
&wl_seat_interface,
&wl_surface_interface,
};
static const struct wl_message xdg_activation_v1_requests[] = {
{ "destroy", "", xdg_activation_v1_types + 0 },
{ "get_activation_token", "n", xdg_activation_v1_types + 1 },
{ "activate", "so", xdg_activation_v1_types + 2 },
};
WL_PRIVATE const struct wl_interface xdg_activation_v1_interface = {
"xdg_activation_v1", 1,
3, xdg_activation_v1_requests,
0, NULL,
};
static const struct wl_message xdg_activation_token_v1_requests[] = {
{ "set_serial", "uo", xdg_activation_v1_types + 4 },
{ "set_app_id", "s", xdg_activation_v1_types + 0 },
{ "set_surface", "o", xdg_activation_v1_types + 6 },
{ "commit", "", xdg_activation_v1_types + 0 },
{ "destroy", "", xdg_activation_v1_types + 0 },
};
static const struct wl_message xdg_activation_token_v1_events[] = {
{ "done", "s", xdg_activation_v1_types + 0 },
};
WL_PRIVATE const struct wl_interface xdg_activation_token_v1_interface = {
"xdg_activation_token_v1", 1,
5, xdg_activation_token_v1_requests,
1, xdg_activation_token_v1_events,
};

View File

@@ -53,7 +53,9 @@ gtest/MetaspaceGtests.java#balanced-no-ccs initial_run generic-all
gtest/MetaspaceGtests.java#reclaim-aggressive-ndebug initial_run generic-all
gtest/LargePageGtests.java#use-large-pages initial_run linux-all,windows-all
gtest/NMTGtests.java JBR-5718 generic-all
gtest/NMTGtests.java#nmt-detail JBR-5718 generic-all
gtest/NMTGtests.java#nmt-off JBR-5718 generic-all
gtest/NMTGtests.java#nmt-summary JBR-5718 generic-all
gc/stress/TestReclaimStringsLeaksMemory.java initial_run windows-all
@@ -256,13 +258,11 @@ vmTestbase/nsk/monitoring/ThreadMXBean/ThreadInfo/Multi/Multi005/TestDescription
gc/shenandoah/mxbeans/TestChurnNotifications.java#aggressive NO_BUG macosx_all
runtime/cds/appcds/TestDumpClassListSource.java NO_BUG generic_all
runtime/cds/appcds/CommandLineFlagCombo.java NO_BUG generic_all
runtime/cds/appcds/TestDumpClassListSource.java JBR-6099 generic_all
runtime/cds/appcds/dynamicArchive/TestAutoCreateSharedArchiveNoDefaultArchive.java NO_BUG generic_all
runtime/cds/appcds/dynamicArchive/TestAutoCreateSharedArchiveUpgrade.java NO_BUG generic_all
runtime/cds/CheckDefaultArchiveFile.java NO_BUG generic_all
serviceability/jvmti/SetBreakpoint/TestManyBreakpoints.java NO_BUG linux_aarch64
vmTestbase/nsk/stress/thread/thread008.java initial_run windows-all
compiler/vectorapi/VectorRebracket128Test.java NO_BUG linux_aarch64

View File

@@ -785,3 +785,252 @@ jdk_containers_extended = \
:jdk_io \
:jdk_nio \
:jdk_svc
# Wayland tests to be executed with -Dawt.toolkit.name=WLToolkit
jdk_awt_wayland = \
:jdk_awt \
jb/java/awt/wayland \
-com/apple/eawt \
-com/apple/laf \
-sun/awt \
-java/awt/a11y \
-java/awt/applet \
-java/awt/BasicStroke/DashOffset.java \
-java/awt/BasicStroke/DashScaleMinWidth.java \
-java/awt/BasicStroke/DashZeroWidth.java \
-java/awt/BorderLayout \
-java/awt/Button \
-java/awt/Checkbox \
-java/awt/Choice \
-java/awt/Clipboard \
-java/awt/ColorClass/AlphaColorTest.java \
-java/awt/Component/7097771 \
-java/awt/Component/CompEventOnHiddenComponent \
-java/awt/Component/ComponentRedrawnTest.java \
-java/awt/Component/CreateImage \
-java/awt/Component/DimensionEncapsulation \
-java/awt/Component/F10TopToplevel \
-java/awt/Component/GetListenersTest.java \
-java/awt/Component/GetScreenLocTest \
-java/awt/Component/InsetsEncapsulation \
-java/awt/Component/isLightweightCrash \
-java/awt/Component/NativeInLightShow \
-java/awt/Component/NoUpdateUponShow \
-java/awt/Component/PaintAll \
-java/awt/Component/PrintAllXcheckJNI \
-java/awt/Component/RepaintTest.java \
-java/awt/Component/Revalidate \
-java/awt/Component/SetComponentsBounds \
-java/awt/Component/SetEnabledPerformance \
-java/awt/Component/TreeLockDeadlock \
-java/awt/Component/UpdatingBootTime \
-java/awt/Component/Validate \
-java/awt/ComponentOrientation \
-java/awt/Container \
-java/awt/Cursor \
-java/awt/datatransfer/Clipboard/GetContentsInterruptedTest.java \
-java/awt/datatransfer/ClipboardInterVMTest/ClipboardInterVMTest.java \
-java/awt/datatransfer/ConstructFlavoredObjectTest/ConstructFlavoredObjectTest.java \
-java/awt/datatransfer/CustomClassLoaderTransferTest/CustomClassLoaderTransferTest.java \
-java/awt/datatransfer/DataFlavor/DataFlavorRemoteTest.java \
-java/awt/datatransfer/DragImage/MultiResolutionDragImageTest.java \
-java/awt/datatransfer/HTMLDataFlavors/ManualHTMLDataFlavorTest.html \
-java/awt/datatransfer/ImageTransfer/ImageTransferTest.java \
-java/awt/datatransfer/Independence/IndependenceAWTTest.java \
-java/awt/datatransfer/Independence/IndependenceSwingTest.java \
-java/awt/datatransfer/SystemFlavorMap/AddFlavorTest.java \
-java/awt/datatransfer/SystemSelection/SystemSelectionAWTTest.java \
-java/awt/datatransfer/SystemSelection/SystemSelectionSwingTest.java \
-java/awt/datatransfer/UnicodeTransferTest/UnicodeTransferTest.java \
-java/awt/Debug \
-java/awt/Desktop \
-java/awt/Dialog \
-java/awt/dnd \
-java/awt/EmbeddedFrame \
-java/awt/event \
-java/awt/EventDispatchThread/HandleExceptionOnEDT/HandleExceptionOnEDT.java \
-java/awt/EventDispatchThread/LoopRobustness/LoopRobustness.java \
-java/awt/EventDispatchThread/PropertyPermissionOnEDT/PropertyPermissionOnEDT.java \
-java/awt/EventQueue/6980209/bug6980209.java \
-java/awt/FileDialog \
-java/awt/FlowLayout \
-java/awt/Focus/6378278 \
-java/awt/Focus/6382144 \
-java/awt/Focus/6401036 \
-java/awt/Focus/6981400 \
-java/awt/Focus/8000326 \
-java/awt/Focus/8013611 \
-java/awt/Focus/8073453 \
-java/awt/Focus/8282640 \
-java/awt/Focus/ActualFocusedWindowTest \
-java/awt/Focus/AppletInitialFocusTest \
-java/awt/Focus/AsyncUpFocusCycleTest.java \
-java/awt/Focus/AutoRequestFocusTest \
-java/awt/Focus/Cause \
-java/awt/Focus/ChildWindowFocusTest \
-java/awt/Focus/ChoiceFocus \
-java/awt/Focus/ClearGlobalFocusOwnerTest \
-java/awt/Focus/ClearLwQueueBreakTest \
-java/awt/Focus/ClearMostRecentFocusOwnerTest.java \
-java/awt/Focus/CloseDialogActivateOwnerTest \
-java/awt/Focus/ConsumedTabKeyTest.java \
-java/awt/Focus/ConsumeNextKeyTypedOnModalShowTest \
-java/awt/Focus/ContainerFocusAutoTransferTest \
-java/awt/Focus/DeiconifiedFrameLoosesFocus \
-java/awt/Focus/DisposedWindow \
-java/awt/Focus/EventRetargetTest.java \
-java/awt/Focus/ExtraPropChangeNotifVetoingTest.java \
-java/awt/Focus/FocusEmbeddedFrameTest \
-java/awt/Focus/FocusForRemovedComponentTest.java \
-java/awt/Focus/FocusOwnerFrameOnClick \
-java/awt/Focus/FocusSubRequestTest \
-java/awt/Focus/FocusTransitionTest \
-java/awt/Focus/FocusTraversalPolicy \
-java/awt/Focus/FocusTraversalPolicyIAE.java \
-java/awt/Focus/FrameJumpingToMouse \
-java/awt/Focus/FrameMinimizeTest \
-java/awt/Focus/IconifiedFrameFocusChangeTest \
-java/awt/Focus/InitialFocusTest.java \
-java/awt/Focus/InputVerifierTest3 \
-java/awt/Focus/KeyEventForBadFocusOwnerTest \
-java/awt/Focus/LabelScrollBarFocus.java \
-java/awt/Focus/ModalBlockedStealsFocusTest \
-java/awt/Focus/ModalDialogActivationTest \
-java/awt/Focus/ModalDialogInFocusEventTest.java \
-java/awt/Focus/ModalDialogInitialFocusTest \
-java/awt/Focus/ModalExcludedWindowClickTest \
-java/awt/Focus/MouseClickRequestFocusRaceTest \
-java/awt/Focus/NoAutotransferToDisabledCompTest \
-java/awt/Focus/NoFocusOwnerAWTTest.java \
-java/awt/Focus/NoFocusOwnerSwingTest.java \
-java/awt/Focus/NonFocusableBlockedOwnerTest \
-java/awt/Focus/NonFocusableResizableTooSmall \
-java/awt/Focus/NonFocusableWindowTest \
-java/awt/Focus/NullActiveWindowOnFocusLost \
-java/awt/Focus/OwnedWindowFocusIMECrashTest \
-java/awt/Focus/QuickTypeTest.java \
-java/awt/Focus/RemoveAfterRequest \
-java/awt/Focus/RequestFocusAndHideTest \
-java/awt/Focus/RequestFocusByCause \
-java/awt/Focus/RequestFocusToDisabledCompTest \
-java/awt/Focus/RequestOnCompWithNullParent \
-java/awt/Focus/ResetMostRecentFocusOwnerTest \
-java/awt/Focus/RestoreFocusInfiniteLoopTest.java \
-java/awt/Focus/RestoreFocusOnDisabledComponentTest \
-java/awt/Focus/RollbackFocusFromAnotherWindowTest \
-java/awt/Focus/RowToleranceTransitivityTest.java \
-java/awt/Focus/SequencedLightweightRequestsTest.java \
-java/awt/Focus/SetFocusableTest.java \
-java/awt/Focus/ShowFrameCheckForegroundTest \
-java/awt/Focus/SimpleWindowActivationTest \
-java/awt/Focus/SortingFPT \
-java/awt/Focus/TemporaryLostComponentDeadlock.java \
-java/awt/Focus/ToFrontFocusTest \
-java/awt/Focus/TranserFocusToWindow \
-java/awt/Focus/TraversalKeysPropertyNamesTest.java \
-java/awt/Focus/TypeAhead \
-java/awt/Focus/UnaccessibleChoice \
-java/awt/Focus/UpFocusCycleTest.java \
-java/awt/Focus/VetoableChangeListenerLoopTest.java \
-java/awt/Focus/WindowInitialFocusTest \
-java/awt/Focus/WindowIsFocusableAccessByThreadsTest \
-java/awt/Focus/WindowUpdateFocusabilityTest \
-java/awt/Focus/WrongKeyTypedConsumedTest \
-java/awt/font/TextLayout/MyanmarTextTest.java \
-java/awt/font/TextLayout/TestJustification.html \
-java/awt/font/TextLayout/TestOldHangul.java \
-java/awt/font/TextLayout/TestTibetan.java \
-java/awt/font/TextLayout/TestVS.java \
-java/awt/font/TextLayout/VariationSelectorTest.java \
-java/awt/FontClass/FontAccess.java \
-java/awt/Frame \
-java/awt/FullScreen/8013581 \
-java/awt/FullScreen/AllFramesMaximize \
-java/awt/FullScreen/AltTabCrashTest \
-java/awt/FullScreen/BufferStrategyExceptionTest \
-java/awt/FullScreen/FullScreenInsets \
-java/awt/FullScreen/FullscreenWindowProps \
-java/awt/FullScreen/TranslucentWindow \
-java/awt/grab \
-java/awt/Graphics/DrawOvalTest.java \
-java/awt/Graphics/LCDTextAndGraphicsState.java \
-java/awt/Graphics/TextAAHintsTest.java \
-java/awt/Graphics/XORPaint.java \
-java/awt/Graphics2D/CopyAreaOOB.java \
-java/awt/GraphicsDevice/DisplayModes/CompareToXrandrTest.java \
-java/awt/GraphicsDevice/DisplayModes/CycleDMImage.java \
-java/awt/GridBagLayout \
-java/awt/GridLayout \
-java/awt/Gtk \
-java/awt/hidpi \
-java/awt/Icon \
-java/awt/im \
-java/awt/image/BufferStrategy/ExceptionAfterComponentDispose.java \
-java/awt/image/MemoryLeakTest/MemoryLeakTest.java \
-java/awt/image/OpaquePNGToGIFTest.java \
-java/awt/image/VolatileImage/DrawBufImgOp.java \
-java/awt/image/VolatileImage/TransparentVImage.java \
-java/awt/image/mlib/MlibOpsTest.java \
-java/awt/image/multiresolution/MenuMultiresolutionIconTest.java \
-java/awt/image/multiresolution/MultiDisplayTest/MultiDisplayTest.java \
-java/awt/image/multiresolution/MultiResolutionJOptionPaneIconTest.java \
-java/awt/image/multiresolution/MultiresolutionIconTest.java \
-java/awt/Insets/CombinedTestApp1.java \
-java/awt/Insets/RemoveMenuBarTest.java \
-java/awt/InputMethods \
-java/awt/JAWT \
-java/awt/keyboard \
-java/awt/KeyboardFocusmanager/ConsumeNextMnemonicKeyTypedTest \
-java/awt/KeyboardFocusmanager/TypeAhead \
-java/awt/Label \
-java/awt/Layout \
-java/awt/LightweightComponent \
-java/awt/LightweightDispatcher \
-java/awt/List \
-java/awt/Menu \
-java/awt/MenuBar \
-java/awt/MenuItem \
-java/awt/Mixing \
-java/awt/Modal \
-java/awt/Mouse \
-java/awt/MouseAdapter \
-java/awt/MouseInfo \
-java/awt/MultipleGradientPaint \
-java/awt/Multiscreen/MouseEventTest/MouseEventTest.java \
-java/awt/Multiscreen/MultiScreenInsetsTest/MultiScreenInsetsTest.java \
-java/awt/Multiscreen/MultiScreenLocationTest/MultiScreenLocationTest.java \
-java/awt/Paint/bug8024864.java \
-java/awt/Paint/ButtonRepaint.java \
-java/awt/Paint/CheckboxRepaint.java \
-java/awt/Paint/ComponentIsNotDrawnAfterRemoveAddTest \
-java/awt/Paint/ExposeOnEDT.java \
-java/awt/Paint/LabelRepaint.java \
-java/awt/Paint/ListRepaint.java \
-java/awt/Paint/PaintNativeOnUpdate.java \
-java/awt/Panel \
-java/awt/PopupMenu \
-java/awt/print \
-java/awt/PrintJob \
-java/awt/Robot \
-java/awt/Scrollbar \
-java/awt/ScrollPane \
-java/awt/security \
-java/awt/SplashScreen \
-java/awt/TextArea \
-java/awt/TextComponent \
-java/awt/TextField \
-java/awt/Toolkit/BadDisplayTest/BadDisplayTest.java \
-java/awt/Toolkit/DesktopProperties/rfe4758438.java \
-java/awt/Toolkit/DynamicLayout/bug7172833.java \
-java/awt/Toolkit/Headless/GetPrintJob/GetPrintJob.java \
-java/awt/Toolkit/Headless/WrappedToolkitTest/WrappedToolkitTest.sh \
-java/awt/Toolkit/LockingKeyStateTest/LockingKeyStateTest.java \
-java/awt/Toolkit/RealSync/Test.java \
-java/awt/Toolkit/ScreenInsetsTest/ScreenInsetsTest.java \
-java/awt/Toolkit/SecurityTest/SecurityTest2.java \
-java/awt/Toolkit/ToolkitPropertyTest/ToolkitPropertyTest_Enable.java \
-java/awt/TrayIcon \
-java/awt/wakefield \
-java/awt/Window \
-java/awt/WMSpecificTests \
-java/awt/xembed

View File

@@ -182,13 +182,6 @@ public class FontExtensionsTest {
return !textDrawingEquals(BASE_FONT, fontWithFeatures(FontExtensions.FeatureTag.FRAC), FRACTION_STRING);
}
@JBRTest
private static Boolean testFeaturesZeroFrac() {
Font fontFZ = fontWithFeatures(FontExtensions.FeatureTag.FRAC, FontExtensions.FeatureTag.ZERO);
return !textDrawingEquals(fontFZ, fontWithFeatures(FontExtensions.FeatureTag.FRAC), ZERO_STRING + " " + FRACTION_STRING) &&
!textDrawingEquals(fontFZ, fontWithFeatures(FontExtensions.FeatureTag.ZERO), ZERO_STRING + " " + FRACTION_STRING);
}
@JBRTest
private static Boolean testFeaturesDerive1() {
Font fontFZ1 = fontWithFeatures(FontExtensions.FeatureTag.FRAC, FontExtensions.FeatureTag.ZERO).

View File

@@ -0,0 +1,79 @@
import java.awt.*;
import java.lang.reflect.InvocationTargetException;
/*
* @test
* @summary JBR-6060 Verify that the focus traverse to the next component if the current focused became invisible
* @run main/othervm FocusTraversalOrderTest
*/
public class FocusTraversalOrderTest {
private static Frame frame;
private static Button button0, button1, button2, button3, button4;
public static void main(String... args) throws InterruptedException, InvocationTargetException, AWTException {
Robot robot = new Robot();
try {
EventQueue.invokeAndWait(() -> {
frame = new Frame();
frame.setLayout(new FlowLayout());
frame.setFocusTraversalPolicy(new ContainerOrderFocusTraversalPolicy());
button0 = new Button();
button0.setFocusable(true);
frame.add(button0);
button1 = new Button();
button1.setFocusable(true);
frame.add(button1);
button2 = new Button();
button2.setFocusable(true);
frame.add(button2);
button3 = new Button();
button3.setFocusable(true);
frame.add(button3);
button4 = new Button();
button4.setFocusable(true);
frame.add(button4);
frame.pack();
frame.setVisible(true);
});
frame.requestFocus();
frame.toFront();
robot.waitForIdle();
button2.requestFocusInWindow();
robot.waitForIdle();
button2.setVisible(false);
robot.waitForIdle();
boolean isRightFocus = button3.isFocusOwner();
if (!isRightFocus) {
System.out.println("ERROR: button3 expected to be focus owner");
}
FocusTraversalPolicy focusTraversalPolicy = frame.getFocusTraversalPolicy();
Component compAfterButton2 = focusTraversalPolicy.getComponentAfter(frame, button2);
boolean isRightNextComp = compAfterButton2.equals(button3);
if (!isRightNextComp) {
System.out.println("ERROR: the next component after button2 expected to be button3, but got " + compAfterButton2.getName());
}
if (!(isRightFocus && isRightNextComp)) {
throw new RuntimeException("TEST FAILED: the next component didn't gain the focus");
} else {
System.out.println("TEST PASSED");
}
} finally {
EventQueue.invokeAndWait(() -> {
if (frame != null) {
frame.dispose();
}
});
}
}
}

View File

@@ -0,0 +1,141 @@
/*
* Copyright (c) 2023, JetBrains s.r.o.. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
/*
* @test
* @summary A manual test of JBR-5984 bug checks if an IM's window is placed above Swing's/AWT's popups
* @author Nikita Provotorov
* @requires (os.family == "mac")
* @key headful
* @run main/othervm/manual -Xcheck:jni ImWindowIsPlacedUnderPopup5984
*/
import javax.swing.*;
import java.awt.*;
import java.awt.event.WindowAdapter;
import java.awt.event.WindowEvent;
import java.lang.reflect.InvocationTargetException;
import java.util.concurrent.CompletableFuture;
import java.util.concurrent.ExecutionException;
public class ImWindowIsPlacedUnderPopup5984 extends JFrame {
static final CompletableFuture<RuntimeException> swingError = new CompletableFuture<>();
public static void main(String[] args) throws InterruptedException, InvocationTargetException, ExecutionException {
final ImWindowIsPlacedUnderPopup5984 frame;
{
final CompletableFuture<ImWindowIsPlacedUnderPopup5984> frameFuture = new CompletableFuture<>();
SwingUtilities.invokeAndWait(() -> {
try {
final var result = new ImWindowIsPlacedUnderPopup5984();
result.setVisible(true);
frameFuture.complete(result);
} catch (Throwable err) {
frameFuture.completeExceptionally(err);
}
});
frame = frameFuture.get();
}
try {
final var err = swingError.get();
if (err != null) {
throw err;
}
} finally {
if (frame != null) {
SwingUtilities.invokeAndWait(frame::dispose);
}
}
}
public ImWindowIsPlacedUnderPopup5984() {
super("JBR-5984");
setDefaultCloseOperation(HIDE_ON_CLOSE);
popupShowingButton = new JButton("Show a Popup");
add(popupShowingButton, BorderLayout.NORTH);
instructionTextArea = new JTextArea();
instructionTextArea.setLineWrap(true);
instructionTextArea.setWrapStyleWord(true);
instructionTextArea.setText(
"""
INSTRUCTION:
1. Switch the input source to an input method (e.g. "Pinyin - Simplified");
2. Press the "Show a Popup" button;
3. Start typing into the text field on the shown popup;
4. Check if the input candidates' popup is shown above the java popup:
4.1. If it's shown above, press the "PASS" button;
4.2. Otherwise, press the "FAIL" button.
"""
);
instructionTextArea.setEditable(false);
add(instructionTextArea, BorderLayout.CENTER);
final JPanel southContainer = new JPanel(new BorderLayout());
failTestButton = new JButton("FAIL");
passTestButton = new JButton("PASS");
southContainer.add(failTestButton, BorderLayout.LINE_START);
southContainer.add(passTestButton, BorderLayout.LINE_END);
add(southContainer, BorderLayout.SOUTH);
popupPanel = new JPanel();
popupTextField = new JTextArea();
popupTextField.setPreferredSize(new Dimension(200, 125));
popupPanel.add(popupTextField);
pack();
setSize(400, 250);
setLocationRelativeTo(null);
popup = new JPopupMenu();
popup.add(popupPanel);
popup.pack();
popupShowingButton.addActionListener(ignored -> popup.show(ImWindowIsPlacedUnderPopup5984.this, 100, 65));
failTestButton.addActionListener(ignored -> swingError.completeExceptionally(new RuntimeException("The tester has pressed FAILED")));
passTestButton.addActionListener(ignored -> swingError.complete(null));
addWindowListener(new WindowAdapter() {
@Override
public void windowClosing(WindowEvent e) {
swingError.completeExceptionally(new RuntimeException("The window was closed not through the \"PASS\"/\"FAIL\" buttons"));
}
});
}
private final JButton popupShowingButton;
private final JTextArea instructionTextArea;
private final JButton failTestButton;
private final JButton passTestButton;
private final JPanel popupPanel;
private final JTextArea popupTextField;
private final JPopupMenu popup;
}

View File

@@ -0,0 +1,141 @@
/*
* Copyright (c) 2023, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2023, JetBrains s.r.o.. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
import javax.swing.JFrame;
import javax.swing.JPanel;
import javax.swing.SwingUtilities;
import javax.swing.WindowConstants;
import java.awt.Color;
import java.awt.Dimension;
import java.awt.Graphics;
import java.awt.event.ComponentAdapter;
import java.awt.event.ComponentEvent;
import java.awt.event.WindowAdapter;
import java.awt.event.WindowEvent;
import java.util.concurrent.CountDownLatch;
/*
* @test
* @summary Verifies that the program finishes after disposing of JFrame
* @run main WLShutdownTest
*/
public class WLShutdownTest {
private static JFrame frame = null;
public static void main(String[] args) throws Exception {
final CountDownLatch latchShownFrame = new CountDownLatch(1);
final CountDownLatch latchClosedFrame = new CountDownLatch(1);
SwingUtilities.invokeAndWait(new Runnable() {
@Override
public void run() {
frame = new JFrame("TEST");
frame.addComponentListener(new ComponentAdapter() {
@Override
public void componentShown(ComponentEvent e) {
latchShownFrame.countDown();
}
});
frame.addWindowListener(new WindowAdapter() {
@Override
public void windowClosed(WindowEvent e) {
latchClosedFrame.countDown();
}
});
JPanel panel = new JPanel() {
int n = 0;
@Override
protected void paintComponent(Graphics g) {
System.out.print("P");
g.setColor((n++ % 2 == 0) ? Color.RED : Color.BLUE);
g.fillRect(0, 0, getWidth(), getHeight());
System.out.print("Q");
}
};
panel.setPreferredSize(new Dimension(800, 800));
panel.setBackground(Color.BLACK);
frame.add(panel);
frame.setDefaultCloseOperation(WindowConstants.EXIT_ON_CLOSE);
frame.pack();
frame.setVisible(true);
System.out.print(">>");
}
});
// Wait frame to be shown:
latchShownFrame.await();
System.out.print(":>>");
final long startTime = System.currentTimeMillis();
final long endTime = startTime + 3000;
// Start 1st measurement:
repaint();
for (; ; ) {
System.out.print(".");
repaint();
if (System.currentTimeMillis() >= endTime) {
break;
}
sleep();
} // end measurements
SwingUtilities.invokeAndWait(() -> {
frame.setVisible(false);
frame.dispose();
});
latchClosedFrame.await();
System.out.print("<<\n");
frame = null; // free static ref: gc
System.out.println("Waiting AWT to shutdown JVM soon ...");
}
static void repaint() throws Exception {
SwingUtilities.invokeAndWait(new Runnable() {
@Override
public void run() {
frame.repaint();
}
});
}
static void sleep() {
try {
Thread.sleep(100);
} catch (InterruptedException ie) {
ie.printStackTrace(System.err);
}
}
}

View File

@@ -29,6 +29,8 @@
* @requires (jdk.version.major >= 8 & os.family == "mac")
*/
import sun.lwawt.macosx.LWCToolkit;
import static java.awt.event.KeyEvent.*;
public class KeyCodesTest implements Runnable {
@@ -140,6 +142,10 @@ public class KeyCodesTest implements Runnable {
}
private void verify(String typed, int vk, String layout, int key, int charKeyCode, int location, int modifiers) {
if (!LWCToolkit.isKeyboardLayoutInstalled(layout)) {
System.out.printf("WARNING: Skipping key code test, vk = %d, layout = %s: this layout is not installed", vk, layout);
return;
}
char ch = (typed.length() == 1) ? typed.charAt(0) : 0;
InputMethodTest.section("Key code test: " + vk + ", layout: " + layout + ", char: " + String.format("U+%04X", (int)ch));
InputMethodTest.layout(layout);

View File

@@ -1,6 +1,48 @@
java/awt/Choice/ChoicePopupLocation/ChoicePopupLocation.java 8202931,JBR-5398 macosx-all,linux-all,windows-all
java/awt/Debug/X11Trace.java JBR-5442 linux-all
java/awt/Multiscreen/MultiScreenLocationTest/MultiScreenLocationTest.java JBR-6058 windows-all
java/awt/FullScreen/CurrentDisplayModeTest/CurrentDisplayModeTest.java JBR-5059 linux-all
java/awt/FullScreen/MultimonFullscreenTest/MultimonDeadlockTest.java JBR-4379 windows-all
java/awt/Frame/FramesGC/FramesGC.java JBR-6057 windows-all
java/awt/GraphicsDevice/DisplayModes/CompareToXrandrTest.java JBR-5062 linux-all
java/awt/datatransfer/Clipboard/GetContentsInterruptedTest.java JBR-5086 linux-5.15.0-46-generic Ubuntu 20.04
java/awt/dnd/MissedDragEnterTest.java JBR-6091 windows-all
java/awt/Frame/FramesGC/FramesGC.java JBR-6057 windows-all
java/awt/Frame/GetGraphicsStressTest/GetGraphicsStressTest.java JBR-5117 linux-all
java/awt/LightweightDispatcher/LWDispatcherMemoryLeakTest.java 8311535 windows-all
java/awt/Multiscreen/WindowGCChangeTest/WindowGCChangeTest.java JBR-5531 macosx-all
java/awt/Mouse/GetMousePositionTest/GetMousePositionWithPopup.java#id1 JBR-5442 linux-all
java/awt/Mouse/MouseWheelAbsXY/MouseWheelAbsXY.java 8253184,JBR-5442 windows-all,linux-all
java/awt/MouseInfo/MultiscreenPointerInfo.java JBR-5442 linux-all
java/awt/Multiscreen/LocationRelativeToTest/LocationRelativeToTest.java 8253184,JBR-5442 windows-all,linux-all
java/awt/Multiscreen/MultiScreenLocationTest/MultiScreenLocationTest.java JBR-5442 linux-all
java/awt/Multiscreen/WindowGCChangeTest/WindowGCChangeTest.java JBR-5531,JBR-5442 macosx-all,linux-all
java/awt/Multiscreen/UpdateGCTest/UpdateGCTest.java JBR-5442 linux-all
java/awt/PopupMenu/PopupMenuLocation.java 8238720,JBR-5442 windows-all,linux-all
java/awt/Robot/CheckCommonColors/CheckCommonColors.java 8253184,JBR-5510,JBR-5442,JBR-6092 windows-all,linux-all,macosx-aarch64
java/awt/Robot/CheckCommonColors/CheckCommonColors.java JBR-6092 macosx-aarch64
java/awt/Robot/HiDPIScreenCapture/ScreenCaptureTest.java 8253184,JBR-5442 windows-all,linux-all
java/awt/Robot/MouseLocationOnScreen/MouseLocationOnScreen.java JBR-5390 macosx-all,linux-all
java/awt/Robot/NonEmptyErrorStream.java JBR-5442 linux-all
java/awt/Robot/RobotMoveMultiscreen.java JBR-5442 linux-all
java/awt/Toolkit/AWTEventListenerProxyTest/AWTEventListenerProxyTest.java JBR-6065 windows-all
java/awt/Window/SlowMotion/SlowMotion.java JBR-5442 linux-all
java/awt/Window/WindowSizeDifferentScreens/WindowSizeDifferentScreens.java JBR-5442 linux-all
java/awt/dnd/MissingEventsOnModalDialog/MissingEventsOnModalDialogTest.java JBR-5442 linux-all
java/awt/im/memoryleak/InputContextMemoryLeakTest.java JBR-6065 windows-all
java/awt/image/VolatileImage/DrawHugeImageTest.java JBR-5442 linux-all
javax/swing/GraphicsConfigNotifier/TestMultiScreenGConfigNotify.java JBR-5442 linux-all
javax/swing/JComboBox/TestComboBoxComponentRendering.java JBR-6100 linux-all
javax/swing/JInternalFrame/Test6325652.java JBR-6065 windows-all
javax/swing/JMenu/4692443/bug4692443.java JBR-6065 windows-all
javax/swing/JMenuBar/4750590/bug4750590.java JBR-6065 windows-all
javax/swing/JMenuItem/4171437/bug4171437.java JBR-6065 windows-all
javax/swing/JTable/7124218/SelectEditTableCell.java JBR-5442 linux-all
javax/swing/JTextArea/8149849/DNDTextToScaledArea.java 8253184 windows-all
javax/swing/JTextField/8036819/bug8036819.java JBR-6065 windows-all
javax/swing/JTree/4927934/bug4927934.java JBR-6065 windows-all
javax/swing/plaf/basic/BasicGraphicsUtils/8132119/bug8132119.java JBR-5442 linux-all
javax/swing/plaf/metal/MetalGradient/8163193/ButtonGradientTest.java 8253184,JBR-5510,JBR-5442 windows-all,linux-all
javax/swing/SwingWorker/TestDoneBeforeDoInBackground.java JBR-5442 linux-all
javax/swing/text/html/StyleSheet/bug4936917.java JBR-899,JBR-5510,JBR-5442 windows-all,linux-all
javax/swing/UI/UnninstallUIMemoryLeaks/UnninstallUIMemoryLeaks.java JBR-5952,JBR-5442 windows-x64,linux-all

View File

@@ -343,7 +343,7 @@ java/awt/Clipboard/HTMLTransferTest/HTMLTransferTest.java 8017454 macosx-all
java/awt/Frame/MiscUndecorated/ActiveAWTWindowTest.java JBR-5210 windows-all
java/awt/Frame/MiscUndecorated/ActiveSwingWindowTest.java JBR-5210 windows-all
java/awt/Frame/MiscUndecorated/FrameCloseTest.java JBR-5210 windows-all
java/awt/Frame/MiscUndecorated/RepaintTest.java 8266244,JBR-5786 macosx-aarch64,linux-all
java/awt/Frame/MiscUndecorated/RepaintTest.java 8266244,JBR-5786 macosx-aarch64,generic-all
java/awt/Robot/HiDPIMouseClick/HiDPIRobotMouseClick.java 8253184 windows-all
java/awt/Modal/FileDialog/FileDialogAppModal1Test.java 7186009,8253184,JBR-5827 macosx-all,windows-all,linux-all
java/awt/Modal/FileDialog/FileDialogAppModal2Test.java 7186009,8253184 macosx-all,windows-all
@@ -633,6 +633,7 @@ java/awt/Mouse/MouseWheelAbsXY/MouseWheelAbsXY.java 8253184 windows-all
java/awt/Toolkit/ToolkitPropertyTest/ToolkitPropertyTest_Enable.java 6847163 linux-all
java/awt/xembed/server/RunTestXEmbed.java 7034201 linux-all
java/awt/Modal/ModalFocusTransferTests/FocusTransferDialogsDocModalTest.java 8164473 linux-all
java/awt/Frame/DecoratedFrameInsets/DecoratedFrameInsetsTest.java JBR-5205 linux-5.4.0-1103-aws
java/awt/Frame/DisposeParentGC/DisposeParentGC.java 8079786 macosx-all
java/awt/GraphicsDevice/CheckDisplayModes.java 8266242 macosx-aarch64
@@ -662,6 +663,7 @@ java/awt/GridLayout/ComponentPreferredSize/ComponentPreferredSize.java 8238720 w
java/awt/GridLayout/ChangeGridSize/ChangeGridSize.java 8238720 windows-all
java/awt/event/MouseEvent/FrameMouseEventAbsoluteCoordsTest/FrameMouseEventAbsoluteCoordsTest.java 8238720 windows-all
java/awt/wakefield/RobotKeyboard.java JBR-5653 linux-all
java/awt/wakefield/ScreenCapture.java JBR-5653 linux-all
# Several tests which fail sometimes on macos11
@@ -874,12 +876,13 @@ javax/imageio/plugins/external_plugin_tests/TestClassPathPlugin.sh JBR-5363 wind
javax/swing/plaf/basic/BasicComboPopup/JComboBoxPopupLocation/JComboBoxPopupLocation.java 8194945 macosx-all
javax/swing/plaf/basic/BasicHTML/4251579/bug4251579.java 8253184,JBR-5510 windows-all,linux-5.18.2-arch1-1
javax/swing/plaf/basic/BasicMenuUI/4983388/bug4983388.java 8253184 windows-all
javax/swing/plaf/basic/BasicTableHeaderUI/6394566/bug6394566.java JBR-5846 windows-all
javax/swing/plaf/basic/BasicTextUI/8001470/bug8001470.java 8233177 linux-all,windows-all
javax/swing/plaf/basic/BasicTreeUI/8023474/bug8023474.java 8253184 linux-all,windows-all
javax/swing/plaf/nimbus/8041642/bug8041642.java 8253184,JBR-5510 windows-all,linux-5.18.2-arch1-1
javax/swing/plaf/nimbus/8057791/bug8057791.java 8253184,JBR-5510 windows-all,linux-5.18.2-arch1-1
javax/swing/plaf/nimbus/TestNimbusBGColor.java JBR-5359 windows-aarch64
javax/swing/plaf/nimbus/TestNimbusOverride.java 8253184 windows-all
javax/swing/plaf/nimbus/TestNimbusOverride.java 8253184, JBR-5829 windows-all,linux-all
javax/swing/plaf/windows/6921687/bug6921687.java 8253184 windows-all
javax/swing/plaf/windows/WindowsRootPaneUI/WrongAltProcessing/WrongAltProcessing.java JBR-4372 windows-all
@@ -894,14 +897,21 @@ javax/swing/JColorChooser/Test6524757.java JBR-5210 windows-all
javax/swing/JColorChooser/Test6827032.java JBR-5210 windows-all
javax/swing/JComboBox/6406264/bug6406264.java JBR-5210 windows-all
javax/swing/JComboBox/bug4890345.java JBR-5799 windows-all
javax/swing/JComboBox/bug4924758.java JBR-5846 windows-all
javax/swing/JComboBox/bug5029504.java JBR-5799 windows-all
javax/swing/JComponent/6683775/bug6683775.java 8172337 generic-all
javax/swing/JDialog/Transparency/TransparencyTest.java 8253184,JBR-5510 windows-all,linux-5.18.2-arch1-1
javax/swing/JLabel/4138746/JLabelMnemonicsTest.java JBR-4949 linux-all,windows-all
javax/swing/JLabel/6596966/bug6596966.java 8197552 windows-all
javax/swing/JLabel/7004134/bug7004134.java JBR-5437 linux-all
javax/swing/JMenu/4213634/bug4213634.java 8197552 windows-all
javax/swing/JMenu/4515762/bug4515762.java 8197552 windows-all
javax/swing/JMenu/4692443/bug4692443.java JBR-6093 windows-x64
javax/swing/JMenu/6470128/bug6470128.java 8253184 windows-all
javax/swing/JMenu/6538132/bug6538132.java JBR-894 windows-all00
javax/swing/JMenu/PopupReferenceMemoryLeak.java JBR-5890,JBR-6056 windows-aarch64,windows-x64
javax/swing/JMenuBar/4750590/bug4750590.java JBR-6094 windows-x64
javax/swing/JMenuItem/4171437/bug4171437.java JBR-6112 windows-x64
javax/swing/JMenuItem/4654927/bug4654927.java JBR-164 windows-all
javax/swing/JMenuItem/4654927/bug4654927.java JBR-164,JBR-4337 windows-all,linux-all
javax/swing/JMenuItem/6209975/bug6209975.java 8253184 windows-all
@@ -944,6 +954,7 @@ javax/swing/JEditorPane/bug4714674.java JBR-5810 windows-all
javax/swing/JComboBox/DisabledComboBoxFontTestAuto.java 8310072 linux-all,windows-all
javax/swing/JEditorPane/JEditorPaneGCSwitchTest/JEditorPaneGCSwitchTest_i18n.java JBR-912 windows-all
javax/swing/JEditorPane/JEditorPaneGCSwitchTest/JEditorPaneGCSwitchTest.java JBR-912 windows-all
javax/swing/JFileChooser/4524490/bug4524490.java JBR-5846 windows-all
javax/swing/JFileChooser/8021253/bug8021253.java JBR-107 windows-all
javax/swing/JFileChooser/8041694/bug8041694.java JBR-5210 windows-all
javax/swing/JFileChooser/6396844/TwentyThousandTest.java 8198003 generic-all
@@ -951,7 +962,7 @@ javax/swing/JFileChooser/6520101/bug6520101.java JBR-5703 linux-5.8.0-1032-raspi
javax/swing/JFileChooser/6570445/bug6570445.java JBR-5767 windows-all
javax/swing/JFileChooser/6738668/bug6738668.java JBR-5767 windows-all
javax/swing/JFileChooser/7036025/bug7036025.java JBR-5767 windows-all
javax/swing/JFileChooser/8062561/bug8062561.java JBR-5767 windows-all
javax/swing/JFileChooser/8062561/bug8062561.java JBR-5767,JBR-5808 windows-all
javax/swing/JFileChooser/8194044/FileSystemRootTest.java JBR-5767 windows-all
javax/swing/JFileChooser/ShellFolderQueries/ShellFolderQueriesSecurityManagerTest.java JBR-5767 windows-all
javax/swing/JFrame/8016356/bug8016356.java JBR-108 windows-all
@@ -964,9 +975,11 @@ javax/swing/JTabbedPane/4361477/bug4361477.java JBR-5932 linux-all
javax/swing/JTabbedPane/8007563/Test8007563.java 8051591 generic-all
javax/swing/JTabbedPane/4624207/bug4624207.java 8064922,8197552 macosx-all,windows-all 8064922:macosx-all, 8197552:windows-all
javax/swing/JTabbedPane/TestBackgroundScrollPolicy.java 8253184,windows-all
javax/swing/JToggleButton/TestSelectedKey.java JBR-5846 windows-all
javax/swing/JToolBar/4529206/bug4529206.java JBR-5387 linux-all
javax/swing/JToolTip/6219960/bug6219960.java 8253184 windows-all
javax/swing/SwingUtilities/TestBadBreak/TestBadBreak.java 8160720 generic-all
javax/swing/text/AbstractDocument/8190763/TestCCEOnEditEvent.java JBR-5799 windows-all
javax/swing/text/DefaultCaret/HidingSelection/HidingSelectionTest.java JBR-5510 linux-5.18.2-arch1-1
javax/swing/text/TableView/TableViewLayoutTest.java 8194936,JBR-4316,JBR-5510 linux-5.18.2-arch1-1,linux-all
javax/swing/JFileChooser/6798062/bug6798062.java 8146446 windows-all
@@ -977,6 +990,7 @@ javax/swing/JInternalFrame/6288609/TestJInternalFrameDispose.java JBR-788 window
javax/swing/JInternalFrame/6647340/bug6647340.java 8253184 windows-all
javax/swing/JInternalFrame/8145060/TestJInternalFrameMinimize.java JBR-788 windows-all,linux-all
javax/swing/JInternalFrame/8145896/TestJInternalFrameMaximize.java JBR-5539 windows-all
javax/swing/JInternalFrame/Test6325652.java JBR-6111 windows-all
javax/swing/JInternalFrame/Test6505027.java JBR-5954 linux-all,osx-all
javax/swing/JInternalFrame/Test6802868.java 8253184 windows-all
javax/swing/JPopupMenu/4634626/bug4634626.java 8253184 windows-all
@@ -1002,6 +1016,7 @@ javax/swing/JInternalFrame/5066752/bug5066752.java 8253184,JBR-5510 windows-all,
javax/swing/JInternalFrame/8160248/JInternalFrameDraggingTest.java JBR-5359,JBR-5510 windows-aarch64,linux-5.18.2-arch1-1
javax/swing/JInternalFrame/8020708/bug8020708.java JBR-4879 windows-all
javax/swing/JInternalFrame/8069348/bug8069348.java 8253184,JBR-900 macosx-aarch64,windows-all
javax/swing/ToolTipManager/Test6256140.java 8197552 windows-all
javax/swing/text/DefaultEditorKit/4278839/bug4278839.java CODETOOLS-7901623 windows-all
javax/swing/text/GlyphPainter2/6427244/bug6427244.java JBR-896 windows-all
javax/swing/text/JTextComponent/5074573/bug5074573.java CODETOOLS-7901623,JBR-5386 windows-all,linux-all
@@ -1010,7 +1025,7 @@ javax/swing/text/StyledEditorKit/4506788/bug4506788.java JBR-180 windows-all
javax/swing/text/View/8014863/bug8014863.java JBR-5541 windows-all
javax/swing/text/View/8156217/FPMethodCalledTest.java JBR-5541 linux-all
javax/swing/UI/UnninstallUIMemoryLeaks/UnninstallUIMemoryLeaks.java JBR-5952 windows-x64
javax/swing/UIDefaults/6795356/TableTest.java.TableTest JBR-5767 windows-all
javax/swing/UIDefaults/6795356/TableTest.java JBR-5767 windows-all
java/awt/Robot/HiDPIScreenCapture/HiDPIRobotScreenCaptureTest.java 8253184 windows-all
java/awt/Robot/HiDPIScreenCapture/ScreenCaptureTest.java 8253184 windows-all
java/awt/Robot/CheckCommonColors/CheckCommonColors.java 8253184,JBR-5510 windows-all,linux-5.18.2-arch1-1
@@ -1023,7 +1038,8 @@ sanity/client/SwingSet/src/DialogDemoTest.java 8253184 windows-all
sanity/client/SwingSet/src/FrameDemoTest.java 8253184 windows-all
sanity/client/SwingSet/src/InternalFrameDemoTest.java 8253184 windows-all
sanity/client/SwingSet/src/GridBagLayoutDemoTest.java 8253184 windows-all
sanity/client/SwingSet/src/TextFieldDemoTest.java JBR-5061 linux-5.15.0-39-generic Ubuntu-22.04
sanity/client/SwingSet/src/TextFieldDemoTest.java JBR-5061 linux-all Ubuntu-22.04
sanity/client/SwingSet/src/ToolTipDemoTest.java 8293001 linux-all
sanity/client/SwingSet/src/SliderDemoTest.java 8253184 windows-all
sanity/client/SwingSet/src/SpinnerDemoTest.java 8253184 windows-all
sanity/client/SwingSet/src/SplitPaneDemoTest.java JBR-5817 linux-5.19.0-1025-aws
@@ -1154,6 +1170,8 @@ java/awt/font/EmojiVariation.java JBR-5009,JBR-5510 linux-aarch64,linux-5.18.2-a
java/awt/font/TextLayout/TestJustification.html 8250791 macosx-all
java/awt/font/TextLayout/TestSinhalaChar.java JBR-5103 generic-all
javax/swing/JTableHeader/6889007/bug6889007.java 8310238,8253184,JBR-5387 macosx-all,windows-all,linux-all
javax/swing/JTextField/8036819/bug8036819.java JBR-6113 windows-x64
javax/swing/JTree/4927934/bug4927934.java JBR-6114 windows-x64
java/awt/TrayIcon/DragEventSource/DragEventSource.java 8252242 macosx-all
java/awt/FileDialog/DefaultFocusOwner/DefaultFocusOwner.java 7187728 macosx-all,linux-all
java/awt/FileDialog/RegexpFilterTest/RegexpFilterTest.html 7187728 macosx-all,linux-all
@@ -1166,6 +1184,7 @@ java/awt/TextArea/TextAreaTwicePack/TextAreaTwicePack.java 8253184 windows-all
java/awt/TextField/OverScrollTest/OverScrollTest.java 8253184 windows-all
java/awt/event/MouseEvent/SpuriousExitEnter/SpuriousExitEnter.java 8254841 macosx-all
java/awt/Focus/AppletInitialFocusTest/AppletInitialFocusTest1.java 8256289,JBR-5359 windows-x64,windows-aarch64
java/awt/Focus/RemoveAfterRequest/RemoveAfterRequest.java JBR-6052 macosx-all,linux-all
java/awt/Focus/RowToleranceTransitivityTest.java JBR-5751 windows-all
java/awt/FullScreen/TranslucentWindow/TranslucentWindow.java 8258103,8253184 linux-all,windows-all
@@ -1258,6 +1277,7 @@ javax/swing/JSpinner/JSpinnerFocusTest.java JBR-5288 windows-all
javax/swing/JSpinner/SpinnerTest.java JBR-4880 windows-all
javax/swing/JSpinner/TestJSpinnerFocusLost.java JBR-5210 windows-all
javax/swing/JTable/7068740/bug7068740.java 8197552 windows-all
javax/swing/JTable/8236907/LastVisibleRow.java JBR-6066 macosx-aarch64
javax/swing/text/FlowView/LayoutTest.java JBR-4880 windows-all
javax/swing/text/html/7189299/bug7189299.java JBR-4880 windows-all
jb/java/jcef/HandleJSQueryTest3314.sh JBR-4866 linux-all
@@ -1319,6 +1339,7 @@ javax/sound/sampled/Mixers/BogusMixers.java JBR-4455 linux-aarch64
java/awt/Choice/RemoveAllShrinkTest/RemoveAllShrinkTest.java JBR-5359,JBR-5510,8310487 windows-aarch64,linux-5.18.2-arch1-1,linux-all
java/awt/Choice/ResizeAutoClosesChoice/ResizeAutoClosesChoice.java JBR-5359,JBR-5510,JBR-5905 windows-aarch64,linux-5.18.2-arch1-1,linux-all
java/awt/Choice/SelectNewItemTest/SelectNewItemTest.java 8315733 macosx-all
java/awt/ColorClass/XRenderTranslucentColorDrawTest.java JBR-5359 windows-aarch64
java/awt/Frame/InvisibleOwner/InvisibleOwner.java JBR-5359,JBR-5510 windows-aarch64,linux-5.18.2-arch1-1
java/awt/Graphics/CopyScaledArea/CopyScaledAreaTest.java JBR-5359 windows-aarch64
@@ -1344,6 +1365,7 @@ java/awt/image/VolatileImage/ReportRenderingError.java#windows JBR-5359 windows-
java/awt/Mixing/AWT_Mixing/JGlassPaneInternalFrameOverlapping.java JBR-5359,JBR-5510 windows-aarch64,linux-5.18.2-arch1-1
java/awt/Mixing/AWT_Mixing/JGlassPaneMoveOverlapping.java JBR-5359,JBR-5510 windows-aarch64,linux-5.18.2-arch1-1
java/awt/Mixing/AWT_Mixing/JInternalFrameOverlapping.java JBR-5359,JBR-5510 windows-aarch64,linux-5.18.2-arch1-1
java/awt/Mixing/LWPopupMenu.java JBR-824 generic-all
java/awt/Mixing/OpaqueTest.java JBR-5707 linux-all
java/awt/Mixing/OverlappingButtons.java JBR-5707 linux-all
java/awt/Window/BackgroundIsNotUpdated/BackgroundIsNotUpdated.java JBR-5359,JBR-5510 windows-aarch64,linux-5.18.2-arch1-1
@@ -1366,24 +1388,26 @@ jb/java/awt/CustomTitleBar/HitTestNonClientArea.java JBR-5465,JBR-5550 windows-a
jb/java/awt/CustomTitleBar/MaximizeWindowTest.java JBR-5465,JBR-5550 windows-all
jb/java/awt/CustomTitleBar/MaximizedWindowFocusTest.java JBR-5828 windows-all
jb/java/awt/CustomTitleBar/MinimizingWindowTest.java JBR-5359,JBR-5345 windows-aarch64,windows-x64
jb/java/awt/CustomTitleBar/MouseEventsOnClientArea.java JBR-5910 windows-x64
jb/java/awt/CustomTitleBar/NativeControlsVisibilityTest.java JBR-5359,JBR-5345 windows-aarch64,windows-x64
jb/java/awt/CustomTitleBar/WindowsControlWidthTest.java JBR-5359,JBR-5345 windows-aarch64,windows-x64
jb/java/awt/CustomTitleBar/WindowResizeTest.java JBR-5592 windows-all
sanity/client/SwingSet/src/EditorPaneDemoTest.java JBR-5359,JBR-5510 windows-aarch64,linux-5.18.2-arch1-1
sun/java2d/AcceleratedXORModeTest.java JBR-5359 windows-aarch64
sun/java2d/GdiRendering/ClipShapeRendering.java JBR-5359,JBR-5510 windows-aarch64,linux-5.18.2-arch1-1
sun/java2d/GdiRendering/InsetClipping.java JBR-5359,JBR-5510 windows-aarch64,linux-5.18.2-arch1-1
sun/java2d/GdiRendering/InsetClipping.java 7124403,JBR-5359,JBR-5510 windows-x64,macosx-all,windows-aarch64,linux-5.18.2-arch1-1
java/awt/Choice/PopdownGeneratesMouseEvents/PopdownGeneratesMouseEvents.java JBR-5510 linux-5.18.2-arch1-1
java/awt/Insets/DialogInsets.java JBR-5510 linux-5.18.2-arch1-1
java/awt/Menu/OpensWithNoGrab/OpensWithNoGrab.java JBR-5510 linux-5.18.2-arch1-1
javax/swing/JFormattedTextField/TestSelectedTextBackgroundColor.java JBR-5510 linux-5.18.2-arch1-1
javax/swing/JMenu/JMenuSelectedColorTest.java JBR-5510 linux-5.18.2-arch1-1
javax/swing/JMenuItem/8158566/CloseOnMouseClickPropertyTest.java JBR-5510 linux-5.18.2-arch1-1
javax/swing/JSpinner/4670051/DateFieldUnderCursorTest.java JBR-5510 linux-5.18.2-arch1-1
javax/swing/JSpinner/4788637/bug4788637.java JBR-5510 linux-5.18.2-arch1-1
javax/swing/LookAndFeel/8145547/DemandGTK2.sh JBR-5510 linux-5.18.2-arch1-1
javax/swing/LookAndFeel/8145547/DemandGTK3.sh JBR-5510 linux-5.18.2-arch1-1
java/awt/Toolkit/LockingKeyStateTest/LockingKeyStateTest.java JBR-5765 macosx-all
jb/sun/awt/macos/InputMethodTest/FocusMoveUncommitedCharactersTest.java JBR-5765 macosx-all
jb/sun/awt/macos/InputMethodTest/FocusMoveUncommitedCharactersTest.java JBR-5765 macosx-all
jb/java/awt/Focus/FocusTraversalOrderTest.java JBR-6060 generic-all

View File

@@ -1,16 +1,44 @@
java/awt/datatransfer/DragUnicodeBetweenJVMTest/DragUnicodeBetweenJVMTest.java JBR-5538 windows-all
java/awt/Frame/RestoreToOppositeScreen/RestoreToOppositeScreen.java 8286840 linux-all
java/awt/GridLayout/ChangeGridSize/ChangeGridSize.java JBR-4199 linux-5.4.0-1083-aws
java/awt/GridLayout/ComponentPreferredSize/ComponentPreferredSize.java JBR-4199 linux-5.4.0-1083-aws
java/awt/Dialog/DialogLocationTest.java JBR-6090 windows-all
java/awt/datatransfer/DragUnicodeBetweenJVMTest/DragUnicodeBetweenJVMTest.java JBR-5538 windows-all
java/awt/datatransfer/MissedHtmlAndRtfBug/MissedHtmlAndRtfBug.java JBR-6027 windows-all
java/awt/dnd/MissedDragEnterTest.java JBR-6091 windows-all
java/awt/event/StressTest/MouseAndKeyEventStressTest.java JBR-6090 windows-all
java/awt/event/MouseEvent/FrameMouseEventAbsoluteCoordsTest/FrameMouseEventAbsoluteCoordsTest.java 8238720,JBR-6095 windows-all,linux-all
java/awt/Focus/6378278/InputVerifierTest.java JBR-6090 windows-all
java/awt/Focus/6382144/EndlessLoopTest.java JBR-6090 windows-all
java/awt/Focus/8282640/ScrollPaneFocusBugTest.java JBR-6090 windows-all
java/awt/Focus/ClearLwQueueBreakTest/ClearLwQueueBreakTest.java JBR-6090 windows-all
java/awt/Focus/LabelScrollBarFocus.java JBR-6090 windows-x64
java/awt/Focus/ModalExcludedWindowClickTest/ModalExcludedWindowClickTest.java JBR-6090 windows-x64
java/awt/Focus/MouseClickRequestFocusRaceTest/MouseClickRequestFocusRaceTest.java JBR-6090 windows-x64
java/awt/Focus/SimpleWindowActivationTest/SimpleWindowActivationTest.java JBR-6089 windows-all
java/awt/Focus/WindowUpdateFocusabilityTest/WindowUpdateFocusabilityTest.java JBR-6090 windows-all
java/awt/Frame/InvisibleOwner/InvisibleOwner.java JBR-6090 windows-all
java/awt/Frame/MaximizedToOppositeScreen/MaximizedToOppositeScreenSmall.java JBR-6090 windows-all
java/awt/Frame/RestoreToOppositeScreen/RestoreToOppositeScreen.java 8286840 linux-all
java/awt/Frame/SetMaximizedBounds/SetMaximizedBounds.java JBR-6090 windows-all
java/awt/Frame/WindowDragTest/WindowDragTest.java JBR-6090 windows-x64
java/awt/GridLayout/ChangeGridSize/ChangeGridSize.java 8238720,JBR-4199,JBR-6090 linux-5.4.0-1083-aws,linux-5.4.0-1103-aws,windows-all
java/awt/GridLayout/ComponentPreferredSize/ComponentPreferredSize.java JBR-4199,JBR-6090 linux-5.4.0-1083-aws,linux-5.4.0-1103-aws,windows-all
java/awt/Graphics/LineClipTest.java JBR-5071 linux-all
java/awt/image/VolatileImage/DrawHugeImageTest.java JBR-5071 linux-all
java/awt/image/VolatileImage/DrawHugeImageTest.java JBR-5071,JBR-5359 linux-all,windows-aarch64
java/awt/LightweightComponent/LightweightEventTest/LightweightEventTest.java JBR-5071 linux-all
java/awt/Mixing/AWT_Mixing/JComboBoxOverlapping.java 8049405,JBR-5359,JBR-5510,JBR-6090 macosx-all,windows-aarch64,linux-5.18.2-arch1-1,windows-all
java/awt/Mixing/AWT_Mixing/JGlassPaneMoveOverlapping.java JBR-5359,JBR-5510,JBR-6090 windows-aarch64,linux-5.18.2-arch1-1,windows-all
java/awt/Mixing/MixingOnDialog.java JBR-6090 windows-all
java/awt/Modal/BlockedMouseInputTest2.java JBR-6090 windows-all
java/awt/PopupMenu/PopupMenuLocation.java 8238720,JBR-5071 windows-all,macosx-all,linux-all
javax/swing/JComboBox/TestComboBoxComponentRendering.java JBR-6100 linux-all
javax/swing/JPopupMenu/6580930/bug6580930.java JBR-5071 linux-all
sun/java2d/GdiRendering/ClipShapeRendering.java JBR-5204 linux-all,windows-all
jb/java/awt/Focus/RequestFocusInParent.java JBR-5715 windows-all
jb/java/awt/Focus/SecondLevelPopupTest.java JBR-6090 windows-all
java/awt/Window/WindowSizeDifferentScreens/WindowSizeDifferentScreens.java JBR-5513 linux-all
jb/java/awt/Window/UndecoratedDialogInTransientsChain.java JBR-6090 windows-all
java/awt/Focus/SimpleWindowActivationTest/SimpleWindowActivationTest.java JBR-6089 windows-all
java/awt/Focus/WindowUpdateFocusabilityTest/WindowUpdateFocusabilityTest.java JBR-6089 windows-all
jb/java/awt/Window/ZOrderOnModalDialogActivation.java JBR-5713 windows-all
jdk/editpad/EditPadTest.java JBR-5712 windows-all

View File

@@ -20,13 +20,9 @@ java/awt/KeyboardFocusmanager/TypeAhead/FreezeTest/FreezeTest.java nobug windows
java/awt/KeyboardFocusmanager/TypeAhead/TestDialogTypeAhead.java nobug windows-all
java/awt/MenuBar/SeparatorsNavigation/SeparatorsNavigation.java nobug windows-all
java/awt/Mixing/AWT_Mixing/JGlassPaneInternalFrameOverlapping.java nobug windows-all
java/awt/Mixing/AWT_Mixing/JGlassPaneMoveOverlapping.java nobug windows-all
java/awt/Mouse/ExtraMouseClick/ExtraMouseClick.java JBR-4354 windows-all,linux-all # linux: JBR-4354
java/awt/Mouse/MouseComboBoxTest/MouseComboBoxTest.java nobug windows-all
java/awt/Paint/PaintNativeOnUpdate.java nobug windows-all
java/awt/Robot/CheckCommonColors/CheckCommonColors.java nobug windows-all
java/awt/Robot/HiDPIScreenCapture/HiDPIRobotScreenCaptureTest.java nobug windows-all
java/awt/Robot/HiDPIScreenCapture/ScreenCaptureTest.java nobug windows-all
java/awt/TextArea/OverScrollTest/OverScrollTest.java nobug windows-all
java/awt/TextField/OverScrollTest/OverScrollTest.java nobug windows-all
java/awt/Window/8159168/SetShapeTest.java nobug windows-all
@@ -52,15 +48,10 @@ javax/swing/JInternalFrame/5066752/bug5066752.java nobug windows-all
javax/swing/JInternalFrame/8145060/TestJInternalFrameMinimize.java nobug windows-all,linux-all
javax/swing/JInternalFrame/Test6505027.java nobug windows-all
javax/swing/JLabel/7004134/bug7004134.java nobug linux-all
javax/swing/JMenu/4213634/bug4213634.java nobug windows-all
javax/swing/JMenu/4692443/bug4692443.java nobug windows-all
javax/swing/JMenu/8072900/WrongSelectionOnMouseOver.java nobug windows-all,linux-all
javax/swing/JMenuBar/4750590/bug4750590.java nobug windows-all
javax/swing/JMenuItem/4171437/bug4171437.java nobug windows-all
javax/swing/JMenuItem/4654927/bug4654927.java nobug windows-all,linux-all
javax/swing/JMenuItem/6209975/bug6209975.java JBR-4894 windows-all
javax/swing/JMenuItem/6249972/bug6249972.java JBR-4894 windows-all
javax/swing/JMenuItem/8158566/CloseOnMouseClickPropertyTest.java nobug windows-all,linux-all
javax/swing/JPopupMenu/4634626/bug4634626.java nobug windows-all
javax/swing/JPopupMenu/4760494/bug4760494.java JBR-4894 windows-all
javax/swing/JPopupMenu/6415145/bug6415145.java nobug windows-all
@@ -79,12 +70,9 @@ javax/swing/JSpinner/TestJSpinnerFocusLost.java nobug windows-all
javax/swing/JTabbedPane/4624207/bug4624207.java 8064922,8197552 macosx-all,windows-all,linux-all 8064922:macosx-all, 8197552:windows-all
javax/swing/JTabbedPane/TestBackgroundScrollPolicy.java nobug windows-all
javax/swing/JTable/7124218/SelectEditTableCell.java JBR-4894 windows-all
javax/swing/JTextArea/8149849/DNDTextToScaledArea.java nobug windows-all
javax/swing/JTextField/8036819/bug8036819.java nobug windows-all
javax/swing/JToolTip/4846413/bug4846413.java nobug windows-all
javax/swing/JToolTip/6219960/bug6219960.java nobug windows-all
javax/swing/JTree/4633594/JTreeFocusTest.java 8173125 macosx-all,windows-all
javax/swing/JTree/4927934/bug4927934.java nobug windows-all
javax/swing/JTree/DnD/LastNodeLowerHalfDrop.java 8159131 linux-all,windows-all
javax/swing/JWindow/ShapedAndTranslucentWindows/PerPixelTranslucentSwing.java 8194128 macosx-all,windows-all
javax/swing/JWindow/ShapedAndTranslucentWindows/SetShapeAndClickSwing.java 8013450 macosx-all,windows-all
@@ -101,4 +89,3 @@ javax/swing/text/html/HTMLEditorKit/5043626/bug5043626.java nobug windows-all
javax/swing/text/JTextComponent/6361367/bug6361367.java nobug windows-all
javax/swing/text/View/8014863/bug8014863.java nobug windows-all
javax/swing/text/View/8156217/FPMethodCalledTest.java nobug linux-all
javax/swing/ToolTipManager/Test6256140.java nobug windows-all

View File

@@ -30,11 +30,13 @@ import quality.util.RenderUtil;
import java.awt.*;
import java.awt.font.FontRenderContext;
import java.awt.font.GlyphVector;
import java.awt.font.TextAttribute;
import java.awt.font.TextLayout;
import java.awt.geom.AffineTransform;
import java.awt.geom.Path2D;
import java.awt.geom.Rectangle2D;
import java.awt.image.BufferedImage;
import java.util.Map;
public class TextMetricsTest {
@@ -42,7 +44,6 @@ public class TextMetricsTest {
public void testTextBounds() throws Exception {
final Font font = new Font("Menlo", Font.PLAIN, 22);
BufferedImage bi = RenderUtil.capture(120, 120,
g2 -> {
String s = "A";
@@ -92,4 +93,49 @@ public class TextMetricsTest {
Assert.assertTrue(bnd.getX() == 0.0 && bnd.getY() == 0.0 &&
bnd.getWidth() == 0.0 && bnd.getHeight() == 0.0);
}
private static void checkStringWidth(Font font, FontRenderContext frc, String str) {
float width = (float) font.getStringBounds(str.toCharArray(), 0, str.length(), frc).getWidth();
float standard = new TextLayout(str, font, frc).getAdvance();
Assert.assertTrue(Math.abs(width - standard) < 0.1f);
}
private static void checkCalculationStringWidth(Font font, String text) {
AffineTransform affineTransform = new AffineTransform();
Map<TextAttribute, Object> attributes = null;
FontRenderContext frc = new FontRenderContext(affineTransform, true, true);
FontRenderContext baseFrc = new FontRenderContext(new AffineTransform(), true, true);
checkStringWidth(font, frc, text);
checkStringWidth(font.deriveFont(affineTransform), frc, text);
affineTransform.translate(0.5f, 0.0f);
checkStringWidth(font, frc, text);
checkStringWidth(font.deriveFont(affineTransform), baseFrc, text);
attributes = Map.of(TextAttribute.TRACKING, 0.5);
checkStringWidth(font.deriveFont(attributes), baseFrc, text);
attributes = Map.of(TextAttribute.KERNING, TextAttribute.KERNING_ON);
checkStringWidth(font.deriveFont(attributes), baseFrc, text);
attributes = Map.of(TextAttribute.LIGATURES, TextAttribute.LIGATURES_ON);
checkStringWidth(font.deriveFont(attributes), baseFrc, text);
}
@Test
// checking equals of calculation of string's width with two different approach:
// fast implementation inside FontDesignMetrics and guaranteed correct implementation in TextLayout
public void checkCalculationStringWidth() {
final Font font = new Font("Arial", Font.PLAIN, 15);
checkCalculationStringWidth(font,
"AVAVAVAVAVAVAAAAVVAVVAVVVAVAVAVAVAVA !@#$%^&*12345678zc.vbnm.a..s.dfg,hjqwertgyh}{}{}///");
checkCalculationStringWidth(font,
"a");
checkCalculationStringWidth(font,
"世丕且且世两上与丑万丣丕且丗丕");
checkCalculationStringWidth(font,
"\uD83D\uDE06\uD83D\uDE06\uD83D\uDE06\uD83D\uDE06\uD83D\uDE06\uD83D\uDE06\uD83D\uDE06");
}
}