Compare commits

..

26 Commits

Author SHA1 Message Date
Denis Konoplev
73ad96297b Win touch option 2020-10-09 15:21:30 +03:00
Vitaly Provodin
27eafd8a53 Remove jogl and gluegen modules from module-info and modules list
These modules will be added via patch during building corresponding JBR binaries
2020-10-06 07:18:50 +07:00
Anton Tarasov
96da1139c0 Add jogl and gluegen modules to support jcef osr mode
OSR - off-screen rendering
2020-10-05 20:52:49 +03:00
Vitaly Provodin
668570bc61 JBR-2758 refactor building scripts to apply patches adding required modules instead of excluding them 2020-10-05 17:03:54 +07:00
Vitaly Provodin
d3ec3d899d JBR-2736 provide writeObjects implementation for copying files/folders (fix review notes) 2020-10-02 13:52:15 +07:00
Mikhail Grishchenko
d1479872f2 JBR-2412 [windows] mouse listener does not work for jcef
added regression test
2020-09-30 19:43:42 +07:00
Mikhail Grishchenko
e8e4741bb0 JBR-2639 [win] jcef does not recognize vertical mouse wheel events
added regression test
2020-09-30 12:53:32 +07:00
Andrey Starovoyt
33db034d49 JBR-2736 provide writeObjects implementation for copying files/folders from Project Explorer to the Finder 2020-09-30 06:50:13 +07:00
Vitaly Provodin
8b7ad2e58f updated JTreg exclude list 2020-09-29 06:20:36 +07:00
Artem Semenov
696a9a4128 JR-CR-667 JBR-2738 Create a test for JTable Accessibility 2020-09-28 13:01:39 +03:00
Artem Semenov
54bb49caeb Review JR-CR-645 JBR-2504 A11y Create a test to test the accessibility of lists on MAc
(cherry picked from commit 92e40bf92c00fb5ce46dff41fc23ad39e460fcc1)
2020-09-25 12:55:34 +03:00
Vitaly Provodin
9c0afe3a7d updated JTreg exclude list 2020-09-24 05:04:33 +07:00
Dmitry Batrak
6dd334f9f0 JBR-2648 Cannot input Japanese and Chinese text in Search Everywhere
code being removed (added to fix JRE-665) is not needed after JBR-2533 fix, as 'simple' windows are natively focused now
2020-09-23 17:27:37 +03:00
Dmitry Batrak
96dd8fcf48 JBR-2735 PopupIncomingFocusTest is failing on KDE when launched via jtreg 2020-09-23 12:47:19 +03:00
Egor Ushakov
9b960dd02a navigation to issues from vcs log 2020-09-16 15:38:20 +03:00
Mikhail Grishchenko
6b7d5fd58c updated JTreg exclude list 2020-09-16 16:25:07 +07:00
Dmitry Batrak
ebcdeb7d80 JBR-2698 setAutoRequestFocus(false) breaks focus logic under i3 window manager on Linux 2020-09-11 11:11:17 +03:00
Vitaly Provodin
67870df19e updated JTreg exclude list 2020-09-11 10:36:59 +07:00
Nikita Gubarkov
afd19dbefd JBR-2614 Fixed LCD glyph width to include both left & right padding, so that rowBytes = width * 3 2020-09-10 15:45:25 +03:00
Nikita Gubarkov
a55097289b Revert "JBR-2614 Passed real glyph type from native code instead of guessing on rowBytes & width"
This reverts commit 8de39b80
2020-09-10 15:39:00 +03:00
Nikita Gubarkov
8de39b80cd JBR-2614 Passed real glyph type from native code instead of guessing on rowBytes & width 2020-09-10 01:50:34 +03:00
Dmitry Batrak
0f038754e5 JBR-2696 Log focus API invocations with stack traces 2020-09-07 14:19:43 +03:00
Vitaly Provodin
4aa278e4a0 Revert "JBR-2577 implemented precise CompilationMXBean#getTotalCompilationTime"
This reverts commit 89163e73
2020-09-07 16:44:40 +07:00
Vitaly Provodin
e3562ecc99 Revert "thread.cpp:4574:43: error: ‘nullptr’ quick fix"
This reverts commit 82a36017
2020-09-07 16:44:20 +07:00
Vitaly Provodin
b62d47da9c updated JTreg exclude list 2020-09-06 06:27:20 +07:00
Vitaly Provodin
e748f39e20 updated JTreg exclude list 2020-08-26 11:41:35 +07:00
42 changed files with 995 additions and 636 deletions

14
.idea/vcs.xml generated
View File

@@ -1,5 +1,19 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="IssueNavigationConfiguration">
<option name="links">
<list>
<IssueNavigationLink>
<option name="issueRegexp" value="[A-Z]+\-\d+" />
<option name="linkRegexp" value="http://youtrack.jetbrains.com/issue/$0" />
</IssueNavigationLink>
<IssueNavigationLink>
<option name="issueRegexp" value="(\d+)\:" />
<option name="linkRegexp" value="https://bugs.openjdk.java.net/browse/JDK-$1" />
</IssueNavigationLink>
</list>
</option>
</component>
<component name="VcsDirectoryMappings">
<mapping directory="$PROJECT_DIR$" vcs="Git" />
</component>

View File

@@ -8,6 +8,5 @@ RUN wget https://bintray.com/jetbrains/intellij-jbr/download_file?file_path=jbrs
-O - | tar xz -C /
ENV JAVA_HOME /jbrsdk
ENV PATH $JAVA_HOME/bin:/opt/rh/devtoolset-8/root/usr/bin:$PATH
RUN mkdir .git
RUN git config user.email "builduser@jetbrains.com"
RUN git config user.name "builduser"
RUN git config --global user.email "teamcity@buildserver.intellij.net"
RUN git config --global user.name "builduser"

View File

@@ -1,3 +1,16 @@
VENDOR_NAME="JetBrains s.r.o."
VENDOR_VERSION_STRING="JBR-${JBSDK_VERSION_WITH_DOTS}.${JDK_BUILD_NUMBER}-${build_number}"
[ -z ${bundle_type} ] || VENDOR_VERSION_STRING="${VENDOR_VERSION_STRING}-${bundle_type}"
do_reset_changes=0
do_reset_dcevm=0
HEAD_REVISION=0
function do_exit() {
exit_code=$1
[ $do_reset_changes -eq 1 ] && git checkout HEAD modules.list src/java.desktop/share/classes/module-info.java
if [ $do_reset_dcevm -eq 1 ]; then
[ ! -z $HEAD_REVISION ] && git reset --hard $HEAD_REVISION
fi
exit $exit_code
}

View File

@@ -1,10 +0,0 @@
#!/bin/bash -x
JBSDK_VERSION=$1
JDK_BUILD_NUMBER=$2
build_number=$3
script_dir=jb/project/tools/linux/scripts
${script_dir}/mkimages_x64.sh $JBSDK_VERSION $JDK_BUILD_NUMBER $build_number "jcef" || exit $?
${script_dir}/mkimages_x64.sh $JBSDK_VERSION $JDK_BUILD_NUMBER $build_number "jfx" || exit $?
${script_dir}/mkimages_x64.sh $JBSDK_VERSION $JDK_BUILD_NUMBER $build_number "dcevm" || exit $?
${script_dir}/mkimages_x64.sh $JBSDK_VERSION $JDK_BUILD_NUMBER $build_number "jfx_jcef" || exit $?

View File

@@ -1,12 +1,16 @@
#!/bin/bash -x
# The following parameters must be specified:
# JBSDK_VERSION - specifies the current version of OpenJDK e.g. 11_0_6
# JDK_BUILD_NUMBER - specifies the number of OpenJDK build or the value of --with-version-build argument to configure
# JBSDK_VERSION - specifies major version of OpenJDK e.g. 11_0_6 (instead of dots '.' underbars "_" are used)
# JDK_BUILD_NUMBER - specifies update release of OpenJDK build or the value of --with-version-build argument to configure
# build_number - specifies the number of JetBrainsRuntime build
# bundle_type - specifies bundle to bu built; possible values:
# jcef - the bundles 1) jbr with jcef+javafx, 2) jbrsdk and 3) test will be created
# jfx - the bundle 1) jbr with javafx only will be created
# bundle_type - specifies bundle to be built; possible values:
# jcef - the release bundles with jcef
# jfx - the release bundles with javafx
# jcef_jfx - the release bundles with jcef and javafx
# dcevm - the release bundles with dcevm patches
# nomod - the release bundles without any additional modules (jcef)
# fd - the fastdebug bundles which also include the jcef module
#
# jbrsdk-${JBSDK_VERSION}-osx-x64-b${build_number}.tar.gz
# jbr-${JBSDK_VERSION}-osx-x64-b${build_number}.tar.gz
@@ -19,8 +23,8 @@
# Environment variables:
# MODULAR_SDK_PATH - specifies the path to the directory where imported modules are located.
# By default imported modules should be located in ./modular-sdk
# JCEF_PATH - specifies the path to the directory where JCEF binaries are located.
# By default imported modules should be located in ./jcef_linux_x64
# JCEF_PATH - specifies the path to the directory with JCEF binaries.
# By default JCEF binaries should be located in ./jcef_linux_x64
JBSDK_VERSION=$1
JDK_BUILD_NUMBER=$2
@@ -34,65 +38,81 @@ source jb/project/tools/common.sh
function create_jbr {
case "$1" in
"${bundle_type}_lw")
JBR_BASE_NAME=jbr_${bundle_type}_lw-${JBSDK_VERSION}
grep -v "jdk.compiler\|jdk.hotspot.agent" modules.list > modules_tmp.list
;;
"jfx" | "jcef" | "dcevm" | "nomod")
JBR_BUNDLE=jbr_${bundle_type}
case "${bundle_type}" in
"jfx" | "jcef" | "dcevm" | "nomod" | "fd")
JBR_BASE_NAME=jbr_${bundle_type}-${JBSDK_VERSION}
cat modules.list > modules_tmp.list
;;
"jfx_jcef")
JBR_BASE_NAME=jbr-${JBSDK_VERSION}
cat modules.list > modules_tmp.list
;;
*)
echo "***ERR*** bundle was not specified" && exit 1
echo "***ERR*** bundle was not specified" && do_exit 1
;;
esac
cat modules.list > modules_tmp.list
rm -rf ${BASE_DIR}/${JBR_BUNDLE}
JBR=$JBR_BASE_NAME-linux-x64-b$build_number
JBR=${JBR_BASE_NAME}-linux-x64-b${build_number}
echo Running jlink....
$JSDK/bin/jlink \
--module-path $JSDK/jmods --no-man-pages --compress=2 \
--add-modules $(xargs < modules_tmp.list | sed s/" "//g) --output $BASE_DIR/$JBR_BUNDLE
--add-modules $(xargs < modules_tmp.list | sed s/" "//g) --output $BASE_DIR/$JBR_BUNDLE || do_exit $?
if [[ "$bundle_type" == *jcef* ]] || [[ "$bundle_type" == *dcevm* ]]; then
if [[ "${bundle_type}" == *jcef* ]] || [[ "${bundle_type}" == *dcevm* ]] || [[ "${bundle_type}" == fd ]]; then
cp -R $BASE_DIR/$JBR_BUNDLE $BASE_DIR/jbr
cp -R ${JCEF_PATH}/* $BASE_DIR/$JBR_BUNDLE/lib || exit $?
fi
grep -v "^JAVA_VERSION" $JSDK/release | grep -v "^MODULES" >> $BASE_DIR/$JBR_BUNDLE/release
echo Creating $JBR.tar.gz ...
echo Creating ${JBR}.tar.gz ...
rm -rf ${BASE_DIR}/jbr
cp -R ${BASE_DIR}/${JBR_BUNDLE} ${BASE_DIR}/jbr
tar -pcf $JBR.tar -C $BASE_DIR jbr || exit $?
gzip $JBR.tar || exit $?
tar -pcf ${JBR}.tar -C ${BASE_DIR} jbr || do_exit $?
gzip -f ${JBR}.tar || do_exit $?
rm -rf ${BASE_DIR}/${JBR_BUNDLE}
}
JBRSDK_BASE_NAME=jbrsdk-$JBSDK_VERSION
JBRSDK_BASE_NAME=jbrsdk-${JBSDK_VERSION}
WITH_DEBUG_LEVEL="--with-debug-level=release"
RELEASE_NAME=linux-x86_64-normal-server-release
git checkout -- modules.list src/java.desktop/share/classes/module-info.java
JBSDK=${JBRSDK_BASE_NAME}-linux-x64-b${build_number}
case "$bundle_type" in
"jfx")
git apply -p0 < jb/project/tools/patches/exclude_jcef_module.patch
git apply -p0 < jb/project/tools/patches/add_jfx_module.patch || do_exit $?
do_reset_changes=1
;;
"jcef")
git apply -p0 < jb/project/tools/patches/exclude_jfx_module.patch
git apply -p0 < jb/project/tools/patches/add_jcef_module.patch || do_exit $?
do_reset_changes=1
;;
"jfx_jcef")
git apply -p0 < jb/project/tools/patches/add_jfx_module.patch || do_exit $?
git apply -p0 < jb/project/tools/patches/add_jcef_module.patch || do_exit $?
do_reset_changes=1
;;
"dcevm")
git am jb/project/tools/patches/dcevm/*.patch
HEAD_REVISION=$(git rev-parse HEAD)
git am jb/project/tools/patches/dcevm/*.patch || do_exit $?
do_reset_dcevm=1
git apply -p0 < jb/project/tools/patches/add_jcef_module.patch || do_exit $?
do_reset_changes=1
;;
"nomod")
git apply -p0 < jb/project/tools/patches/exclude_jcef_module.patch
git apply -p0 < jb/project/tools/patches/exclude_jfx_module.patch
WITH_IMPORT_MODULES=""
;;
"fd")
git apply -p0 < jb/project/tools/patches/add_jcef_module.patch || do_exit $?
do_reset_changes=1
WITH_DEBUG_LEVEL="--with-debug-level=fastdebug"
RELEASE_NAME=linux-x86_64-normal-server-fastdebug
JBSDK=${JBRSDK_BASE_NAME}-linux-x64-fastdebug-b${build_number}
;;
*)
echo "***ERR*** bundle was not specified" && do_exit 1
;;
esac
sh configure \
@@ -104,44 +124,44 @@ sh configure \
--with-version-build=${JDK_BUILD_NUMBER} \
--with-version-opt=b${build_number} \
$WITH_IMPORT_MODULES \
--enable-cds=yes || exit $?
--enable-cds=yes || do_exit $?
make images CONF=$RELEASE_NAME || exit $?
make clean images CONF=$RELEASE_NAME || do_exit $?
JSDK=build/$RELEASE_NAME/images/jdk
JBSDK=$JBRSDK_BASE_NAME-linux-x64-b$build_number
JSDK=build/${RELEASE_NAME}/images/jdk
echo Fixing permissions
chmod -R a+r $JSDK
BASE_DIR=build/$RELEASE_NAME/images
BASE_DIR=build/${RELEASE_NAME}/images
JBRSDK_BUNDLE=jbrsdk
rm -rf $BASE_DIR/$JBRSDK_BUNDLE
cp -r $JSDK $BASE_DIR/$JBRSDK_BUNDLE || exit $?
rm -rf ${BASE_DIR}/${JBRSDK_BUNDLE}
cp -r $JSDK $BASE_DIR/$JBRSDK_BUNDLE || do_exit $?
if [[ "$bundle_type" == *jcef* ]] || [[ "$bundle_type" == *dcevm* ]]; then
cp -R ${JCEF_PATH}/* $BASE_DIR/$JBRSDK_BUNDLE/lib || exit $?
if [[ "${bundle_type}" == *jcef* ]] || [[ "${bundle_type}" == *dcevm* ]] || [[ "${bundle_type}" == fd ]]; then
cp -R ${JCEF_PATH}/* $BASE_DIR/$JBRSDK_BUNDLE/lib || do_exit $?
fi
if [ "$bundle_type" == "jfx_jcef" ]; then
if [ "${bundle_type}" == "jcef" ] || [ "${bundle_type}" == "fd" ]; then
echo Creating $JBSDK.tar.gz ...
sed 's/JBR/JBRSDK/g' ${BASE_DIR}/${JBRSDK_BUNDLE}/release > release
mv release ${BASE_DIR}/${JBRSDK_BUNDLE}/release
tar -pcf $JBSDK.tar --exclude=*.debuginfo --exclude=demo --exclude=sample --exclude=man \
-C $BASE_DIR $JBRSDK_BUNDLE || exit $?
gzip $JBSDK.tar || exit $?
tar -pcf ${JBSDK}.tar --exclude=*.debuginfo --exclude=demo --exclude=sample --exclude=man \
-C ${BASE_DIR} ${JBRSDK_BUNDLE} || do_exit $?
gzip -f ${JBSDK}.tar || do_exit $?
fi
JBR_BUNDLE=jbr_${bundle_type}
create_jbr ${bundle_type}
create_jbr || do_exit $?
if [ "$bundle_type" == "jfx_jcef" ]; then
make test-image || exit $?
if [ "$bundle_type" == "jcef" ]; then
make test-image CONF=$RELEASE_NAME || do_exit $?
JBRSDK_TEST=$JBRSDK_BASE_NAME-linux-test-x64-b$build_number
echo Creating $JBSDK_TEST.tar.gz ...
tar -pcf $JBRSDK_TEST.tar -C $BASE_DIR --exclude='test/jdk/demos' test || exit $?
gzip $JBRSDK_TEST.tar || exit $?
fi
tar -pcf ${JBRSDK_TEST}.tar -C ${BASE_DIR} --exclude='test/jdk/demos' test || do_exit $?
gzip -f ${JBRSDK_TEST}.tar || do_exit $?
fi
do_exit 0

View File

@@ -1,90 +0,0 @@
#!/bin/bash -x
# The following parameters must be specified:
# JBSDK_VERSION - specifies the current version of OpenJDK e.g. 11_0_6
# JDK_BUILD_NUMBER - specifies the number of OpenJDK build or the value of --with-version-build argument to configure
# build_number - specifies the number of JetBrainsRuntime build
# bundle_type - specifies bundle to bu built; possible values:
# jcef - the bundles 1) jbr with jcef+javafx, 2) jbrsdk and 3) test will be created
# jfx - the bundle 1) jbr with javafx only will be created
#
# jbrsdk-${JBSDK_VERSION}-osx-x64-b${build_number}.tar.gz
# jbr-${JBSDK_VERSION}-osx-x64-b${build_number}.tar.gz
#
# $ ./java --version
# openjdk 11.0.6 2020-01-14
# OpenJDK Runtime Environment (build 11.0.6+${JDK_BUILD_NUMBER}-b${build_number})
# OpenJDK 64-Bit Server VM (build 11.0.6+${JDK_BUILD_NUMBER}-b${build_number}, mixed mode)
#
# Environment variables:
# MODULAR_SDK_PATH - specifies the path to the directory where imported modules are located.
# By default imported modules should be located in ./modular-sdk
# JCEF_PATH - specifies the path to the directory where JCEF binaries are located.
# By default imported modules should be located in ./jcef_linux_x64
JBSDK_VERSION=$1
JDK_BUILD_NUMBER=$2
build_number=$3
JBSDK_VERSION_WITH_DOTS=$(echo $JBSDK_VERSION | sed 's/_/\./g')
WITH_IMPORT_MODULES="--with-import-modules=${MODULAR_SDK_PATH:=./modular-sdk}"
JCEF_PATH=${JCEF_PATH:=./jcef_linux_x64}
source jb/project/tools/common.sh
JBRSDK_BASE_NAME=jbrsdk-${JBSDK_VERSION}
WITH_DEBUG_LEVEL="--with-debug-level=fastdebug"
sh configure \
--disable-warnings-as-errors \
$WITH_DEBUG_LEVEL \
--with-vendor-name="${VENDOR_NAME}" \
--with-vendor-version-string="${VENDOR_VERSION_STRING}" \
--with-version-pre= \
--with-version-build=${JDK_BUILD_NUMBER} \
--with-version-opt=b${build_number} \
--with-import-modules=./modular-sdk \
--enable-cds=yes || exit $?
make clean CONF=linux-x86_64-normal-server-fastdebug || exit $?
make images CONF=linux-x86_64-normal-server-fastdebug || exit $?
JBSDK=${JBRSDK_BASE_NAME}-linux-x64-fastdebug-b${build_number}
BASE_DIR=build/linux-x86_64-normal-server-fastdebug/images
JSDK=${BASE_DIR}/jdk
JBRSDK_BUNDLE=jbrsdk
echo Fixing permissions
chmod -R a+r $JSDK
rm -rf $BASE_DIR/$JBRSDK_BUNDLE
cp -r $JSDK $BASE_DIR/$JBRSDK_BUNDLE || exit $?
cp -R jcef_linux_x64/* $BASE_DIR/$JBRSDK_BUNDLE/lib || exit $?
echo Creating $JBSDK.tar.gz ...
sed 's/JBR/JBRSDK/g' ${BASE_DIR}/${JBRSDK_BUNDLE}/release > release
mv release ${BASE_DIR}/${JBRSDK_BUNDLE}/release
tar -pcf $JBSDK.tar \
--exclude=*.debuginfo --exclude=demo --exclude=sample --exclude=man \
-C $BASE_DIR ${JBRSDK_BUNDLE} || exit $?
gzip $JBSDK.tar || exit $?
JBR_BUNDLE=jbr
JBR_BASE_NAME=jbr-$JBSDK_VERSION
rm -rf $BASE_DIR/$JBR_BUNDLE
JBR=$JBR_BASE_NAME-linux-x64-fastdebug-b$build_number
echo Running jlink....
${JSDK}/bin/jlink \
--module-path ${JSDK}/jmods --no-man-pages --compress=2 \
--add-modules $(xargs < modules.list | sed s/" "//g | sed s/,$//g) \
--output ${BASE_DIR}/${JBR_BUNDLE} || exit $?
cp -R jcef_linux_x64/* $BASE_DIR/$JBR_BUNDLE/lib || exit $?
echo Modifying release info ...
grep -v \"^JAVA_VERSION\" ${JSDK}/release | grep -v \"^MODULES\" >> ${BASE_DIR}/${JBR_BUNDLE}/release
echo Creating $JBR.tar.gz ...
tar -czf $JBR.tar -C $BASE_DIR ${JBR_BUNDLE} || exit $?
gzip $JBR.tar || exit $?

View File

@@ -1,10 +0,0 @@
#!/bin/bash -x
JBSDK_VERSION=$1
JDK_BUILD_NUMBER=$2
build_number=$3
script_dir=jb/project/tools/mac/scripts
${script_dir}/mkimages.sh $JBSDK_VERSION $JDK_BUILD_NUMBER $build_number "jcef" || exit $?
${script_dir}/mkimages.sh $JBSDK_VERSION $JDK_BUILD_NUMBER $build_number "jfx" || exit $?
${script_dir}/mkimages.sh $JBSDK_VERSION $JDK_BUILD_NUMBER $build_number "dcevm" || exit $?
${script_dir}/mkimages.sh $JBSDK_VERSION $JDK_BUILD_NUMBER $build_number "jfx_jcef" || exit $?

View File

@@ -1,12 +1,16 @@
#!/bin/bash -x
# The following parameters must be specified:
# JBSDK_VERSION - specifies the current version of OpenJDK e.g. 11_0_6
# JDK_BUILD_NUMBER - specifies the number of OpenJDK build or the value of --with-version-build argument to configure
# JBSDK_VERSION - specifies major version of OpenJDK e.g. 11_0_6 (instead of dots '.' underbars "_" are used)
# JDK_BUILD_NUMBER - specifies update release of OpenJDK build or the value of --with-version-build argument to configure
# build_number - specifies the number of JetBrainsRuntime build
# bundle_type - specifies bundle to bu built; possible values:
# jcef - the bundles 1) jbr with jcef+javafx, 2) jbrsdk and 3) test will be created
# jfx - the bundle 1) jbr with javafx only will be created
# bundle_type - specifies bundle to be built; possible values:
# jcef - the release bundles with jcef
# jfx - the release bundles with javafx
# jcef_jfx - the release bundles with jcef and javafx
# dcevm - the release bundles with dcevm patches
# nomod - the release bundles without any additional modules (jcef)
# fd - the fastdebug bundles which also include the jcef module
#
# jbrsdk-${JBSDK_VERSION}-osx-x64-b${build_number}.tar.gz
# jbr-${JBSDK_VERSION}-osx-x64-b${build_number}.tar.gz
@@ -19,8 +23,8 @@
# Environment variables:
# MODULAR_SDK_PATH - specifies the path to the directory where imported modules are located.
# By default imported modules should be located in ./modular-sdk
# JCEF_PATH - specifies the path to the directory where JCEF binaries are located.
# By default imported modules should be located in ./jcef_mac
# JCEF_PATH - specifies the path to the directory with JCEF binaries.
# By default JCEF binaries should be located in ./jcef_mac
JBSDK_VERSION=$1
JDK_BUILD_NUMBER=$2
@@ -34,23 +38,20 @@ source jb/project/tools/common.sh
function create_jbr {
case "$1" in
"${bundle_type}_lw")
JBR_BASE_NAME=jbr_${bundle_type}_lw-${JBSDK_VERSION}
grep -v "jdk.compiler\|jdk.hotspot.agent" modules.list > modules_tmp.list
;;
"jfx" | "jcef" | "dcevm" | "nomod")
JBR_BUNDLE=jbr_${bundle_type}
case "${bundle_type}" in
"jfx" | "jcef" | "dcevm" | "nomod" | "fd")
JBR_BASE_NAME=jbr_${bundle_type}-${JBSDK_VERSION}
cat modules.list > modules_tmp.list
;;
"jfx_jcef")
JBR_BASE_NAME=jbr-${JBSDK_VERSION}
cat modules.list > modules_tmp.list
;;
*)
echo "***ERR*** bundle was not specified" && exit 1
echo "***ERR*** bundle was not specified" && do_exit 1
;;
esac
cat modules.list > modules_tmp.list
rm -rf ${BASE_DIR}/${JBR_BUNDLE}
JRE_CONTENTS=${BASE_DIR}/${JBR_BUNDLE}/Contents
@@ -62,44 +63,64 @@ function create_jbr {
JBR=${JBR_BASE_NAME}-osx-x64-b${build_number}
echo Running jlink....
${BASE_DIR}/$JBRSDK_BUNDLE/Contents/Home/bin/jlink \
--module-path ${BASE_DIR}/${JBRSDK_BUNDLE}/Contents/Home/jmods --no-man-pages --compress=2 \
--add-modules $(xargs < modules_tmp.list | sed s/" "//g) --output ${JRE_HOME} || exit $?
--add-modules $(xargs < modules_tmp.list | sed s/" "//g) --output ${JRE_HOME} || do_exit $?
grep -v "^JAVA_VERSION" ${BASE_DIR}/${JBRSDK_BUNDLE}/Contents/Home/release | grep -v "^MODULES" >> ${JRE_HOME}/release
cp -R ${BASE_DIR}/${JBRSDK_BUNDLE}/Contents/MacOS ${JRE_CONTENTS}
cp ${BASE_DIR}/${JBRSDK_BUNDLE}/Contents/Info.plist ${JRE_CONTENTS}
if [[ "${bundle_type}" == *jcef* ]] || [[ "${bundle_type}" == *dcevm* ]]; then
rm -rf ${JRE_CONTENTS}/Frameworks || exit $?
cp -a ${JCEF_PATH}/Frameworks ${JRE_CONTENTS} || exit $?
if [[ "${bundle_type}" == *jcef* ]] || [[ "${bundle_type}" == *dcevm* ]] || [[ "${bundle_type}" == fd ]]; then
rm -rf ${JRE_CONTENTS}/Frameworks || do_exit $?
cp -a ${JCEF_PATH}/Frameworks ${JRE_CONTENTS} || do_exit $?
fi
echo Creating ${JBR}.tar.gz ...
rm -rf ${BASE_DIR}/jbr
cp -R ${BASE_DIR}/${JBR_BUNDLE} ${BASE_DIR}/jbr
COPYFILE_DISABLE=1 tar -pczf ${JBR}.tar.gz --exclude='*.dSYM' --exclude='man' -C ${BASE_DIR} jbr || exit $?
COPYFILE_DISABLE=1 tar -pczf ${JBR}.tar.gz --exclude='*.dSYM' --exclude='man' -C ${BASE_DIR} jbr || do_exit $?
rm -rf ${BASE_DIR}/${JBR_BUNDLE}
}
JBRSDK_BASE_NAME=jbrsdk-${JBSDK_VERSION}
WITH_DEBUG_LEVEL="--with-debug-level=release"
RELEASE_NAME=macosx-x86_64-normal-server-release
git checkout -- modules.list src/java.desktop/share/classes/module-info.java
JBSDK=${JBRSDK_BASE_NAME}-osx-x64-b${build_number}
case "$bundle_type" in
"jfx")
git apply -p0 < jb/project/tools/patches/exclude_jcef_module.patch
git apply -p0 < jb/project/tools/patches/add_jfx_module.patch || do_exit $?
do_reset_changes=1
;;
"jcef")
git apply -p0 < jb/project/tools/patches/exclude_jfx_module.patch
git apply -p0 < jb/project/tools/patches/add_jcef_module.patch || do_exit $?
do_reset_changes=1
;;
"jfx_jcef")
git apply -p0 < jb/project/tools/patches/add_jfx_module.patch || do_exit $?
git apply -p0 < jb/project/tools/patches/add_jcef_module.patch || do_exit $?
do_reset_changes=1
;;
"dcevm")
git am jb/project/tools/patches/dcevm/*.patch
HEAD_REVISION=$(git rev-parse HEAD)
git am jb/project/tools/patches/dcevm/*.patch || do_exit $?
do_reset_dcevm=1
git apply -p0 < jb/project/tools/patches/add_jcef_module.patch || do_exit $?
do_reset_changes=1
;;
"nomod")
git apply -p0 < jb/project/tools/patches/exclude_jcef_module.patch
git apply -p0 < jb/project/tools/patches/exclude_jfx_module.patch
WITH_IMPORT_MODULES=""
;;
"fd")
git apply -p0 < jb/project/tools/patches/add_jcef_module.patch || do_exit $?
do_reset_changes=1
WITH_DEBUG_LEVEL="--with-debug-level=fastdebug"
RELEASE_NAME=macosx-x86_64-normal-server-fastdebug
JBSDK=${JBRSDK_BASE_NAME}-osx-x64-fastdebug-b${build_number}
;;
*)
echo "***ERR*** bundle was not specified" && do_exit 1
;;
esac
sh configure \
@@ -112,42 +133,45 @@ sh configure \
--with-version-opt=b${build_number} \
$WITH_IMPORT_MODULES \
--with-boot-jdk=`/usr/libexec/java_home -v 11` \
--enable-cds=yes || exit $?
--enable-cds=yes || do_exit $?
make clean images CONF=$RELEASE_NAME || exit $?
make clean CONF=$RELEASE_NAME || do_exit $?
make images CONF=$RELEASE_NAME || do_exit $?
JSDK=build/$RELEASE_NAME/images/jdk-bundle
JBSDK=${JBRSDK_BASE_NAME}-osx-x64-b${build_number}
JSDK=build/${RELEASE_NAME}/images/jdk-bundle
BASE_DIR=jre
JBRSDK_BUNDLE=jbrsdk
rm -rf $BASE_DIR
mkdir $BASE_DIR || exit $?
cp -a $JSDK/jdk-$JBSDK_VERSION_WITH_DOTS.jdk $BASE_DIR/$JBRSDK_BUNDLE || exit $?
mkdir $BASE_DIR || do_exit $?
cp -a $JSDK/jdk-$JBSDK_VERSION_WITH_DOTS.jdk $BASE_DIR/$JBRSDK_BUNDLE || do_exit $?
if [[ "$bundle_type" == *jcef* ]] || [[ "$bundle_type" == *dcevm* ]]; then
if [[ "${bundle_type}" == *jcef* ]] || [[ "${bundle_type}" == *dcevm* ]] || [[ "${bundle_type}" == fd ]]; then
cp -a ${JCEF_PATH}/Frameworks $BASE_DIR/$JBRSDK_BUNDLE/Contents/
fi
if [ "$bundle_type" == "jfx_jcef" ]; then
if [ "${bundle_type}" == "jcef" ] || [ "{$bundle_type}" == "fd" ]; then
echo Creating $JBSDK.tar.gz ...
sed 's/JBR/JBRSDK/g' ${BASE_DIR}/${JBRSDK_BUNDLE}/Contents/Home/release > release
mv release ${BASE_DIR}/${JBRSDK_BUNDLE}/Contents/Home/release
COPYFILE_DISABLE=1 tar -pczf $JBSDK.tar.gz -C $BASE_DIR \
[ -f "${JBSDK}.tar.gz" ] && rm "${JBSDK}.tar.gz"
COPYFILE_DISABLE=1 tar -pczf ${JBSDK}.tar.gz -C ${BASE_DIR} \
--exclude='._*' --exclude='.DS_Store' --exclude='*~' \
--exclude='Home/demo' --exclude='Home/man' --exclude='Home/sample' \
$JBRSDK_BUNDLE || exit $?
${JBRSDK_BUNDLE} || do_exit $?
fi
JBR_BUNDLE=jbr_${bundle_type}
create_jbr "${bundle_type}" || exit $?
create_jbr || do_exit $?
if [ "$bundle_type" == "jfx_jcef" ]; then
make test-image || exit $?
if [ "$bundle_type" == "jcef" ]; then
make test-image CONF=$RELEASE_NAME || do_exit $?
JBRSDK_TEST=$JBRSDK_BASE_NAME-osx-test-x64-b$build_number
echo Creating $JBRSDK_TEST.tar.gz ...
COPYFILE_DISABLE=1 tar -pczf $JBRSDK_TEST.tar.gz -C build/macosx-x86_64-normal-server-release/images \
--exclude='test/jdk/demos' test || exit $?
fi
[ -f "${JBRSDK_TEST}.tar.gz" ] && rm "${JBRSDK_TEST}.tar.gz"
COPYFILE_DISABLE=1 tar -pczf ${JBRSDK_TEST}.tar.gz -C build/${RELEASE_NAME}/images \
--exclude='test/jdk/demos' test || do_exit $?
fi
do_exit 0

View File

@@ -1,99 +0,0 @@
#!/bin/bash -x
# The following parameters must be specified:
# JBSDK_VERSION - specifies the current version of OpenJDK e.g. 11_0_6
# JDK_BUILD_NUMBER - specifies the number of OpenJDK build or the value of --with-version-build argument to configure
# build_number - specifies the number of JetBrainsRuntime build
# bundle_type - specifies bundle to bu built; possible values:
# jcef - the bundles 1) jbr with jcef+javafx, 2) jbrsdk and 3) test will be created
# jfx - the bundle 1) jbr with javafx only will be created
#
# jbrsdk-${JBSDK_VERSION}-osx-x64-b${build_number}.tar.gz
# jbr-${JBSDK_VERSION}-osx-x64-b${build_number}.tar.gz
#
# $ ./java --version
# openjdk 11.0.6 2020-01-14
# OpenJDK Runtime Environment (build 11.0.6+${JDK_BUILD_NUMBER}-b${build_number})
# OpenJDK 64-Bit Server VM (build 11.0.6+${JDK_BUILD_NUMBER}-b${build_number}, mixed mode)
#
# Environment variables:
# MODULAR_SDK_PATH - specifies the path to the directory where imported modules are located.
# By default imported modules should be located in ./modular-sdk
# JCEF_PATH - specifies the path to the directory where JCEF binaries are located.
# By default imported modules should be located in ./jcef_mac
JBSDK_VERSION=$1
JDK_BUILD_NUMBER=$2
build_number=$3
JBSDK_VERSION_WITH_DOTS=$(echo $JBSDK_VERSION | sed 's/_/\./g')
WITH_IMPORT_MODULES="--with-import-modules=${MODULAR_SDK_PATH:=./modular-sdk}"
JCEF_PATH=${JCEF_PATH:=./jcef_mac}
source jb/project/tools/common.sh
JBRSDK_BASE_NAME=jbrsdk-${JBSDK_VERSION}
WITH_DEBUG_LEVEL="--with-debug-level=fastdebug"
sh configure \
--disable-warnings-as-errors \
$WITH_DEBUG_LEVEL \
--with-vendor-name="${VENDOR_NAME}" \
--with-vendor-version-string="${VENDOR_VERSION_STRING}" \
--with-version-pre= \
--with-version-build=${JDK_BUILD_NUMBER} \
--with-version-opt=b${build_number} \
$WITH_IMPORT_MODULES \
--with-boot-jdk=`/usr/libexec/java_home -v 11` \
--enable-cds=yes || exit $?
make clean CONF=macosx-x86_64-normal-server-fastdebug || exit $?
make images CONF=macosx-x86_64-normal-server-fastdebug || exit $?
JSDK=build/macosx-x86_64-normal-server-fastdebug/images/jdk-bundle
JBSDK=${JBRSDK_BASE_NAME}-osx-x64-fastdebug-b${build_number}
BASE_DIR=jre
JBRSDK_BUNDLE=jbrsdk
rm -rf $BASE_DIR
mkdir $BASE_DIR || exit $?
JBSDK_VERSION_WITH_DOTS=$(echo $JBSDK_VERSION | sed 's/_/\./g')
cp -a $JSDK/jdk-$JBSDK_VERSION_WITH_DOTS.jdk $BASE_DIR/$JBRSDK_BUNDLE || exit $?
echo Creating $JBSDK.tar.gz ...
cp -a ${JCEF_PATH}/Frameworks $BASE_DIR/$JBRSDK_BUNDLE/Contents/
sed 's/JBR/JBRSDK/g' ${BASE_DIR}/${JBRSDK_BUNDLE}/Contents/Home/release > release
mv release ${BASE_DIR}/${JBRSDK_BUNDLE}/Contents/Home/release
COPYFILE_DISABLE=1 \
tar -pczf ${JBSDK}.tar.gz -C ${BASE_DIR} \
--exclude='._*' --exclude='.DS_Store' --exclude='*~' \
--exclude='Home/demo' --exclude='Home/man' --exclude='Home/sample' \
${JBRSDK_BUNDLE} || exit $?
JBR_BUNDLE=jbr
JRE_CONTENTS=$BASE_DIR/$JBR_BUNDLE/Contents
JRE_HOME=$JRE_CONTENTS/Home
JBR_BASE_NAME=jbr-$JBSDK_VERSION
mkdir -p $JRE_CONTENTS
if [ -d "$JRE_HOME" ]; then
rm -rf $JRE_HOME
fi
JBR=${JBR_BASE_NAME}-osx-x64-fastdebug-b${build_number}
$BASE_DIR/$JBRSDK_BUNDLE/Contents/Home/bin/jlink \
--module-path $BASE_DIR/$JBRSDK_BUNDLE/Contents/Home/jmods --no-man-pages --compress=2 \
--add-modules $(xargs < modules.list | sed s/" "//g) --output $JRE_HOME || exit $?
grep -v "^JAVA_VERSION" $BASE_DIR/$JBRSDK_BUNDLE/Contents/Home/release | grep -v "^MODULES" >> $JRE_HOME/release
cp -R $BASE_DIR/$JBRSDK_BUNDLE/Contents/MacOS $JRE_CONTENTS
cp $BASE_DIR/$JBRSDK_BUNDLE/Contents/Info.plist $JRE_CONTENTS
cp -a ${JCEF_PATH}/Frameworks ${JRE_CONTENTS} || exit $?
echo Creating $JBR.tar.gz ...
COPYFILE_DISABLE=1 tar -pczf $JBR.tar.gz --exclude='*.dSYM' --exclude='man' -C $BASE_DIR $JBR_BUNDLE || exit $?

View File

@@ -0,0 +1,30 @@
diff --git modules.list modules.list
index e23d793..368d022 100644
--- modules.list
+++ modules.list
@@ -54,4 +54,7 @@ jdk.security.jgss,
jdk.unsupported,
jdk.xml.dom,
jdk.zipfs,
-jdk.hotspot.agent
+jdk.hotspot.agent,
+jcef,
+gluegen.rt,
+jogl.all
diff --git src/java.desktop/share/classes/module-info.java src/java.desktop/share/classes/module-info.java
index b663b38..3e9acdc 100644
--- src/java.desktop/share/classes/module-info.java
+++ src/java.desktop/share/classes/module-info.java
@@ -109,7 +109,11 @@ module java.desktop {
// see make/GensrcModuleInfo.gmk
exports sun.awt to
jdk.accessibility,
- jdk.unsupported.desktop;
+ jdk.unsupported.desktop,
+ jcef,
+ jogl.all;
+
+ exports java.awt.peer to jcef;
exports java.awt.dnd.peer to jdk.unsupported.desktop;
exports sun.awt.dnd to jdk.unsupported.desktop;

View File

@@ -0,0 +1,18 @@
diff --git modules.list modules.list
index e23d793ca61..14b9a6c8e50 100644
--- modules.list
+++ modules.list
@@ -20,6 +20,13 @@ java.sql.rowset,
java.transaction.xa,
java.xml,
java.xml.crypto,
+javafx.base,
+javafx.controls,
+javafx.fxml,
+javafx.graphics,
+javafx.media,
+javafx.swing,
+javafx.web,
jdk.accessibility,
jdk.aot,
jdk.attach,

View File

@@ -1,33 +0,0 @@
Index: src/java.desktop/share/classes/module-info.java
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
--- src/java.desktop/share/classes/module-info.java (revision 5ae6630e3ebc71beb9f9df63b1b5bc19c9405d1f)
+++ src/java.desktop/share/classes/module-info.java (date 1588168285537)
@@ -109,10 +109,7 @@
// see make/GensrcModuleInfo.gmk
exports sun.awt to
jdk.accessibility,
- jdk.unsupported.desktop,
- jcef;
-
- exports java.awt.peer to jcef;
+ jdk.unsupported.desktop;
exports java.awt.dnd.peer to jdk.unsupported.desktop;
exports sun.awt.dnd to jdk.unsupported.desktop;
Index: modules.list
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
--- modules.list (revision 5ae6630e3ebc71beb9f9df63b1b5bc19c9405d1f)
+++ modules.list (date 1588168285505)
@@ -61,5 +61,4 @@
jdk.unsupported,
jdk.xml.dom,
jdk.zipfs,
-jdk.hotspot.agent,
-jcef
+jdk.hotspot.agent

View File

@@ -1,21 +0,0 @@
Index: modules.list
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
--- modules.list (revision ab073976c4f85f154ff1421b7ac888eee86b6595)
+++ modules.list (date 1588171510146)
@@ -20,13 +20,6 @@
java.transaction.xa,
java.xml,
java.xml.crypto,
-javafx.base,
-javafx.controls,
-javafx.fxml,
-javafx.graphics,
-javafx.media,
-javafx.swing,
-javafx.web,
jdk.accessibility,
jdk.aot,
jdk.attach,

View File

@@ -1,10 +0,0 @@
#!/bin/bash -x
JBSDK_VERSION=$1
JDK_BUILD_NUMBER=$2
build_number=$3
script_dir=jb/project/tools/windows/scripts
${script_dir}/mkimages_x64.sh $JBSDK_VERSION $JDK_BUILD_NUMBER $build_number "jcef" || exit $?
${script_dir}/mkimages_x64.sh $JBSDK_VERSION $JDK_BUILD_NUMBER $build_number "jfx" || exit $?
${script_dir}/mkimages_x64.sh $JBSDK_VERSION $JDK_BUILD_NUMBER $build_number "dcevm" || exit $?
${script_dir}/mkimages_x64.sh $JBSDK_VERSION $JDK_BUILD_NUMBER $build_number "jfx_jcef" || exit $?

View File

@@ -1,12 +1,16 @@
#!/bin/bash -x
# The following parameters must be specified:
# JBSDK_VERSION - specifies the current version of OpenJDK e.g. 11_0_6
# JDK_BUILD_NUMBER - specifies the number of OpenJDK build or the value of --with-version-build argument to configure
# JBSDK_VERSION - specifies major version of OpenJDK e.g. 11_0_6 (instead of dots '.' underbars "_" are used)
# JDK_BUILD_NUMBER - specifies update release of OpenJDK build or the value of --with-version-build argument to configure
# build_number - specifies the number of JetBrainsRuntime build
# bundle_type - specifies bundle to bu built; possible values:
# jcef - the bundles 1) jbr with jcef+javafx, 2) jbrsdk and 3) test will be created
# jfx - the bundle 1) jbr with javafx only will be created
# bundle_type - specifies bundle to be built; possible values:
# jcef - the release bundles with jcef
# jfx - the release bundles with javafx
# jcef_jfx - the release bundles with jcef and javafx
# dcevm - the release bundles with dcevm patches
# nomod - the release bundles without any additional modules (jcef)
# fd - the fastdebug bundles which also include the jcef module
#
# jbrsdk-${JBSDK_VERSION}-osx-x64-b${build_number}.tar.gz
# jbr-${JBSDK_VERSION}-osx-x64-b${build_number}.tar.gz
@@ -19,104 +23,124 @@
# Environment variables:
# MODULAR_SDK_PATH - specifies the path to the directory where imported modules are located.
# By default imported modules should be located in ./modular-sdk
# JCEF_PATH - specifies the path to the directory where JCEF binaries are located.
# By default imported modules should be located in ./jcef_win_x64
# JCEF_PATH - specifies the path to the directory with JCEF binaries.
# By default JCEF binaries should be located in ./jcef_win_x64
JBSDK_VERSION=$1
JDK_BUILD_NUMBER=$2
build_number=$3
bundle_type=$4
JBSDK_VERSION_WITH_DOTS=$(echo $JBSDK_VERSION | sed 's/_/\./g')
WORK_DIR=$(pwd)
WITH_IMPORT_MODULES="--with-import-modules=${MODULAR_SDK_PATH:=${WORK_DIR}/modular-sdk}"
JCEF_PATH=${JCEF_PATH:=./jcef_win_x64}
JCEF_PATH=${JCEF_PATH:=${WORK_DIR}/jcef_win_x64}
TOOLCHAIN_VERSION=${TOOLCHAIN_VERSION:=2015}
source jb/project/tools/common.sh
function create_jbr {
case "$1" in
"${bundle_type}_lw")
grep -v "jdk.compiler\|jdk.hotspot.agent" modules.list > modules_tmp.list
JBR_BUNDLE=jbr_${bundle_type}
case "${bundle_type}" in
"jfx" | "jcef" | "dcevm" | "nomod" | "fd")
JBR_BASE_NAME=jbr_${bundle_type}-${JBSDK_VERSION}
;;
"jfx" | "jcef" | "jfx_jcef" | "dcevm" | "nomod")
cat modules.list > modules_tmp.list
"jfx_jcef")
JBR_BASE_NAME=jbr-${JBSDK_VERSION}
;;
*)
echo "***ERR*** bundle was not specified" && exit 1
echo "***ERR*** bundle was not specified" && do_exit 1
;;
esac
cat modules.list > modules_tmp.list
rm -rf ${JBR_BUNDLE}
echo Running jlink....
${JSDK}/bin/jlink \
--module-path ${JSDK}/jmods --no-man-pages --compress=2 \
--add-modules $(xargs < modules_tmp.list | sed s/" "//g) --output ${JBR_BUNDLE} || exit $?
if [[ "${bundle_type}" == *jcef* ]] || [[ "${bundle_type}" == *dcevm* ]]
--add-modules $(xargs < modules_tmp.list | sed s/" "//g) --output ${JBR_BUNDLE} || do_exit $?
if [[ "${bundle_type}" == *jcef* ]] || [[ "${bundle_type}" == *dcevm* ]] || [[ "${bundle_type}" == fd ]]
then
cp -R ${JCEF_PATH}/* ${JBR_BUNDLE}/bin
cp -R ${JCEF_PATH}/* ${JBR_BUNDLE}/bin || do_exit $?
fi
echo Modifying release info ...
cat ${JSDK}/release | tr -d '\r' | grep -v 'JAVA_VERSION' | grep -v 'MODULES' >> ${JBR_BUNDLE}/release
}
JBRSDK_BASE_NAME=jbrsdk-${JBSDK_VERSION}
WORK_DIR=$(pwd)
WITH_DEBUG_LEVEL="--with-debug-level=release"
RELEASE_NAME=windows-x86_64-normal-server-release
git checkout -- modules.list src/java.desktop/share/classes/module-info.java
JBSDK=${JBRSDK_BASE_NAME}-windows-x64-b${build_number}
case "$bundle_type" in
"jfx")
echo "Excluding jcef modules"
git apply -p0 < jb/project/tools/patches/exclude_jcef_module.patch
git apply -p0 < jb/project/tools/patches/add_jfx_module.patch || do_exit $?
do_reset_changes=1
;;
"jcef")
echo "Excluding jfx modules"
git apply -p0 < jb/project/tools/patches/exclude_jfx_module.patch
git apply -p0 < jb/project/tools/patches/add_jcef_module.patch || do_exit $?
do_reset_changes=1
;;
"jfx_jcef")
git apply -p0 < jb/project/tools/patches/add_jfx_module.patch || do_exit $?
git apply -p0 < jb/project/tools/patches/add_jcef_module.patch || do_exit $?
do_reset_changes=1
;;
"dcevm")
echo "Adding dcevm patches"
git am jb/project/tools/patches/dcevm/*.patch
HEAD_REVISION=$(git rev-parse HEAD)
git am jb/project/tools/patches/dcevm/*.patch || do_exit $?
do_reset_dcevm=1
git apply -p0 < jb/project/tools/patches/add_jcef_module.patch || do_exit $?
do_reset_changes=1
;;
"nomod")
git apply -p0 < jb/project/tools/patches/exclude_jcef_module.patch
git apply -p0 < jb/project/tools/patches/exclude_jfx_module.patch
WITH_IMPORT_MODULES=""
;;
"fd")
git apply -p0 < jb/project/tools/patches/add_jcef_module.patch || do_exit $?
do_reset_changes=1
WITH_DEBUG_LEVEL="--with-debug-level=fastdebug"
RELEASE_NAME=windows-x86_64-normal-server-fastdebug
JBRSDK_BASE_NAME=jbrsdk-${JBSDK_VERSION}-fastdebug
JBSDK=${JBRSDK_BASE_NAME}-windows-x64-fastdebug-b${build_number}
;;
*)
echo "***ERR*** bundle was not specified" && do_exit 1
;;
esac
PATH="/usr/local/bin:/usr/bin:${PATH}"
./configure \
sh ./configure \
--disable-warnings-as-errors \
$WITH_DEBUG_LEVEL \
--with-target-bits=64 \
--with-vendor-name="${VENDOR_NAME}" \
--with-vendor-version-string="${VENDOR_VERSION_STRING}" \
--with-version-pre= \
--with-version-build=${JDK_BUILD_NUMBER} \
--with-version-opt=b${build_number} \
$WITH_IMPORT_MODULES \
--with-toolchain-version=2015 \
--with-toolchain-version=${TOOLCHAIN_VERSION} \
--with-boot-jdk=${BOOT_JDK} \
--disable-ccache \
--enable-cds=yes || exit 1
--enable-cds=yes || do_exit $?
if [ "$bundle_type" == "jfx_jcef" ]; then
make LOG=info clean images CONF=$RELEASE_NAME test-image || exit 1
if [ "${bundle_type}" == "jcef" ]; then
make LOG=info clean images test-image CONF=$RELEASE_NAME || do_exit $?
else
make LOG=info clean images CONF=$RELEASE_NAME || exit 1
make LOG=info clean images CONF=$RELEASE_NAME || do_exit $?
fi
JSDK=build/$RELEASE_NAME/images/jdk
if [[ "$bundle_type" == *jcef* ]]; then
JBSDK=${JBRSDK_BASE_NAME}-windows-x64-b${build_number}
fi
BASE_DIR=build/$RELEASE_NAME/images
JBRSDK_BUNDLE=jbrsdk
rm -rf ${BASE_DIR}/${JBRSDK_BUNDLE} && rsync -a --exclude demo --exclude sample ${JSDK}/ ${JBRSDK_BUNDLE} || exit 1
cp -R ${JCEF_PATH}/* ${JBRSDK_BUNDLE}/bin
sed 's/JBR/JBRSDK/g' ${JSDK}/release > release
mv release ${JBRSDK_BUNDLE}/release
rm -rf ${BASE_DIR}/${JBRSDK_BUNDLE} && rsync -a --exclude demo --exclude sample ${JSDK}/ ${JBRSDK_BUNDLE} || do_exit $?
if [[ "${bundle_type}" == *jcef* ]] || [[ "${bundle_type}" == *dcevm* ]] || [[ "${bundle_type}" == fd ]]
then
cp -R ${JCEF_PATH}/* ${JBRSDK_BUNDLE}/bin
sed 's/JBR/JBRSDK/g' ${JSDK}/release > release
mv release ${JBRSDK_BUNDLE}/release
fi
JBR_BUNDLE=jbr_${bundle_type}
create_jbr ${bundle_type}
create_jbr || do_exit $?
do_exit 0

View File

@@ -1,76 +0,0 @@
#!/bin/bash -x
# The following parameters must be specified:
# JBSDK_VERSION - specifies the current version of OpenJDK e.g. 11_0_6
# JDK_BUILD_NUMBER - specifies the number of OpenJDK build or the value of --with-version-build argument to configure
# build_number - specifies the number of JetBrainsRuntime build
# bundle_type - specifies bundle to bu built; possible values:
# jcef - the bundles 1) jbr with jcef+javafx, 2) jbrsdk and 3) test will be created
# jfx - the bundle 1) jbr with javafx only will be created
#
# jbrsdk-${JBSDK_VERSION}-osx-x64-b${build_number}.tar.gz
# jbr-${JBSDK_VERSION}-osx-x64-b${build_number}.tar.gz
#
# $ ./java --version
# openjdk 11.0.6 2020-01-14
# OpenJDK Runtime Environment (build 11.0.6+${JDK_BUILD_NUMBER}-b${build_number})
# OpenJDK 64-Bit Server VM (build 11.0.6+${JDK_BUILD_NUMBER}-b${build_number}, mixed mode)
#
# Environment variables:
# MODULAR_SDK_PATH - specifies the path to the directory where imported modules are located.
# By default imported modules should be located in ./modular-sdk
# JCEF_PATH - specifies the path to the directory where JCEF binaries are located.
# By default imported modules should be located in ./jcef_win_x64
JBSDK_VERSION=$1
JDK_BUILD_NUMBER=$2
build_number=$3
JBSDK_VERSION_WITH_DOTS=$(echo $JBSDK_VERSION | sed 's/_/\./g')
WITH_IMPORT_MODULES="--with-import-modules=${MODULAR_SDK_PATH:=${WORK_DIR}/modular-sdk}"
JCEF_PATH=${JCEF_PATH:=./jcef_win_x64}
source jb/project/tools/common.sh
JBRSDK_BASE_NAME=jbrsdk-${JBSDK_VERSION}
WORK_DIR=$(pwd)
WITH_DEBUG_LEVEL="--with-debug-level=fastdebug"
RELEASE_NAME=windows-x86_64-normal-server-fastdebug
PATH="/usr/local/bin:/usr/bin:${PATH}"
./configure \
--disable-warnings-as-errors \
$WITH_DEBUG_LEVEL \
--with-target-bits=64 \
--with-vendor-name="${VENDOR_NAME}" \
--with-vendor-version-string="${VENDOR_VERSION_STRING}" \
--with-version-pre= \
--with-version-build=${JDK_BUILD_NUMBER} \
--with-version-opt=b${build_number} \
$WITH_IMPORT_MODULES \
--with-toolchain-version=2015 \
--with-boot-jdk=${BOOT_JDK} \
--disable-ccache \
--enable-cds=yes || exit 1
make LOG=info clean images CONF=$RELEASE_NAME || exit 1
JSDK=build/$RELEASE_NAME/images/jdk
JBSDK=${JBRSDK_BASE_NAME}-windows-x64-b${build_number}
BASE_DIR=build/$RELEASE_NAME/images
JBRSDK_BUNDLE=jbrsdk
rm -rf ${BASE_DIR}/${JBRSDK_BUNDLE} && rsync -a --exclude demo --exclude sample ${JSDK}/ ${JBRSDK_BUNDLE} || exit 1
cp -R ${JCEF_PATH}/* ${JBRSDK_BUNDLE}/bin
sed 's/JBR/JBRSDK/g' ${JSDK}/release > release
mv release ${JBRSDK_BUNDLE}/release
JBR_BUNDLE=jbr
JBR_BASE_NAME=jbr-$JBSDK_VERSION
rm -rf ${JBR_BUNDLE}
${JSDK}/bin/jlink \
--module-path ${JSDK}/jmods --no-man-pages --compress=2 \
--add-modules $(xargs < modules.list | sed s/" "//g) --output ${JBR_BUNDLE} || exit $?
cp -R ${JCEF_PATH}/* ${JBR_BUNDLE}/bin
echo Modifying release info ...
cat ${JSDK}/release | tr -d '\r' | grep -v 'JAVA_VERSION' | grep -v 'MODULES' >> ${JBR_BUNDLE}/release

View File

@@ -1,12 +1,16 @@
#!/bin/bash -x
# The following parameters must be specified:
# JBSDK_VERSION - specifies the current version of OpenJDK e.g. 11_0_6
# JDK_BUILD_NUMBER - specifies the number of OpenJDK build or the value of --with-version-build argument to configure
# JBSDK_VERSION - specifies major version of OpenJDK e.g. 11_0_6 (instead of dots '.' underbars "_" are used)
# JDK_BUILD_NUMBER - specifies update release of OpenJDK build or the value of --with-version-build argument to configure
# build_number - specifies the number of JetBrainsRuntime build
# bundle_type - specifies bundle to bu built; possible values:
# jcef - the bundles 1) jbr with jcef+javafx, 2) jbrsdk and 3) test will be created
# jfx - the bundle 1) jbr with javafx only will be created
# bundle_type - specifies bundle to be built; possible values:
# jcef - the release bundles with jcef
# jfx - the release bundles with javafx
# jcef_jfx - the release bundles with jcef and javafx
# dcevm - the release bundles with dcevm patches
# nomod - the release bundles without any additional modules (jcef)
# fd - the fastdebug bundles which also include the jcef module
#
# jbrsdk-${JBSDK_VERSION}-osx-x64-b${build_number}.tar.gz
# jbr-${JBSDK_VERSION}-osx-x64-b${build_number}.tar.gz
@@ -16,59 +20,68 @@
# OpenJDK Runtime Environment (build 11.0.6+${JDK_BUILD_NUMBER}-b${build_number})
# OpenJDK 64-Bit Server VM (build 11.0.6+${JDK_BUILD_NUMBER}-b${build_number}, mixed mode)
#
# Environment variables:
# MODULAR_SDK_PATH - specifies the path to the directory where imported modules are located.
# By default imported modules should be located in ./modular-sdk
# JCEF_PATH - specifies the path to the directory with JCEF binaries.
# By default JCEF binaries should be located in ./jcef_win_x64
JBSDK_VERSION=$1
JDK_BUILD_NUMBER=$2
build_number=$3
bundle_type=$4
source jb/project/tools/common.sh
function pack_jbr {
case "$1" in
"${bundle_type}_lw")
JBR_BASE_NAME=jbr_${bundle_type}_lw-${JBSDK_VERSION}
;;
"jfx" | "jcef" | "dcevm" | "nomod")
JBR_BUNDLE=jbr_${bundle_type}
case "${bundle_type}" in
"jfx" | "jcef" | "dcevm" | "nomod" | "fd")
JBR_BASE_NAME=jbr_${bundle_type}-${JBSDK_VERSION}
;;
"jfx_jcef")
JBR_BASE_NAME=jbr-${JBSDK_VERSION}
;;
*)
echo "***ERR*** bundle was not specified" && exit 1
echo "***ERR*** bundle was not specified" && do_exit 1
;;
esac
JBR=$JBR_BASE_NAME-windows-x64-b$build_number
echo Creating $JBR.tar.gz ...
rm -rf ${BASE_DIR}/jbr
cp -R ${BASE_DIR}/${JBR_BUNDLE} ${BASE_DIR}/jbr
/usr/bin/tar -czf $JBR.tar.gz -C $BASE_DIR jbr || exit 1
#rm -rf ${BASE_DIR}/${JBR_BUNDLE}
/usr/bin/tar -czf $JBR.tar.gz -C $BASE_DIR jbr || do_exit $?
}
JBRSDK_BASE_NAME=jbrsdk-${JBSDK_VERSION}
WITH_DEBUG_LEVEL="--with-debug-level=release"
RELEASE_NAME=windows-x86_64-normal-server-release
JBRSDK_BASE_NAME=jbrsdk-$JBSDK_VERSION
JBR_BASE_NAME=jbr-$JBSDK_VERSION
JBSDK=${JBRSDK_BASE_NAME}-windows-x64-b${build_number}
case "$bundle_type" in
"fd")
WITH_DEBUG_LEVEL="--with-debug-level=fastdebug"
RELEASE_NAME=windows-x86_64-normal-server-fastdebug
JBSDK=${JBRSDK_BASE_NAME}-windows-x64-fastdebug-b${build_number}
;;
esac
IMAGES_DIR=build/$RELEASE_NAME/images
JSDK=$IMAGES_DIR/jdk
JBSDK=$JBRSDK_BASE_NAME-windows-x64-b$build_number
BASE_DIR=.
if [ "$bundle_type" == "jfx_jcef" ]; then
if [ "${bundle_type}" == "jcef" ] || [ "${bundle_type}" == "fd" ]; then
JBRSDK_BUNDLE=jbrsdk
echo Creating $JBSDK.tar.gz ...
/usr/bin/tar -czf $JBSDK.tar.gz $JBRSDK_BUNDLE || exit 1
[ -f "$JBSDK.tar.gz" ] && rm "$JBSDK.tar.gz"
/usr/bin/tar -czf $JBSDK.tar.gz $JBRSDK_BUNDLE || do_exit $?
fi
JBR_BUNDLE=jbr_${bundle_type}
pack_jbr $bundle_type
if [ "$bundle_type" == "jfx_jcef" ]; then
if [ "$bundle_type" == "jcef" ]; then
JBRSDK_TEST=$JBRSDK_BASE_NAME-windows-test-x64-b$build_number
echo Creating $JBRSDK_TEST.tar.gz ...
/usr/bin/tar -czf $JBRSDK_TEST.tar.gz -C $IMAGES_DIR --exclude='test/jdk/demos' test || exit 1
/usr/bin/tar -czf $JBRSDK_TEST.tar.gz -C $IMAGES_DIR --exclude='test/jdk/demos' test || do_exit $?
fi

View File

@@ -1,44 +0,0 @@
#!/bin/bash -x
# The following parameters must be specified:
# JBSDK_VERSION - specifies the current version of OpenJDK e.g. 11_0_6
# JDK_BUILD_NUMBER - specifies the number of OpenJDK build or the value of --with-version-build argument to configure
# build_number - specifies the number of JetBrainsRuntime build
# bundle_type - specifies bundle to bu built; possible values:
# jcef - the bundles 1) jbr with jcef+javafx, 2) jbrsdk and 3) test will be created
# jfx - the bundle 1) jbr with javafx only will be created
#
# jbrsdk-${JBSDK_VERSION}-osx-x64-b${build_number}.tar.gz
# jbr-${JBSDK_VERSION}-osx-x64-b${build_number}.tar.gz
#
# $ ./java --version
# openjdk 11.0.6 2020-01-14
# OpenJDK Runtime Environment (build 11.0.6+${JDK_BUILD_NUMBER}-b${build_number})
# OpenJDK 64-Bit Server VM (build 11.0.6+${JDK_BUILD_NUMBER}-b${build_number}, mixed mode)
#
JBSDK_VERSION=$1
JDK_BUILD_NUMBER=$2
build_number=$3
RELEASE_NAME=windows-x86_64-normal-server-fastdebug
JBRSDK_BASE_NAME=jbrsdk-$JBSDK_VERSION
JBR_BASE_NAME=jbr-$JBSDK_VERSION
IMAGES_DIR=build/$RELEASE_NAME/images
JSDK=$IMAGES_DIR/jdk
JBSDK=$JBRSDK_BASE_NAME-windows-x64-fastdebug-b$build_number
BASE_DIR=.
JBRSDK_BUNDLE=jbrsdk
echo Creating $JBSDK.tar.gz ...
/usr/bin/tar -czf $JBSDK.tar.gz $JBRSDK_BUNDLE || exit 1
JBR_BUNDLE=jbr
JBR_BASE_NAME=jbr-${JBSDK_VERSION}
JBR=$JBR_BASE_NAME-windows-x64-fastdebug-b$build_number
echo Creating $JBR.tar.gz ...
cp -R ${BASE_DIR}/${JBR_BUNDLE} ${BASE_DIR}/jbr
/usr/bin/tar -czf $JBR.tar.gz -C $BASE_DIR jbr || exit 1

View File

@@ -20,13 +20,6 @@ java.sql.rowset,
java.transaction.xa,
java.xml,
java.xml.crypto,
javafx.base,
javafx.controls,
javafx.fxml,
javafx.graphics,
javafx.media,
javafx.swing,
javafx.web,
jdk.accessibility,
jdk.aot,
jdk.attach,
@@ -61,5 +54,4 @@ jdk.security.jgss,
jdk.unsupported,
jdk.xml.dom,
jdk.zipfs,
jdk.hotspot.agent,
jcef
jdk.hotspot.agent

View File

@@ -4568,17 +4568,6 @@ void Threads::deoptimized_wrt_marked_nmethods() {
p->deoptimized_wrt_marked_nmethods();
}
}
jlong Threads::compile_total_time_ms() {
jlong accumulator = 0;
MutexLocker mu(Threads_lock);
for (JavaThread* i = _thread_list; i != NULL; i = i->next()) {
if (i->is_Compiler_thread()) {
jlong time = os::thread_cpu_time((Thread *) i, true) / 1000 / 1000;
accumulator += time;
}
}
return accumulator;
}
// Get count Java threads that are waiting to enter the specified monitor.

View File

@@ -2250,8 +2250,6 @@ class Threads: AllStatic {
// Deoptimizes all frames tied to marked nmethods
static void deoptimized_wrt_marked_nmethods();
static jlong compile_total_time_ms();
};

View File

@@ -892,7 +892,7 @@ static jlong get_long_attribute(jmmLongAttribute att) {
return Management::ticks_to_ms(os::elapsed_counter());
case JMM_COMPILE_TOTAL_TIME_MS:
return Threads::compile_total_time_ms();
return Management::ticks_to_ms(CompileBroker::total_compilation_ticks());
case JMM_OS_PROCESS_ID:
return os::current_process_id();

View File

@@ -89,7 +89,11 @@ final class CClipboard extends SunClipboard {
try {
byte[] bytes = DataTransferer.getInstance().translateTransferable(contents, flavor, format);
setData(bytes, format);
if (DataFlavor.javaFileListFlavor.equals(flavor)) {
writeObjects(bytes);
} else {
setData(bytes, format);
}
} catch (IOException e) {
// Fix 4696186: don't print exception if data with
// javaJVMLocalObjectMimeType failed to serialize.
@@ -127,6 +131,7 @@ final class CClipboard extends SunClipboard {
private native void declareTypes(long[] formats, SunClipboard newOwner);
private native void setData(byte[] data, long format);
private native void writeObjects(byte[] data);
void checkPasteboardAndNotify() {
if (checkPasteboardWithoutNotification()) {

View File

@@ -297,18 +297,6 @@ public class CInputMethod extends InputMethodAdapter {
if (component.getInputMethodRequests() == null) {
imInstance = null;
}
LWWindowPeer windowPeer = peer.getPlatformWindow().getPeer();
if (windowPeer.isSimpleWindow()) {
// A simple window gains focus. Cocoa won't dispatch IME events into the simple window, but into its owner.
// This IM represents the focused component in the simple window. We will use the owner as IME proxy.
// For that, this IM is set for the owner and is dropped for the simple window.
Window owner = windowPeer.getTarget().getOwner();
assert owner != null && owner.isActive();
long ownerPtr = getNativeViewPtr((LWComponentPeer)AWTAccessor.getComponentAccessor().getPeer(owner));
nativeNotifyPeer(ownerPtr, this);
imInstance = null;
}
}
if (peer != null) {

View File

@@ -174,6 +174,48 @@ JNF_COCOA_ENTER(env);
JNF_COCOA_EXIT(env);
}
/*
* Class: sun_lwawt_macosx_CClipboard
* Method: writeObjects
* Signature: ([BJ)V
*/
JNIEXPORT void JNICALL Java_sun_lwawt_macosx_CClipboard_writeObjects
(JNIEnv *env, jobject inObject, jbyteArray inBytes, jlong inFormat)
{
if (inBytes == NULL) {
return;
}
JNF_COCOA_ENTER(env);
jint nBytes = (*env)->GetArrayLength(env, inBytes);
jbyte *rawBytes = (*env)->GetPrimitiveArrayCritical(env, inBytes, NULL);
CHECK_NULL(rawBytes);
NSData *bytesAsData = [NSData dataWithBytes:rawBytes length:nBytes];
(*env)->ReleasePrimitiveArrayCritical(env, inBytes, rawBytes, JNI_ABORT);
NSString *format = formatForIndex(inFormat);
NSMutableArray *formatArray = [NSMutableArray arrayWithCapacity:2];
const char *bytes = [bytesAsData bytes];
BOOL isStart=YES;
for (int i = 0; i < [bytesAsData length]; i++) {
if ((unsigned char)bytes[i] == 0) {
isStart = YES;
} else {
if (isStart) {
isStart = NO;
NSString *path = [NSString stringWithUTF8String:(const char *)&bytes[i]];
NSURL *fileURL = [NSURL fileURLWithPath:path relativeToURL:nil];
[formatArray addObject:fileURL];
}
}
}
[ThreadUtilities performOnMainThreadWaiting:YES block:^() {
[[NSPasteboard generalPasteboard] writeObjects:formatArray];
}];
JNF_COCOA_EXIT(env);
}
/*
* Class: sun_lwawt_macosx_CClipboard
* Method: getClipboardFormats

View File

@@ -95,8 +95,6 @@ import sun.awt.AppContext;
import sun.awt.ComponentFactory;
import sun.security.action.GetBooleanAction;
import sun.security.action.GetPropertyAction;
import sun.awt.AppContext;
import sun.awt.AWTAccessor;
import sun.awt.ConstrainableGraphics;
import sun.awt.EmbeddedFrame;
import sun.awt.RequestFocusController;
@@ -112,7 +110,6 @@ import sun.java2d.SunGraphics2D;
import sun.java2d.SunGraphicsEnvironment;
import sun.java2d.pipe.Region;
import sun.java2d.pipe.hw.ExtendedBufferCapabilities;
import sun.security.action.GetPropertyAction;
import sun.swing.SwingAccessor;
import sun.util.logging.PlatformLogger;
@@ -226,6 +223,7 @@ public abstract class Component implements ImageObserver, MenuContainer,
private static final PlatformLogger eventLog = PlatformLogger.getLogger("java.awt.event.Component");
private static final PlatformLogger focusLog = PlatformLogger.getLogger("java.awt.focus.Component");
private static final PlatformLogger mixingLog = PlatformLogger.getLogger("java.awt.mixing.Component");
private static final PlatformLogger focusRequestLog = PlatformLogger.getLogger("jb.focus.requests");
/**
* The peer of the component. The peer implements the component's
@@ -7958,6 +7956,12 @@ public abstract class Component implements ImageObserver, MenuContainer,
boolean focusedWindowChangeAllowed,
FocusEvent.Cause cause)
{
if (focusRequestLog.isLoggable(PlatformLogger.Level.FINE)) {
focusRequestLog.fine("requestFocus("
+ (temporary ? "temporary," : "")
+ (focusedWindowChangeAllowed ? "" : "inWindow,")
+ cause + ") for " + this, new Throwable());
}
// 1) Check if the event being dispatched is a system-generated mouse event.
AWTEvent currentEvent = EventQueue.getCurrentEvent();
if (currentEvent instanceof MouseEvent &&

View File

@@ -382,6 +382,7 @@ public class Window extends Container implements Accessible {
private static final long serialVersionUID = 4497834738069338734L;
private static final PlatformLogger log = PlatformLogger.getLogger("java.awt.Window");
private static final PlatformLogger focusRequestLog = PlatformLogger.getLogger("jb.focus.requests");
private static final boolean locationByPlatformProp;
@@ -1308,6 +1309,9 @@ public class Window extends Container implements Accessible {
// This functionality is implemented in a final package-private method
// to insure that it cannot be overridden by client subclasses.
final void toFront_NoClientCode() {
if (focusRequestLog.isLoggable(PlatformLogger.Level.FINE)) {
focusRequestLog.fine("toFront() for" + this, new Throwable());
}
if (visible) {
WindowPeer peer = (WindowPeer)this.peer;
if (peer != null) {
@@ -1351,6 +1355,9 @@ public class Window extends Container implements Accessible {
// This functionality is implemented in a final package-private method
// to insure that it cannot be overridden by client subclasses.
final void toBack_NoClientCode() {
if (focusRequestLog.isLoggable(PlatformLogger.Level.FINE)) {
focusRequestLog.fine("toBack() for " + this, new Throwable());
}
if(isAlwaysOnTop()) {
try {
setAlwaysOnTop(false);

View File

@@ -109,10 +109,7 @@ module java.desktop {
// see make/GensrcModuleInfo.gmk
exports sun.awt to
jdk.accessibility,
jdk.unsupported.desktop,
jcef;
exports java.awt.peer to jcef;
jdk.unsupported.desktop;
exports java.awt.dnd.peer to jdk.unsupported.desktop;
exports sun.awt.dnd to jdk.unsupported.desktop;

View File

@@ -20,6 +20,11 @@ public class KeyEventProcessing {
public final static boolean useLatinNonAlphaNumKeycodes = "true".equals(
getProperty(useLatinNonAlphaNumKeycodesOption, "false"));
public final static String defaultTouchHandlingOption = "com.jetbrains.default.touchscreen.mode";
@Native
public final static boolean defaultTouchHandling = "true".equalsIgnoreCase(getProperty(defaultTouchHandlingOption, "false"));
private static String getProperty(String option, String dflt) {
return java.security.AccessController.doPrivileged(
(PrivilegedAction<String>) () -> System.getProperty(option, dflt)

View File

@@ -1726,7 +1726,7 @@ static jlong
if (ftglyph->bitmap.pixel_mode == FT_PIXEL_MODE_LCD && width > 0) {
glyphInfo->width = width/3;
glyphInfo->topLeftX -= 1;
glyphInfo->width += 1;
glyphInfo->width += 2;
} else if (ftglyph->bitmap.pixel_mode == FT_PIXEL_MODE_LCD_V) {
glyphInfo->height = glyphInfo->height/3;
}

View File

@@ -79,7 +79,6 @@ public class XBaseWindow {
private static XAtom wm_client_leader;
private long userTime;
private static long globalUserTime;
static enum InitialiseState {
@@ -669,7 +668,7 @@ public class XBaseWindow {
try {
this.visible = visible;
if (visible) {
setUserTimeFromGlobal();
setUserTimeBeforeShowing();
XlibWrapper.XMapWindow(XToolkit.getDisplay(), getWindow());
}
else {
@@ -1029,7 +1028,7 @@ public class XBaseWindow {
public void handleVisibilityEvent(XEvent xev) {
}
public void handleKeyPress(XEvent xev) {
setUserTime(xev.get_xkey().get_time());
setUserTime(xev.get_xkey().get_time(), true);
}
public void handleKeyRelease(XEvent xev) {
}
@@ -1060,7 +1059,7 @@ public class XBaseWindow {
if (!isWheel) {
switch (xev.get_type()) {
case XConstants.ButtonPress:
setUserTime(xbe.get_time());
setUserTime(xbe.get_time(), true);
if (buttonState == 0) {
XWindowPeer parent = getToplevelXWindow();
// See 6385277, 6981400.
@@ -1299,15 +1298,12 @@ public class XBaseWindow {
return x >= getAbsoluteX() && y >= getAbsoluteY() && x < (getAbsoluteX()+getWidth()) && y < (getAbsoluteY()+getHeight());
}
void setUserTimeFromGlobal() {
setUserTime(globalUserTime);
void setUserTimeBeforeShowing() {
if (globalUserTime != 0) setUserTime(globalUserTime, false);
}
protected void setUserTime(long time) {
if (time == userTime) return;
userTime = time;
if ((int)time - (int)globalUserTime > 0 /* accounting for wrap-around */) {
protected void setUserTime(long time, boolean updateGlobalTime) {
if (updateGlobalTime && (int)time - (int)globalUserTime > 0 /* accounting for wrap-around */) {
globalUserTime = time;
}
XNETProtocol netProtocol = XWM.getWM().getNETProtocol();

View File

@@ -1080,7 +1080,7 @@ abstract class XDecoratedPeer extends XWindowPeer {
}
// we should treat WM_TAKE_FOCUS message as user interaction, as it can originate e.g. from user clicking
// on window title bar (there will be no ButtonPress/ButtonRelease events in this case)
setUserTime(requestTimeStamp);
setUserTime(requestTimeStamp, true);
if (XWM.getWMID() == XWM.UNITY_COMPIZ_WM) {
// JDK-8159460

View File

@@ -110,7 +110,8 @@ final class XWM
MUTTER_WM = 15,
UNITY_COMPIZ_WM = 16,
XMONAD_WM = 17,
AWESOME_WM = 18;
AWESOME_WM = 18,
I3_WM = 19;
public String toString() {
switch (WMID) {
@@ -621,6 +622,10 @@ final class XWM
return isNetWMName("awesome");
}
static boolean isI3() {
return isNetWMName("i3");
}
static int awtWMNonReparenting = -1;
static boolean isNonReparentingWM() {
if (awtWMNonReparenting == -1) {
@@ -824,6 +829,8 @@ final class XWM
awt_wmgr = XWM.XMONAD_WM;
} else if (isAwesome()) {
awt_wmgr = XWM.AWESOME_WM;
} else if (isI3()) {
awt_wmgr = XWM.I3_WM;
}
/*
* We don't check for legacy WM when we already know that WM

View File

@@ -28,7 +28,6 @@ package sun.awt.X11;
import java.awt.*;
import java.awt.event.ComponentEvent;
import java.awt.event.FocusEvent;
import java.awt.event.InvocationEvent;
import java.awt.event.WindowEvent;
import java.awt.peer.ComponentPeer;
import java.awt.peer.WindowPeer;
@@ -36,13 +35,7 @@ import java.io.UnsupportedEncodingException;
import java.security.AccessController;
import java.security.PrivilegedAction;
import java.util.*;
import java.util.List;
import java.util.concurrent.atomic.AtomicBoolean;
import java.util.concurrent.locks.Condition;
import java.util.concurrent.locks.Lock;
import java.util.concurrent.locks.ReentrantLock;
import java.util.function.BooleanSupplier;
import java.util.function.Consumer;
import sun.awt.AWTAccessor;
import sun.awt.AWTAccessor.ComponentAccessor;
@@ -150,10 +143,7 @@ class XWindowPeer extends XPanelPeer implements WindowPeer,
private static final int MAXIMUM_BUFFER_LENGTH_NET_WM_ICON = (2<<15) - 1;
static {
/* https://userbase.kde.org/KDE_System_Administration/Environment_Variables#KDE_FULL_SESSION */
final String kdeSession = AccessController.doPrivileged((PrivilegedAction<String>) () -> System.getenv("KDE_FULL_SESSION"));
final boolean isKDE = kdeSession != null && !kdeSession.isEmpty();
final boolean isKDE = XWM.getWMID() == XWM.KDE2_WM;
X11_DISABLE_OVERRIDE_FLAG =
GetPropertyAction.privilegedGetProperty("x11.disable.override.flag", isKDE ? "true" : "false").equalsIgnoreCase("true");
X11_DISABLE_OVERRIDE_XWINDOWPEER =
@@ -1112,7 +1102,7 @@ class XWindowPeer extends XPanelPeer implements WindowPeer,
if (!isVisible() && vis) {
isBeforeFirstMapNotify = true;
winAttr.initialFocus = isAutoRequestFocus();
if (!winAttr.initialFocus) {
if (!winAttr.initialFocus && XWM.getWMID() != XWM.I3_WM) {
/*
* It's easier and safer to temporary suppress WM_TAKE_FOCUS
* protocol itself than to ignore WM_TAKE_FOCUS client message.
@@ -1120,6 +1110,13 @@ class XWindowPeer extends XPanelPeer implements WindowPeer,
* the message come after showing and the message come after
* activation. Also, on Metacity, for some reason, we have _two_
* WM_TAKE_FOCUS client messages when showing a frame/dialog.
*
* i3 window manager doesn't track updates to WM_TAKE_FOCUS
* property, so this approach won't work for it, breaking
* focus behaviour completely. So another way is used to
* suppress focus take over - via setting _NET_WM_USER_TIME
* to 0, as specified in EWMH spec (see
* 'setUserTimeBeforeShowing' method).
*/
suppressWmTakeFocus(true);
}
@@ -1184,6 +1181,16 @@ class XWindowPeer extends XPanelPeer implements WindowPeer,
protected void suppressWmTakeFocus(boolean doSuppress) {
}
@Override
void setUserTimeBeforeShowing() {
if (winAttr.initialFocus || XWM.getWMID() != XWM.I3_WM) {
super.setUserTimeBeforeShowing();
}
else {
setUserTime(0, false);
}
}
final boolean isSimpleWindow() {
return !(target instanceof Frame || target instanceof Dialog);
}
@@ -1425,7 +1432,7 @@ class XWindowPeer extends XPanelPeer implements WindowPeer,
isUnhiding |= isWMStateNetHidden();
super.handleMapNotifyEvent(xev);
if (!winAttr.initialFocus) {
if (!winAttr.initialFocus && XWM.getWMID() != XWM.I3_WM) {
suppressWmTakeFocus(false); // restore the protocol.
/*
* For some reason, on Metacity, a frame/dialog being shown
@@ -2053,7 +2060,7 @@ class XWindowPeer extends XPanelPeer implements WindowPeer,
this.visible = visible;
if (visible) {
applyWindowType();
setUserTimeFromGlobal();
setUserTimeBeforeShowing();
XlibWrapper.XMapRaised(XToolkit.getDisplay(), getWindow());
} else {
XlibWrapper.XUnmapWindow(XToolkit.getDisplay(), getWindow());

View File

@@ -1400,6 +1400,17 @@ static BOOL IsMouseEventFromTouch()
{
return (::GetMessageExtraInfo() & MOUSEEVENTF_FROMTOUCH_MASK) == MOUSEEVENTF_FROMTOUCH;
}
static BOOL IsDefaultTouch()
{
JNIEnv *env = (JNIEnv *)JNU_GetEnv(jvm, JNI_VERSION_1_2);
jclass cls = env->FindClass("sun/awt/event/KeyEventProcessing");
CHECK_NULL_RETURN(cls, FALSE);
jfieldID fieldID = env->GetStaticFieldID(cls, "defaultTouchHandling", "Z");
CHECK_NULL_RETURN(fieldID, FALSE);
return static_cast<BOOL>(env->GetStaticBooleanField(cls, fieldID));
}
/*
* Dispatch messages for this window class--general component
*/
@@ -1427,6 +1438,8 @@ LRESULT AwtComponent::WindowProc(UINT message, WPARAM wParam, LPARAM lParam)
DWORD curPos = 0;
static const BOOL PROCESS_TOUCH_EVENTS = !IsDefaultTouch();
UINT switchMessage = message;
switch (switchMessage) {
case WM_AWT_GETDC:
@@ -1716,7 +1729,7 @@ LRESULT AwtComponent::WindowProc(UINT message, WPARAM wParam, LPARAM lParam)
case WM_MOUSEHWHEEL:
case WM_AWT_MOUSEENTER:
case WM_AWT_MOUSEEXIT:
if (IsMouseEventFromTouch()) {
if (IsMouseEventFromTouch() && PROCESS_TOUCH_EVENTS) {
break;
}
curPos = ::GetMessagePos();
@@ -1796,8 +1809,10 @@ LRESULT AwtComponent::WindowProc(UINT message, WPARAM wParam, LPARAM lParam)
}
break;
case WM_TOUCH:
WmTouch(wParam, lParam);
break;
if (PROCESS_TOUCH_EVENTS) {
WmTouch(wParam, lParam);
break;
}
case WM_SETCURSOR:
mr = mrDoDefault;
if (LOWORD(lParam) == HTCLIENT) {

View File

@@ -0,0 +1,94 @@
// Copyright 2000-2020 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file.
import java.util.concurrent.TimeUnit;
import java.util.concurrent.CountDownLatch;
import java.awt.Color;
import java.awt.GridBagConstraints;
import java.awt.GridBagLayout;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.awt.event.WindowAdapter;
import java.awt.event.WindowEvent;
import javax.swing.*;
import javax.swing.JPanel;
public abstract class AccessibleComponentTest {
protected static volatile boolean testResult = true;
protected static volatile CountDownLatch countDownLatch;
protected static String INSTRUCTIONS;
protected static String exceptionString;
protected JFrame mainFrame;
protected static AccessibleComponentTest a11yTest;
public abstract CountDownLatch createCountDownLatch();
public void createUI(JPanel component, String testName) {
mainFrame = new JFrame(testName);
GridBagLayout layout = new GridBagLayout();
JPanel mainControlPanel = new JPanel(layout);
JPanel resultButtonPanel = new JPanel(layout);
GridBagConstraints gbc = new GridBagConstraints();
JTextArea instructionTextArea = new JTextArea();
instructionTextArea.setText(INSTRUCTIONS);
instructionTextArea.setEditable(false);
instructionTextArea.setBackground(Color.white);
gbc.gridx = 0;
gbc.gridy = 0;
gbc.fill = GridBagConstraints.HORIZONTAL;
mainControlPanel.add(instructionTextArea, gbc);
gbc.gridx = 0;
gbc.gridy = 1;
mainControlPanel.add(component);
JButton passButton = new JButton("Pass");
passButton.setActionCommand("Pass");
passButton.addActionListener(new ActionListener() {
@Override
public void actionPerformed(ActionEvent e) {
mainFrame.dispose();
countDownLatch.countDown();
}
});
JButton failButton = new JButton("Fail");
failButton.setActionCommand("Fail");
failButton.addActionListener(new ActionListener() {
@Override
public void actionPerformed(ActionEvent e) {
testResult = false;
mainFrame.dispose();
countDownLatch.countDown();
}
});
gbc.gridx = 0;
gbc.gridy = 0;
resultButtonPanel.add(passButton, gbc);
gbc.gridx = 1;
gbc.gridy = 0;
resultButtonPanel.add(failButton, gbc);
gbc.gridx = 0;
gbc.gridy = 2;
mainControlPanel.add(resultButtonPanel, gbc);
mainFrame.add(mainControlPanel);
mainFrame.pack();
mainFrame.addWindowListener(new WindowAdapter() {
@Override
public void windowClosing(WindowEvent e) {
mainFrame.dispose();
countDownLatch.countDown();
}
});
mainFrame.setVisible(true);
}
}

View File

@@ -0,0 +1,142 @@
// Copyright 2000-2020 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file.
/*
* @test
* @summary manual test for JBR-2504
* @author Artem.Semenov@jetbrains.com
* @run main/manual AccessibleJListTest
*/
import javax.swing.*;
import java.awt.*;
import java.awt.event.ActionListener;
import java.util.concurrent.CountDownLatch;
import java.util.concurrent.TimeUnit;
import java.awt.*;
import java.awt.event.ActionEvent;
import java.awt.event.KeyAdapter;
import java.awt.event.KeyEvent;
public class AccessibleJListTest extends AccessibleComponentTest {
private static final String[] NAMES = {"One", "Two", "Three", "Four", "Five"};
static JWindow window;
public static void main(String[] args) throws Exception {
a11yTest = new AccessibleJListTest();
countDownLatch = a11yTest.createCountDownLatch();
SwingUtilities.invokeLater(((AccessibleJListTest) a11yTest)::createSimpleList);
countDownLatch.await();
if (!testResult) {
throw new RuntimeException(a11yTest.exceptionString);
}
countDownLatch = a11yTest.createCountDownLatch();
SwingUtilities.invokeLater(((AccessibleJListTest) a11yTest)::createCombobox);
countDownLatch.await();
if (!testResult) {
throw new RuntimeException(a11yTest.exceptionString);
}
countDownLatch = a11yTest.createCountDownLatch();
SwingUtilities.invokeLater(((AccessibleJListTest) a11yTest)::createPushButton);
countDownLatch.await();
if (!testResult) {
throw new RuntimeException(a11yTest.exceptionString);
}
}
@java.lang.Override
public CountDownLatch createCountDownLatch() {
return new CountDownLatch(1);
}
public void createSimpleList() {
INSTRUCTIONS = "INSTRUCTIONS:\n"
+ "Check a11y of JList in a simple Window.\n\n"
+ "Turn screen reader on, and Tab to the list.\n"
+ "Press the up and down arrow buttons to move through the list.\n\n"
+ "If you can hear menu items tab further and press PASS, otherwise press FAIL.\n";
JPanel frame = new JPanel();
JList<String> list = new JList<>(NAMES);
frame.setLayout(new FlowLayout());
frame.add(list);
exceptionString = "Accessible JList simple list test failed!";
super.createUI(frame, "Accessible JList test");
}
public void createCombobox() {
INSTRUCTIONS = "INSTRUCTIONS:\n"
+ "Check a11y of JList in a combobox.\n\n"
+ "Turn screen reader on, and Tab to the combobox.\n"
+ "Press the up and down arrow buttons to move through the list.\n\n"
+ "If you can hear combobox items tab further and press PASS, otherwise press FAIL.\n";
JPanel frame = new JPanel();
JComboBox<String> combo = new JComboBox<>(NAMES);
frame.setLayout(new FlowLayout());
frame.add(combo);
exceptionString = "Accessible JList combobox test failed!";
super.createUI(frame, "Accessible JList test");
}
public void createPushButton() {
INSTRUCTIONS = "INSTRUCTIONS:\n"
+ "Check a11y of JList in a popup.\n\n"
+ "Turn screen reader on, and Tab to the show button and press space.\n"
+ "Press the up and down arrow buttons to move through the list.\n\n"
+ "If you can hear popup menu items tab further and press PASS, otherwise press FAIL.\n";
JPanel frame = new JPanel();
JButton button = new JButton("show");
button.setPreferredSize(new Dimension(100, 35));
button.addActionListener(new ActionListener() {
final Runnable dispose = () -> {
window.dispose();
window = null;
button.setText("show");
};
@Override
public void actionPerformed(ActionEvent e) {
if (window == null) {
Rectangle bounds = frame.getBounds();
window = new JWindow(mainFrame);
JList<String> winList = new JList<>(NAMES);
winList.addKeyListener(new KeyAdapter() {
@Override
public void keyPressed(KeyEvent e) {
if (e.getKeyCode() == KeyEvent.VK_ESCAPE) {
dispose.run();
}
}
});
window.add(winList);
window.setLocation(bounds.x + bounds.width + 20, bounds.y);
window.pack();
window.setVisible(true);
button.setText("hide (ESC)");
} else {
dispose.run();
}
}
});
frame.setLayout(new FlowLayout());
frame.add(button);
exceptionString = "Accessible JList push button test failed!";
super.createUI(frame, "Accessible JList test");
}
}

View File

@@ -0,0 +1,57 @@
// Copyright 2000-2020 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file.
/*
* @test
* @summary manual test for JBR-2649
* @author Artem.Semenov@jetbrains.com
* @run main/manual AccessibleJTableTest
*/
import javax.swing.*;
import java.awt.*;
import java.util.concurrent.CountDownLatch;
import java.util.concurrent.TimeUnit;
public class AccessibleJTableTest extends AccessibleComponentTest {
@Override
public CountDownLatch createCountDownLatch() {
return new CountDownLatch(1);
}
public void createUI() {
INSTRUCTIONS = "INSTRUCTIONS:\n"
+ "Check a11y of JTable in a simple Window.\n\n"
+ "Turn screen reader on, and Tab to the table.\n"
+ "On Windows press the arrow buttons to move through the table.\n\n"
+ "On MacOS, use the up and down arrow buttons to move through rows, and VoiceOver fast navigation to move through columns.\n\n"
+ "If you can hear table cells tab further and press PASS, otherwise press FAIL.\n";
final String[] columnNames = {"One", "Two", "Three"};
String[][] data = {
{"One1", "Two1", "Three1"},
{"One2", "Two2", "Three2"},
{"One3", "Two3", "Three3"},
{"One4", "Two4", "Three4"},
{"One5", "Two5", "Three5"}
};
JTable table = new JTable(data, columnNames);
JPanel panel = new JPanel();
panel.setLayout(new FlowLayout());
JScrollPane scrollPane = new JScrollPane(table);
panel.add(scrollPane);
panel.setFocusable(false);
exceptionString = "AccessibleJTable test failed!";
super.createUI(panel, "AccessibleJTableTest");
}
public static void main(String[] args) throws Exception {
AccessibleJTableTest test = new AccessibleJTableTest();
countDownLatch = test.createCountDownLatch();
SwingUtilities.invokeAndWait(test::createUI);
countDownLatch.await(15, TimeUnit.MINUTES);
if (!testResult) {
throw new RuntimeException(exceptionString);
}
}
}

View File

@@ -0,0 +1,158 @@
// Copyright 2000-2020 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file.
import javax.swing.*;
import java.awt.*;
import java.awt.event.*;
import java.lang.reflect.InvocationTargetException;
/**
* @test
* @key headful
* @summary Regression test for JBR-2412. The test checks that mouse actions are handled on jcef browser after hide and show it.
* @run main/othervm MouseEventTest
*/
public class MouseEventTest {
private static Robot robot;
private static final int WIDTH = 400;
private static final int HEIGHT = 400;
private static CefBrowserFrame browserFrame = new CefBrowserFrame(WIDTH, HEIGHT);
public static void main(String[] args) throws InvocationTargetException, InterruptedException {
try {
robot = new Robot();
SwingUtilities.invokeAndWait(browserFrame::initUI);
robot.waitForIdle();
doMouseActions();
if (!browserFrame.isMouseActionPerformed()) {
throw new RuntimeException("Test FAILED. Some of mouse actions were not handled.");
}
browserFrame.resetMouseActionsPerformedFlag();
browserFrame.hideAndShowBrowser();
robot.delay(100);
doMouseActions();
if (!browserFrame.isMouseActionPerformed()) {
throw new RuntimeException("Test FAILED. Some of mouse actions were not handled.");
}
System.out.println("Test PASSED");
} catch (AWTException e) {
e.printStackTrace();
} finally {
browserFrame.getBrowser().dispose();
JBCefApp.getInstance().getCefApp().dispose();
SwingUtilities.invokeAndWait(browserFrame::dispose);
}
}
private static void doMouseActions() {
Point frameCenter = new Point(browserFrame.getLocationOnScreen().x + WIDTH /2,
browserFrame.getLocationOnScreen().y + HEIGHT /2);
robot.mouseMove(frameCenter.x, frameCenter.y);
robot.delay(100);
robot.mousePress(InputEvent.BUTTON1_DOWN_MASK);
robot.delay(100);
robot.mouseMove(frameCenter.x + 1, frameCenter.y);
robot.delay(100);
robot.mouseRelease(InputEvent.BUTTON1_DOWN_MASK);
robot.delay(100);
robot.mouseWheel(1);
robot.delay(100);
}
}
class CefBrowserFrame extends JFrame {
private final JBCefBrowser browser = new JBCefBrowser();
private final int width, height;
private volatile boolean mouseActionPerformed = false;
private MouseAdapter mouseAdapter = new MouseAdapter() {
@Override
public void mouseDragged(MouseEvent e) {
mouseActionPerformed = true;
System.out.println("mouseDragged");
}
@Override
public void mouseMoved(MouseEvent e) {
mouseActionPerformed = true;
System.out.println("mouseMoved");
}
@Override
public void mouseWheelMoved(MouseWheelEvent e) {
mouseActionPerformed = true;
System.out.println("mouseWheelMoved");
}
@Override
public void mouseClicked(MouseEvent e) {
mouseActionPerformed = true;
System.out.println("mouseClicked");
}
@Override
public void mousePressed(MouseEvent e) {
mouseActionPerformed = true;
System.out.println("mousePressed");
}
@Override
public void mouseReleased(MouseEvent e) {
mouseActionPerformed = true;
System.out.println("mouseReleased");
}
@Override
public void mouseEntered(MouseEvent e) {
mouseActionPerformed = true;
System.out.println("mouseEntered");
}
};
public CefBrowserFrame(int width, int height) {
this.width = width;
this.height = height;
}
public void initUI() {
browser.getComponent().addMouseMotionListener(mouseAdapter);
browser.getComponent().addMouseListener(mouseAdapter);
browser.getComponent().addMouseWheelListener(mouseAdapter);
getContentPane().add(browser.getCefBrowser().getUIComponent());
setSize(width, height);
setDefaultCloseOperation(WindowConstants.EXIT_ON_CLOSE);
addWindowListener(new WindowAdapter() {
@Override
public void windowClosed(WindowEvent e) {
browser.dispose();
}
});
setVisible(true);
}
public void hideAndShowBrowser() {
Container parent = browser.getComponent().getParent();
parent.remove(browser.getComponent());
SwingUtilities.invokeLater(() -> parent.add(browser.getComponent()));
}
public JBCefBrowser getBrowser() {
return browser;
}
public void resetMouseActionsPerformedFlag() {
mouseActionPerformed = false;
}
public boolean isMouseActionPerformed() {
return mouseActionPerformed;
}
}

View File

@@ -0,0 +1,90 @@
// Copyright 2000-2020 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file.
import javax.swing.*;
import java.awt.*;
import java.awt.event.MouseAdapter;
import java.awt.event.MouseWheelEvent;
import java.awt.event.WindowAdapter;
import java.awt.event.WindowEvent;
import java.lang.reflect.InvocationTargetException;
/**
* @test
* @key headful
* @summary Regression test for JBR-2639. The test checks that mouse wheel action is handled on jcef browser.
* @run main/othervm MouseWheelEventTest
*/
public class MouseWheelEventTest {
public static void main(String[] args) throws InvocationTargetException, InterruptedException {
final int width = 400;
final int height = 400;
CefBrowserFrame browserFrame = new CefBrowserFrame(width, height);
try {
Robot r = new Robot();
SwingUtilities.invokeAndWait(browserFrame::initUI);
r.waitForIdle();
r.mouseMove(browserFrame.getLocationOnScreen().x + width/2,
browserFrame.getLocationOnScreen().y + height/2);
r.delay(100);
r.mouseWheel(1);
r.delay(100);
if (browserFrame.isMouseWheelMoved()) {
System.out.println("Test PASSED");
} else {
throw new RuntimeException("Test FAILED. Mouse wheel action was not handled.");
}
} catch (AWTException e) {
e.printStackTrace();
} finally {
browserFrame.getBrowser().dispose();
JBCefApp.getInstance().getCefApp().dispose();
SwingUtilities.invokeAndWait(browserFrame::dispose);
}
}
}
class CefBrowserFrame extends JFrame {
private volatile boolean mouseWheelMoved = false;
private final JBCefBrowser browser = new JBCefBrowser();
private int width, height;
public CefBrowserFrame(int width, int height) {
this.width = width;
this.height = height;
}
public void initUI() {
browser.getComponent().addMouseWheelListener(new MouseAdapter() {
@Override
public void mouseWheelMoved(MouseWheelEvent e) {
mouseWheelMoved = true;
System.out.println("mouseWheelMoved");
}
});
getContentPane().add(browser.getCefBrowser().getUIComponent());
setSize(width, height);
setDefaultCloseOperation(WindowConstants.EXIT_ON_CLOSE);
addWindowListener(new WindowAdapter() {
@Override
public void windowClosed(WindowEvent e) {
browser.dispose();
}
});
setVisible(true);
}
public JBCefBrowser getBrowser() {
return browser;
}
public boolean isMouseWheelMoved() {
return mouseWheelMoved;
}
}

View File

@@ -213,6 +213,7 @@ java/awt/Frame/UnfocusableMaximizedFrameResizablity/UnfocusableMaximizedFrameRes
java/awt/Frame/WindowDragTest/WindowDragTest.java 8169470 generic-all
java/awt/FullScreen/8013581/bug8013581.java 8169471 macosx-all,windows-all,linux-all
java/awt/FullScreen/AltTabCrashTest/AltTabCrashTest.java 8047218 generic-all
java/awt/FullScreen/BufferStrategyExceptionTest/BufferStrategyExceptionTest.java 8246558 windows-all
java/awt/FullScreen/DisplayChangeVITest/DisplayChangeVITest.java 8169469,JBR-1897 windows-all,macosx-all,linux-all (linux: NPE commit testing)
java/awt/FullScreen/FullScreenInsets/FullScreenInsets.java 7019055 windows-all,linux-all,macosx-all
java/awt/FullScreen/NoResizeEventOnDMChangeTest/NoResizeEventOnDMChangeTest.java 8169468 windows-all,macosx-all
@@ -576,7 +577,7 @@ java/awt/TextField/SelectionInvisibleTest/SelectionInvisibleTest.java
java/awt/Toolkit/DesktopProperties/rfe4758438.java 8193547 linux-all
java/awt/Toolkit/LockingKeyStateTest/LockingKeyStateTest.java 8208514 windows-all
java/awt/Toolkit/RealSync/Test.java 6849383 generic-all
java/awt/Toolkit/ScreenInsetsTest/ScreenInsetsTest.java 6829250 windows-all,linux-all,macosx-all
java/awt/Toolkit/ScreenInsetsTest/ScreenInsetsTest.java 6829250,8253398 windows-all,linux-all,macosx-all
java/awt/Toolkit/ToolkitPropertyTest/ToolkitPropertyTest_Enable.java 6847163 generic-all
java/awt/TrayIcon/ActionCommand/ActionCommand.java 8197575,8150540 macosx-all,windows-all
java/awt/TrayIcon/ActionEventMask/ActionEventMask.java 8197575,8150540 macosx-all,windows-all
@@ -595,6 +596,7 @@ java/awt/TrayIcon/PopupMenuLeakTest/PopupMenuLeakTest.java
java/awt/Window/8159168/SetShapeTest.java 8208507 generic-all
java/awt/Window/BackgroundIsNotUpdated/BackgroundIsNotUpdated.java 8142536 generic-all
java/awt/Window/Grab/GrabTest.java 8196019 macosx-all,windows-all,linux-all
java/awt/Window/GetScreenLocation/GetScreenLocationTest.java 8225787 linux-all
java/awt/Window/MultiWindowApp/ChildAlwaysOnTopTest.java 8215132,8194941 macosx-all,windows-all,linux-all
java/awt/Window/MultiWindowApp/MultiWindowAppTest.java 8159904 macosx-all,windows-all,linux-all
java/awt/Window/OwnedWindowsLeak/OwnedWindowsLeak.java 8225116 windows-all
@@ -635,6 +637,7 @@ java/awt/dnd/NoFormatsCrashTest/NoFormatsCrashTest.html
java/awt/dnd/URIListBetweenJVMsTest/URIListBetweenJVMsTest.html 8171510,7124379 macosx-all,linux-all
java/awt/dnd/URIListToFileListBetweenJVMsTest/URIListToFileListBetweenJVMsTest.html 8194947 generic-all
java/awt/event/ComponentEvent/MovedResizedTardyEventTest/MovedResizedTardyEventTest.html 6511207 generic-all
java/awt/event/ComponentEvent/MovedResizedTwiceTest/MovedResizedTwiceTest.java 8225787 linux-all
java/awt/event/HierarchyEvent/AncestorResized/AncestorResized.java 6618538 generic-all
java/awt/event/InputEvent/EventWhenTest/EventWhenTest.java 8168646 generic-all
java/awt/event/KeyEvent/CorrectTime/CorrectTime.java 6626492 generic-all
@@ -727,6 +730,7 @@ java/lang/String/StringRepeat.java
java/lang/StringCoding/CheckEncodings.sh 7008363 generic-all
java/lang/System/LoggerFinder/modules/JDKLoggerForImageTest.java nobug windows-6.1 fails on Windows 7 only
java/lang/System/LoggerFinder/modules/UnnamedLoggerForImageTest.java nobug windows-6.1 fails on Windows 7 only
java/lang/System/OsVersionTest.java 8253702 macosx-10.16
############################################################################
@@ -1262,5 +1266,6 @@ javax/swing/LookAndFeel/8146276/NimbusGlueTest.java
sanity/client/SwingSet/src/GridBagLayoutDemoTest.java JBR-1977 linux-aarch64
jb/java/jcef/JCEFStartupTest.java JBR-1996 linux-i386,windows-x86
jb/java/awt/event/TouchScreenEvent/TouchScreenEventsTest.java nobug windows-6.1 not supported on Windows 7
jb/java/awt/event/TouchScreenEvent/TouchScreenEventsTestLinux.sh JBR-2585 linux-all
jb/java/awt/event/TouchScreenEvent/TouchScreenEventsTest.java JBR-2585 linux-all,windows-all nobug windows-6.1 not supported on Windows 7
jb/java/awt/event/TouchScreenEvent/TouchScreenEventsTestLinux.sh JBR-2585 linux-all
jb/java/awt/Focus/ChainOfPopupsFocusTest.java JBR-2657 windows-all,linux-all

View File

@@ -41,7 +41,6 @@ java/awt/Frame/MiscUndecorated/FrameCloseTest.java
java/awt/Frame/NormalToIconified/NormalToIconifiedTest.java nobug linux-all,windows-all
java/awt/Frame/ObscuredFrame/ObscuredFrameTest.java nobug macosx-all,linux-all
java/awt/Frame/UnfocusableMaximizedFrameResizablity/UnfocusableMaximizedFrameResizablity.java nobug linux-all,windows-all,macosx-all
java/awt/FullScreen/BufferStrategyExceptionTest/BufferStrategyExceptionTest.java nobug macosx-all,linux-all,windows-all
java/awt/FullScreen/SetFSWindow/FSFrame.java nobug windows-all
java/awt/FullScreen/TranslucentWindow/TranslucentWindow.java nobug windows-all
java/awt/Graphics/LineClipTest.java nobug macosx-all,windows-all