Compare commits

..

36 Commits

Author SHA1 Message Date
Alexey Ushakov
396b5c6e35 Merge branch 'new_fonts' of github.com:/JetBrains/JetBrainsRuntime into new_fonts 2019-10-18 20:19:32 +03:00
Alexey Ushakov
0a99632956 JBR-1925 JetBrainsMono fonts update to v0.20
Updated the fonts to v0.20
2019-10-18 20:11:22 +03:00
Alexey Ushakov
89797f94c9 JBR-1925 JetBrainsMono fonts update to v0.20
Updated the fonts to v0.20
2019-10-18 20:02:54 +03:00
Vitaly Provodin
90a36251b6 JBR-1821: Notarize JBR bundles as a standalone app (follow up) 2019-10-18 20:23:59 +07:00
Kirill Kirichenko
5a29d4ade9 JBR-1874 Cursor not changing from 'default' to 'text'. Additional fix after reopening. 2019-10-18 10:43:30 +03:00
Alexey Ushakov
a0b235eb24 Revert "JBR-1756 use CoreText for all font rendering on Catalina"
This reverts commit acdc0ea3
2019-10-17 20:16:16 +03:00
Alexey Ushakov
20546081aa Revert "JBR-1863, JBR-1868 correct advances on Catalina"
This reverts commit d5868e8f
2019-10-17 20:16:16 +03:00
Elena Sayapina
b99c1e7b5c JBR-1417 Regression test update, fixed focus issue on a certain TC agents by adding frame.toFront() 2019-10-16 19:42:25 +07:00
Vitaly Provodin
aebc0cdb79 JBR-1821: Notarize JBR bundles as a standalone app 2019-10-16 17:05:06 +07:00
Elena Sayapina
d757108517 JBR-1417 Regression test update, additional focus check was added 2019-10-16 13:20:11 +07:00
Elena Sayapina
6ea9530d9f JBR-1417 Regression test update, fixed test compilation, added missed import 2019-10-16 12:22:27 +07:00
Elena Sayapina
9fe5c778d9 JBR-1417 Regression test update, made fail check more straightforward 2019-10-15 19:09:57 +07:00
Konstantin Bulenkov
529d5c8bcc Remove JetBrains Mono Italic until UX-973 is fixed 2019-10-12 14:57:33 +03:00
Vitaly Provodin
9331ecada6 updated JTreg exclude list 2019-10-11 18:17:55 +07:00
Vitaly Provodin
8781991e67 updated JTreg exclude list 2019-10-11 18:17:00 +07:00
Eugene Petrenko
7a24f5a493 project setup improvements
git ignore .idea and cmake build folders folder under /jb
make configure script unix executable to support ./configure runs
add section for building on macOS
2019-10-10 12:24:41 +02:00
Eugene Petrenko
82dcb03358 cds - add more logging to -Xshare:dump errors
log exception along with "Preload Warning: Verification failed" warning messages
advanced debug logging to diagnose listed class was not defined error from -Xshare:dump
more detailed error logging from the Xshare:dump phase
2019-10-10 12:24:41 +02:00
Eugene Petrenko
691e7d46ed Support AppCDS on Windows via a variation of the older JDK fix 8185145
8185145: AppCDS custom loader support on Mac OS X
2019-10-10 12:24:41 +02:00
Calvin Cheung
51ec616d23 8185145: AppCDS custom loader support on Mac OS X
Reviewed-by: dholmes, gziemski
2019-10-10 12:24:41 +02:00
Vitaly Provodin
b3a41ba6d9 updated JTreg exclude list 2019-10-10 09:09:50 +07:00
Vitaly Provodin
2fb4c904ab Revert "cds - log exception along with "Preload Warning: Verification failed" warning messages"
This reverts commit c3839647
2019-10-05 10:43:18 +07:00
Vitaly Provodin
ab1e8dc136 Revert "add section for building on macOS"
This reverts commit 6b7ccbdc
2019-10-05 10:43:09 +07:00
Vitaly Provodin
e480592b39 Revert "cds - advanced debug logging to diagnose listed class was not defined error from -Xshare:dump"
This reverts commit 48478ca6
2019-10-05 10:43:00 +07:00
Vitaly Provodin
99dae8d59e Revert "cds - more detailed error logging from the Xshare:dump phase"
This reverts commit b74750d8
2019-10-05 10:42:51 +07:00
Vitaly Provodin
2e672f6c2f updated JTreg exclude list 2019-10-05 06:35:26 +07:00
Vitaly Provodin
a31ba4ca30 Merge remote-tracking branch 'origin/master' 2019-10-05 06:35:19 +07:00
Alexey Ushakov
1e900726f9 JBR-1721 Cant open project on macOS 10.15
Removed workaround for early Catalina betas
2019-10-04 13:58:57 +03:00
Dmitry Batrak
6f60cad1a9 JBR-1879 Wrong symbols in evaluate expression dialog
add clarifying comment to code
2019-10-03 11:57:33 +03:00
Eugene Petrenko
b74750d845 cds - more detailed error logging from the Xshare:dump phase 2019-10-03 11:35:49 +07:00
Eugene Petrenko
48478ca6e2 cds - advanced debug logging to diagnose listed class was not defined error from -Xshare:dump 2019-10-03 11:35:48 +07:00
Eugene Petrenko
6b7ccbdccc add section for building on macOS 2019-10-03 11:35:48 +07:00
Eugene Petrenko
c3839647c6 cds - log exception along with "Preload Warning: Verification failed" warning messages 2019-10-03 11:35:47 +07:00
Alexey Ushakov
a7b4c9449a JBR-1885 JetBrainsMono fonts update to v0.19
Updated the fonts to v0.19. Bundled italic fonts
2019-10-01 22:52:11 +03:00
Vitaly Provodin
380c17456c moving test/jdk/jb/java/awt/font/TextLayout to test/jdk/jb/java/awt/Font/TextLayout 2019-10-01 10:06:39 +07:00
Dmitry Batrak
ba7496606d JBR-1879 Wrong symbols in evaluate expression dialog
a better check that font used by GDI matches the font used by JRE
2019-09-30 14:47:16 +03:00
Dmitry Batrak
1ee493a1f9 JBR-1879 Wrong symbols in evaluate expression dialog
rollback fix for JBR-1777
2019-09-30 14:46:51 +03:00
36 changed files with 588 additions and 147 deletions

View File

@@ -54,7 +54,15 @@ $ make images
#### TBD
## OSX
#### TBD
install Xcode console tools, autoconf (via homebrew)
run
```
sh ./configure --prefix=$(pwd)/build --disable-warnings-as-errors
make images
```
## Contribution
We will be happy to receive your pull requests. Before you submit one, please sign our Contributor License Agreement (CLA) https://www.jetbrains.com/agreements/cla/

0
configure vendored Normal file → Executable file
View File

2
jb/project/jdk-cmake/.gitignore vendored Normal file
View File

@@ -0,0 +1,2 @@
.idea
cmake-build-*

View File

@@ -0,0 +1,16 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>com.apple.security.cs.allow-jit</key>
<true/>
<key>com.apple.security.cs.allow-unsigned-executable-memory</key>
<true/>
<key>com.apple.security.cs.allow-dyld-environment-variables</key>
<true/>
<key>com.apple.security.cs.disable-library-validation</key>
<true/>
<key>com.apple.security.cs.disable-executable-page-protection</key>
<true/>
</dict>
</plist>

View File

@@ -0,0 +1,120 @@
#!/bin/bash
APP_DIRECTORY=$1
APPL_USER=$2
APPL_PASSWORD=$3
APP_NAME=$4
BUNDLE_ID=$5
FAKE_ROOT="${6:-fake-root}"
if [[ -z "$APP_DIRECTORY" ]] || [[ -z "$APPL_USER" ]] || [[ -z "$APPL_PASSWORD" ]]; then
echo "Usage: $0 AppDirectory Username Password"
exit 1
fi
if [[ ! -d "$APP_DIRECTORY" ]]; then
echo "AppDirectory '$APP_DIRECTORY' does not exist or not a directory"
exit 1
fi
function log() {
echo "$(date '+[%H:%M:%S]') $*"
}
function publish-log() {
id=$1
file=$2
curl -T "$file" "$ARTIFACTORY_URL/$id" || true
}
function altool-upload() {
# Since altool uses same file for upload token we have to trick it into using different folders for token file location
# Also it copies zip into TMPDIR so we override it too, to simplify cleanup
OLD_HOME="$HOME"
export HOME="$FAKE_ROOT/home"
export TMPDIR="$FAKE_ROOT/tmp"
mkdir -p "$HOME"
mkdir -p "$TMPDIR"
export _JAVA_OPTIONS="-Duser.home=$HOME -Djava.io.tmpdir=$TMPDIR"
# Reduce amount of downloads, cache transporter libraries
shared_itmstransporter="$OLD_HOME/shared-itmstransporter"
if [[ -f "$shared_itmstransporter" ]]; then
cp -r "$shared_itmstransporter" "$HOME/.itmstransporter"
fi
# For some reason altool prints everything to stderr, not stdout
set +e
xcrun altool --notarize-app \
--username "$APPL_USER" --password "$APPL_PASSWORD" \
--primary-bundle-id "$BUNDLE_ID" \
--asc-provider JetBrainssro --file "$1" 2>&1 | tee "altool.init.out"
unset TMPDIR
export HOME="$OLD_HOME"
set -e
}
#immediately exit script with an error if a command fails
set -euo pipefail
file="$APP_NAME.zip"
log "Zipping $file..."
rm -rf "$file"
ditto -c -k --sequesterRsrc --keepParent "$APP_DIRECTORY/Contents" "$file"
log "Notarizing $file..."
rm -rf "altool.init.out" "altool.check.out"
altool-upload "$file"
rm -rf "$file"
notarization_info="$(grep -e "RequestUUID" "altool.init.out" | grep -oE '([0-9a-f-]{36})')"
if [ -z "$notarization_info" ]; then
log "Faile to read RequestUUID from altool.init.out"
exit 10
fi
PATH="$PATH:/usr/local/bin/"
log "Notarization request sent, awaiting response"
spent=0
while true; do
# For some reason altool prints everything to stderr, not stdout
xcrun altool --username "$APPL_USER" --notarization-info "$notarization_info" --password "$APPL_PASSWORD" >"altool.check.out" 2>&1 || true
status="$(grep -oe 'Status: .*' "altool.check.out" | cut -c 9- || true)"
log "Current status: $status"
if [ "$status" = "invalid" ]; then
log "Notarization failed"
ec=1
elif [ "$status" = "success" ]; then
log "Notarization succeeded"
ec=0
else
if [ "$status" != "in progress" ]; then
log "Unknown notarization status, waiting more, altool output:"
cat "altool.check.out"
fi
if [[ $spent -gt 60 ]]; then
log "Waiting time out (apx 60 minutes)"
ec=2
break
fi
sleep 60
((spent += 1))
continue
fi
developer_log="developer_log.json"
log "Fetching $developer_log"
# TODO: Replace cut with trim or something better
url="$(grep -oe 'LogFileURL: .*' "altool.check.out" | cut -c 13-)"
wget "$url" -O "$developer_log" && cat "$developer_log" || true
if [ $ec != 0 ]; then
log "Publishing $developer_log"
publish-log "$notarization_info" "$developer_log"
fi
break
done
cat "altool.check.out"
rm -rf "altool.init.out" "altool.check.out"
exit $ec

View File

@@ -0,0 +1,93 @@
#!/bin/bash
APP_DIRECTORY=$1
JB_CERT=$2
if [[ -z "$APP_DIRECTORY" ]] || [[ -z "$JB_CERT" ]]; then
echo "Usage: $0 AppDirectory CertificateID"
exit 1
fi
if [[ ! -d "$APP_DIRECTORY" ]]; then
echo "AppDirectory '$APP_DIRECTORY' does not exist or not a directory"
exit 1
fi
function log() {
echo "$(date '+[%H:%M:%S]') $*"
}
#immediately exit script with an error if a command fails
set -euo pipefail
# Cleanup files left from previous sign attempt (if any)
find "$APP_DIRECTORY" -name '*.cstemp' -exec rm '{}' \;
log "Signing libraries and executables..."
# -perm +111 searches for executables
for f in \
"Contents/Home/bin" \
"Contents/Home/lib"; do
if [ -d "$APP_DIRECTORY/$f" ]; then
find "$APP_DIRECTORY/$f" \
-type f \( -name "*.jnilib" -o -name "*.dylib" -o -name "*.so" -o -perm +111 \) \
-exec codesign --timestamp \
-v -s "$JB_CERT" --options=runtime \
--entitlements entitlements.xml {} \;
fi
done
log "Signing libraries in jars in $PWD"
# todo: add set -euo pipefail; into the inner sh -c
# `-e` prevents `grep -q && printf` loginc
# with `-o pipefail` there's no input for 'while' loop
find "$APP_DIRECTORY" -name '*.jar' \
-exec sh -c "set -u; unzip -l \"\$0\" | grep -q -e '\.dylib\$' -e '\.jnilib\$' -e '\.so\$' -e '^jattach\$' && printf \"\$0\0\" " {} \; |
while IFS= read -r -d $'\0' file; do
log "Processing libraries in $file"
rm -rf jarfolder jar.jar
mkdir jarfolder
filename="${file##*/}"
log "Filename: $filename"
cp "$file" jarfolder && (cd jarfolder && jar xf "$filename" && rm "$filename")
find jarfolder \
-type f \( -name "*.jnilib" -o -name "*.dylib" -o -name "*.so" -o -name "jattach" \) \
-exec codesign --timestamp \
-v -s "$JB_CERT" --options=runtime \
--entitlements entitlements.xml {} \;
(cd jarfolder; zip -q -r -o ../jar.jar .)
mv jar.jar "$file"
done
rm -rf jarfolder jar.jar
log "Signing other files..."
for f in \
"Contents/MacOS"; do
if [ -d "$APP_DIRECTORY/$f" ]; then
find "$APP_DIRECTORY/$f" \
-type f \( -name "*.jnilib" -o -name "*.dylib" -o -name "*.so" -o -perm +111 \) \
-exec codesign --timestamp \
-v -s "$JB_CERT" --options=runtime \
--entitlements entitlements.xml {} \;
fi
done
#log "Signing executable..."
#codesign --timestamp \
# -v -s "$JB_CERT" --options=runtime \
# --force \
# --entitlements entitlements.xml "$APP_DIRECTORY/Contents/MacOS/idea"
log "Signing whole app..."
codesign --timestamp \
-v -s "$JB_CERT" --options=runtime \
--force \
--entitlements entitlements.xml "$APP_DIRECTORY"
log "Verifying java is not broken"
find "$APP_DIRECTORY" \
-type f -name 'java' -perm +111 -exec {} -version \;

View File

@@ -0,0 +1,121 @@
#!/bin/bash
#immediately exit script with an error if a command fails
set -euo pipefail
export COPY_EXTENDED_ATTRIBUTES_DISABLE=true
export COPYFILE_DISABLE=true
INPUT_FILE=$1
EXPLODED=$2.exploded
USERNAME=$3
PASSWORD=$4
CODESIGN_STRING=$5
NOTARIZE=$6
BUNDLE_ID=$7
cd "$(dirname "$0")"
function log() {
echo "$(date '+[%H:%M:%S]') $*"
}
log "Deleting $EXPLODED ..."
if test -d "$EXPLODED"; then
find "$EXPLODED" -mindepth 1 -maxdepth 1 -exec chmod -R u+wx '{}' \;
fi
rm -rf "$EXPLODED"
mkdir "$EXPLODED"
log "Unzipping $INPUT_FILE to $EXPLODED ..."
tar -xzvf "$INPUT_FILE" --directory $EXPLODED --exclude "jmods"
rm "$INPUT_FILE"
BUILD_NAME="$(ls "$EXPLODED")"
#log "$INPUT_FILE unzipped and removed"
log "$INPUT_FILE extracted and removed"
APPLICATION_PATH="$EXPLODED/$BUILD_NAME"
find "$APPLICATION_PATH/Contents/Home/bin" \
-maxdepth 1 -type f -name '*.jnilib' -print0 |
while IFS= read -r -d $'\0' file; do
if [ -f "$file" ]; then
log "Linking $file"
b="$(basename "$file" .jnilib)"
ln -sf "$b.jnilib" "$(dirname "$file")/$b.dylib"
fi
done
find "$APPLICATION_PATH/Contents/" \
-maxdepth 1 -type f -name '*.txt' -print0 |
while IFS= read -r -d $'\0' file; do
if [ -f "$file" ]; then
log "Moving $file"
mv "$file" "$APPLICATION_PATH/Contents/Resources"
fi
done
non_plist=$(find "$APPLICATION_PATH/Contents/" -maxdepth 1 -type f -and -not -name 'Info.plist' | wc -l)
if [[ $non_plist -gt 0 ]]; then
log "Only Info.plist file is allowed in Contents directory but found $non_plist file(s):"
log "$(find "$APPLICATION_PATH/Contents/" -maxdepth 1 -type f -and -not -name 'Info.plist')"
exit 1
fi
log "Unlocking keychain..."
# Make sure *.p12 is imported into local KeyChain
security unlock-keychain -p "$PASSWORD" "/Users/$USERNAME/Library/Keychains/login.keychain"
attempt=1
limit=3
set +e
while [[ $attempt -le $limit ]]; do
log "Signing (attempt $attempt) $APPLICATION_PATH ..."
./sign.sh "$APPLICATION_PATH" "$CODESIGN_STRING"
ec=$?
if [[ $ec -ne 0 ]]; then
((attempt += 1))
if [ $attempt -eq $limit ]; then
set -e
fi
log "Signing failed, wait for 30 sec and try to sign again"
sleep 30
else
log "Signing done"
codesign -v "$APPLICATION_PATH" -vvvvv
log "Check sign done"
((attempt += limit))
fi
done
set -e
if [ "$NOTARIZE" = "yes" ]; then
log "Notarizing..."
# shellcheck disable=SC1090
source "$HOME/.notarize_token"
APP_NAME=$(echo ${INPUT_FILE} | awk -F"." '{ print $1 }')
# Since notarization tool uses same file for upload token we have to trick it into using different folders, hence fake root
# Also it leaves copy of zip file in TMPDIR, so notarize.sh overrides it and uses FAKE_ROOT as location for temp TMPDIR
FAKE_ROOT="$(pwd)/fake-root"
mkdir -p "$FAKE_ROOT"
echo "Notarization will use fake root: $FAKE_ROOT"
./notarize.sh "$APPLICATION_PATH" "$APPLE_USERNAME" "$APPLE_PASSWORD" "$APP_NAME" "$BUNDLE_ID" "$FAKE_ROOT"
rm -rf "$FAKE_ROOT"
set +e
log "Stapling..."
xcrun stapler staple "$APPLICATION_PATH"
else
log "Notarization disabled"
log "Stapling disabled"
fi
log "Zipping $BUILD_NAME to $INPUT_FILE ..."
(
cd "$EXPLODED"
ditto -c -k --sequesterRsrc --keepParent "$BUILD_NAME" "../$INPUT_FILE"
log "Finished zipping"
)
rm -rf "$EXPLODED"
log "Done"

View File

@@ -274,9 +274,9 @@ void ClassListParser::error(const char *msg, ...) {
// This function is used for loading classes for customized class loaders
// during archive dumping.
InstanceKlass* ClassListParser::load_class_from_source(Symbol* class_name, TRAPS) {
#if !(defined(_LP64) && (defined(LINUX)|| defined(SOLARIS)))
// The only supported platforms are: (1) Linux/64-bit and (2) Solaris/64-bit
//
#if !(defined(_LP64) && (defined(LINUX)|| defined(SOLARIS) || defined(__APPLE__) || defined(_WINDOWS) ))
// The only supported platforms are: (1) Linux/64-bit and (2) Solaris/64-bit and
// (3) MacOSX/64-bit and (4) Windows/64-bit
// This #if condition should be in sync with the areCustomLoadersSupportedForCDS
// method in test/lib/jdk/test/lib/Platform.java.
error("AppCDS custom class loaders not supported on this platform");
@@ -364,7 +364,11 @@ Klass* ClassListParser::load_current_class(TRAPS) {
if (!HAS_PENDING_EXCEPTION && (obj != NULL)) {
klass = java_lang_Class::as_Klass(obj);
} else { // load classes in bootclasspath/a
tty->print_cr("Class %s was not loaded from the system classloader", this->current_class_name());
if (HAS_PENDING_EXCEPTION) {
oop throwable = PENDING_EXCEPTION;
java_lang_Throwable::print(throwable, tty);
tty->cr();
CLEAR_PENDING_EXCEPTION;
}
@@ -373,6 +377,7 @@ Klass* ClassListParser::load_current_class(TRAPS) {
if (k != NULL) {
klass = k;
} else {
tty->print_cr("Class %s is not found from SystemDictionary::resolve_or_null(..) == null", this->current_class_name());
if (!HAS_PENDING_EXCEPTION) {
THROW_NULL(vmSymbols::java_lang_ClassNotFoundException());
}

View File

@@ -270,6 +270,7 @@ InstanceKlass* ClassLoaderExt::load_class(Symbol* name, const char* path, TRAPS)
ClassFileStream* stream = NULL;
ClassPathEntry* e = find_classpath_entry_from_cache(path, CHECK_NULL);
if (e == NULL) {
tty->print_cr("Preload Warning: ClassPathEntry is not found for class %s and path %s", class_name, path);
return NULL;
}
{
@@ -336,12 +337,14 @@ ClassPathEntry* ClassLoaderExt::find_classpath_entry_from_cache(const char* path
struct stat st;
if (os::stat(path, &st) != 0) {
// File or directory not found
tty->print_cr("Preload Warning: Source path %s is not found", path);
return NULL;
}
ClassPathEntry* new_entry = NULL;
new_entry = create_class_path_entry(path, &st, false, false, CHECK_NULL);
if (new_entry == NULL) {
tty->print_cr("Preload Warning: The create_class_path_entry() call for path %s returned NULL", path);
return NULL;
}
ccpe._path = strdup(path);
@@ -351,5 +354,14 @@ ClassPathEntry* ClassLoaderExt::find_classpath_entry_from_cache(const char* path
}
Klass* ClassLoaderExt::load_one_class(ClassListParser* parser, TRAPS) {
return parser->load_current_class(THREAD);
Klass* result = parser->load_current_class(THREAD);
if (result == NULL) {
tty->print_cr("Preload Warning: Class %s was not loaded", parser->current_class_name());
if (HAS_PENDING_EXCEPTION) {
oop throwable = PENDING_EXCEPTION;
java_lang_Throwable::print(throwable, tty);
tty->cr();
}
}
return result;
}

View File

@@ -1736,10 +1736,16 @@ int MetaspaceShared::preload_classes(const char* class_list_path, TRAPS) {
while (parser.parse_one_line()) {
Klass* klass = ClassLoaderExt::load_one_class(&parser, THREAD);
if (HAS_PENDING_EXCEPTION) {
if (klass == NULL &&
(PENDING_EXCEPTION->klass()->name() == vmSymbols::java_lang_ClassNotFoundException())) {
// print a warning only when the pending exception is class not found
tty->print_cr("Preload Warning: Cannot find %s", parser.current_class_name());
if (klass == NULL) {
if (PENDING_EXCEPTION->klass()->name() == vmSymbols::java_lang_ClassNotFoundException()) {
// print a warning only when the pending exception is class not found
tty->print_cr("Preload Warning: Cannot find %s", parser.current_class_name());
} else {
tty->print_cr("Preload Warning: Exception loading class %s", parser.current_class_name());
oop throwable = PENDING_EXCEPTION;
java_lang_Throwable::print(throwable, tty);
tty->cr();
}
}
CLEAR_PENDING_EXCEPTION;
}
@@ -1787,6 +1793,11 @@ bool MetaspaceShared::try_link_class(InstanceKlass* ik, TRAPS) {
ResourceMark rm;
tty->print_cr("Preload Warning: Verification failed for %s",
ik->external_name());
oop throwable = PENDING_EXCEPTION;
java_lang_Throwable::print(throwable, tty);
tty->cr();
CLEAR_PENDING_EXCEPTION;
ik->set_in_error_state();
_has_error_classes = true;

View File

@@ -44,6 +44,12 @@ final class CCursorManager extends LWCursorManager {
return theInstance;
}
private static void resetCurrentCursor() {
if (theInstance != null) {
theInstance.currentCursor = null;
}
}
private volatile Cursor currentCursor;
private CCursorManager() { }

View File

@@ -73,6 +73,7 @@
// NSWindow overrides delegate methods
- (BOOL) canBecomeKeyWindow;
- (void) becomeKeyWindow;
- (BOOL) canBecomeMainWindow;
- (BOOL) worksWhenModal;
- (void)sendEvent:(NSEvent *)event;

View File

@@ -104,7 +104,12 @@ static NSPoint lastTopLeftPoint;
- (void)sendEvent:(NSEvent *)event { \
[(AWTWindow*)[self delegate] sendEvent:event]; \
[super sendEvent:event]; \
}
} \
\
- (void)becomeKeyWindow { \
[super becomeKeyWindow]; \
[(AWTWindow*)[self delegate] becomeKeyWindow]; \
} \
@implementation AWTWindow_Normal
AWT_NS_WINDOW_IMPLEMENTATION
@@ -533,6 +538,17 @@ AWT_ASSERT_APPKIT_THREAD;
return self.isEnabled && (IS(self.styleBits, SHOULD_BECOME_KEY) || [self isSimpleWindowOwnedByEmbeddedFrame]);
}
- (void) becomeKeyWindow {
AWT_ASSERT_APPKIT_THREAD;
// Reset current cursor in CCursorManager such that any following mouse update event
// restores the correct cursor to the frame context specific one.
JNIEnv *env = [ThreadUtilities getJNIEnv];
static JNF_CLASS_CACHE(jc_CCursorManager, "sun/lwawt/macosx/CCursorManager");
static JNF_STATIC_MEMBER_CACHE(sjm_resetCurrentCursor, jc_CCursorManager, "resetCurrentCursor", "()V");
JNFCallStaticVoidMethod(env, sjm_resetCurrentCursor);
}
- (BOOL) canBecomeMainWindow {
AWT_ASSERT_APPKIT_THREAD;
if (!self.isEnabled) {

View File

@@ -186,17 +186,11 @@ canChooseDirectories:(BOOL)inChooseDirectories
}
};
NSInteger osversion = [[NSProcessInfo processInfo] operatingSystemVersion].minorVersion; // NOTE: will be removed soon (when native file-chooser fixed on catalina)
if (osversion >= 15) {
[thePanel beginSheetModalForWindow:fOwner completionHandler:^(NSInteger result) {}];
NSModalResponse modalResponse = [thePanel runModal];
onComplete(modalResponse == NSModalResponseOK, NO);
} else {
[thePanel beginSheetModalForWindow:fOwner completionHandler:^(NSInteger result) {
onComplete(result == NSFileHandlingPanelOKButton, YES);
}];
[NSApp runModalForWindow:thePanel];
}
[thePanel beginSheetModalForWindow:fOwner completionHandler:^(NSInteger result) {
onComplete(result == NSFileHandlingPanelOKButton, YES);
}];
[NSApp runModalForWindow:thePanel];
}
else
{

View File

@@ -59,17 +59,8 @@ extern jint* gButtonDownMasks;
#define kCFCoreFoundationVersionNumber10_13_Max 1499
#endif
#ifndef kCFCoreFoundationVersionNumber10_14_Max
#define kCFCoreFoundationVersionNumber10_14_Max 1599
#endif
#ifndef IS_OSX_GT10_13
#define IS_OSX_GT10_13 (floor(kCFCoreFoundationVersionNumber) > \
kCFCoreFoundationVersionNumber10_13_Max)
#endif
#ifndef IS_OSX_GT10_14
#define IS_OSX_GT10_14 (floor(kCFCoreFoundationVersionNumber) > \
kCFCoreFoundationVersionNumber10_14_Max)
#endif

View File

@@ -1222,18 +1222,10 @@ static NSDictionary* prebuiltFamilyNames() {
@"FiraCode-Regular" : @"Fira Code",
@"FiraCode-Retina" : @"Fira Code",
@"Inconsolata" : @"Inconsolata",
@"JetBrainsMono520-Bold" : @"JetBrains Mono 520",
@"JetBrainsMono520-Regular" : @"JetBrains Mono 520",
@"JetBrainsMono520-Thin" : @"JetBrains Mono 520",
@"JetBrainsMonoExpanded-BoldExp" : @"JetBrains Mono Expanded",
@"JetBrainsMonoExpanded-Exp" : @"JetBrains Mono Expanded",
@"JetBrainsMonoExpanded-Thin" : @"JetBrains Mono Expanded",
@"JetBrainsMonoExpanded520-BdEx" : @"JetBrains Mono Expanded 520",
@"JetBrainsMonoExpanded520-Exp" : @"JetBrains Mono Expanded 520",
@"JetBrainsMonoExpanded520-Thin" : @"JetBrains Mono Expanded 520",
@"JetBrainsmono-Bold" : @"JetBrains Mono",
@"JetBrainsmono-Regular" : @"JetBrains Mono",
@"JetBrainsmono-Thin" : @"JetBrains Mono",
@"JetBrainsMono-Bold" : @"JetBrains Mono",
@"JetBrainsMono-Regular" : @"JetBrains Mono",
@"JetBrainsMono-Italic" : @"JetBrains Mono",
@"JetBrainsMono-BoldItalic" : @"JetBrains Mono",
@"Roboto-Light" : @"Roboto",
@"Roboto-Thin" : @"Roboto",
@"SourceCodePro-Bold" : @"Source Code Pro",

View File

@@ -31,7 +31,6 @@
#import "CGGlyphOutlines.h"
#import "CoreTextSupport.h"
#include "fontscalerdefs.h"
#import "LWCToolkit.h"
/* Use THIS_FILE when it is available. */
#ifndef THIS_FILE
@@ -162,7 +161,7 @@ JNF_COCOA_ENTER(env);
CGGlyph glyph;
const CTFontRef fallback = CTS_CopyCTFallbackFontAndGlyphForJavaGlyphCode(awtFont, glyphCode, &glyph);
const CGFontRef cgFallback = CTFontCopyGraphicsFont(fallback, NULL);
if (IS_OSX_GT10_14 || CGGI_IsColorFont(cgFallback)) {
if (CGGI_IsColorFont(cgFallback)) {
CGAffineTransform matrix = awtStrike->fAltTx;
CGFloat fontSize = sqrt(fabs(matrix.a * matrix.d - matrix.b * matrix.c));
CTFontRef font = CTFontCreateWithGraphicsFont(cgFallback, fontSize, NULL, NULL);

View File

@@ -31,7 +31,6 @@
#import "fontscalerdefs.h" // contains the definition of GlyphInfo struct
#import "sun_awt_SunHints.h"
#import "LWCToolkit.h"
//#define USE_IMAGE_ALIGNED_MEMORY 1
//#define CGGI_DEBUG 1
@@ -629,8 +628,7 @@ CGGI_CreateNewGlyphInfoFrom(CGSize advance, CGRect bbox,
static inline void
CGGI_CreateImageForGlyph
(CGFontRef cgFont, CGGI_GlyphCanvas *canvas, const CGGlyph glyph,
GlyphInfo *info, const CGGI_GlyphInfoDescriptor *glyphDescriptor, const AWTStrike *strike,
const bool isCatalinaOrAbove)
GlyphInfo *info, const CGGI_GlyphInfoDescriptor *glyphDescriptor, const AWTStrike *strike)
{
if (isnan(info->topLeftX) || isnan(info->topLeftY)) {
// Explicitly set glyphInfo width/height to be 0 to ensure
@@ -650,7 +648,7 @@ CGGI_CreateImageForGlyph
CGFloat x = -info->topLeftX;
CGFloat y = canvas->image->height + info->topLeftY;
if (isCatalinaOrAbove || glyphDescriptor == &argb) {
if (glyphDescriptor == &argb) {
CGAffineTransform matrix = CGContextGetTextMatrix(canvas->context);
CGFloat fontSize = sqrt(fabs(matrix.a * matrix.d - matrix.b * matrix.c));
CTFontRef font = CTFontCreateWithGraphicsFont(cgFont, fontSize, NULL, NULL);
@@ -694,8 +692,7 @@ CGGI_CreateImageForGlyph
static inline GlyphInfo *
CGGI_CreateImageForUnicode
(CGGI_GlyphCanvas *canvas, const AWTStrike *strike,
const CGGI_RenderingMode *mode, const UnicodeScalarValue uniChar,
const bool isCatalinaOrAbove)
const CGGI_RenderingMode *mode, const UnicodeScalarValue uniChar)
{
// save the state of the world
CGContextSaveGState(canvas->context);
@@ -740,7 +737,7 @@ CGGI_CreateImageForUnicode
CFRelease(cgFallback);
// clean the canvas - align, strike, and copy the glyph from the canvas into the info
CGGI_CreateImageForGlyph(cgFallback, canvas, glyph, info, glyphDescriptor, strike, isCatalinaOrAbove);
CGGI_CreateImageForGlyph(cgFallback, canvas, glyph, info, glyphDescriptor, strike);
// restore the state of the world
CGContextRestoreGState(canvas->context);
@@ -785,15 +782,14 @@ CGGI_FillImagesForGlyphsWithSizedCanvas(CGGI_GlyphCanvas *canvas,
CGGI_GlyphInfoDescriptor* mainFontDescriptor = CGGI_GetGlyphInfoDescriptor(mode, strike->fAWTFont->fNativeCGFont);
const bool isCatalinaOrAbove = IS_OSX_GT10_14;
CFIndex i;
for (i = 0; i < len; i++) {
GlyphInfo *info = (GlyphInfo *)jlong_to_ptr(glyphInfos[i]);
if (info != NULL) {
CGGI_CreateImageForGlyph(strike->fAWTFont->fNativeCGFont,
canvas, glyphs[i], info, mainFontDescriptor, strike, isCatalinaOrAbove);
canvas, glyphs[i], info, mainFontDescriptor, strike);
} else {
info = CGGI_CreateImageForUnicode(canvas, strike, mode, uniChars[i], isCatalinaOrAbove);
info = CGGI_CreateImageForUnicode(canvas, strike, mode, uniChars[i]);
glyphInfos[i] = ptr_to_jlong(info);
}
#ifdef CGGI_DEBUG

View File

@@ -111,6 +111,10 @@ public abstract class FileFont extends PhysicalFont {
return 1; // DEFAULT_CHARSET
}
int getFontDataSize() {
return fileSize;
}
/*
* This is the public interface. The subclasses need to implement
* this. The returned block may be longer than the requested length.

View File

@@ -404,7 +404,8 @@ public class FileFontStrike extends PhysicalStrike {
int glyphCode,
boolean fracMetrics,
int rotation,
byte charset);
byte charset,
int fontDataSize);
private native long _getGlyphImageFromWindowsUsingDirectWrite(String family,
int style,
@@ -422,10 +423,6 @@ public class FileFontStrike extends PhysicalStrike {
long getGlyphImageFromWindows(int glyphCode) {
String family = fileFont.getFamilyName(null);
FontFamily fontFamily = FontFamily.getFamily(family);
if (fontFamily != null && fontFamily.hasMultipleCandidatesForSameStyle()) {
// we cannot unambiguously specify font by its family name and style
return 0;
}
int style = desc.style & Font.BOLD | desc.style & Font.ITALIC
| fileFont.getStyle();
if (fontFamily != null && fontFamily.getFont(style) != fileFont) {
@@ -445,7 +442,12 @@ public class FileFontStrike extends PhysicalStrike {
}
if (ptr == 0) {
boolean fm = desc.fmHint == INTVAL_FRACTIONALMETRICS_ON;
ptr = _getGlyphImageFromWindows(family, style, size, glyphCode, fm, rotation, charset);
ptr = _getGlyphImageFromWindows(family, style, size, glyphCode, fm, rotation, charset,
fileFont.getFontDataSize());
if (ptr == 0 && FontUtilities.isLogging()) {
FontUtilities.getLogger().warning("Failed to render glyph via GDI: code=" + glyphCode
+ ", fontFamily=" + family + ", style=" + style + ", size=" + size + ", rotation=" + rotation);
}
if (ptr != 0 && fm) {
Point2D.Float metrics = new Point2D.Float();
fileFont.getGlyphMetrics(pScalerContext, glyphCode, metrics);

View File

@@ -32,7 +32,6 @@ import java.util.*;
import java.util.concurrent.ConcurrentHashMap;
public class FontFamily {
private static final byte CONFLICTING_STYLES = 0x10;
private static ConcurrentHashMap<String, FontFamily>
familyNameMap = new ConcurrentHashMap<String, FontFamily>();
@@ -47,7 +46,6 @@ public class FontFamily {
private boolean initialized = false;
protected boolean logicalFont = false;
protected int familyRank;
private byte stylesMask;
public static FontFamily getFamily(String name) {
return familyNameMap.get(name.toLowerCase(Locale.ENGLISH));
@@ -69,16 +67,6 @@ public class FontFamily {
return;
}
family.ensureFontsLoaded();
if (FontUtilities.isWindows) {
synchronized (family.fontSequence) {
if (family.stylesMask != CONFLICTING_STYLES &&
(family.plain == font2D || family.bold == font2D ||
family.italic == font2D || family.bolditalic == font2D)) {
byte styleBit = getWinFontStyleBit(font2D);
family.stylesMask = (byte) (family.stylesMask & ~styleBit);
}
}
}
if (family.plain == font2D) {
family.plain = null;
}
@@ -306,12 +294,6 @@ public class FontFamily {
return;
}
if (FontUtilities.isWindows && stylesMask != CONFLICTING_STYLES) {
byte styleBit = getWinFontStyleBit(font);
byte newMask = (byte) (stylesMask | styleBit);
stylesMask = newMask == stylesMask ? CONFLICTING_STYLES : newMask;
}
switch (style) {
case Font.PLAIN:
@@ -343,12 +325,6 @@ public class FontFamily {
}
}
private static byte getWinFontStyleBit(Font2D font) {
// Windows seems to ignore bold attribute from fsSelection field, and consider only font's weight
int winFontStyle = (font.getWeight() >= 410 ? 1 : 0) | (font.getStyle() & Font.ITALIC);
return (byte) (1 << winFontStyle);
}
public Font2D getFontWithExactStyleMatch(int style) {
ensureFontsLoaded();
switch (style) {
@@ -498,10 +474,6 @@ public class FontFamily {
return families.toArray(new FontFamily[0]);
}
boolean hasMultipleCandidatesForSameStyle() {
return stylesMask == CONFLICTING_STYLES;
}
public String toString() {
return
"Font family: " + familyName +

View File

@@ -329,10 +329,10 @@ public abstract class SunFontManager implements FontSupport, FontManagerForSGE {
jreFontMap.put("JetBrains Mono Bold", "JetBrainsMono-Bold.ttf");
jreFontMap.put("JetBrains Mono Regular", "JetBrainsMono-Regular.ttf");
jreFontMap.put("JetBrains Mono Italic", "JetBrainsMono-Italic.ttf");
jreFontMap.put("JetBrains Mono Bold Italic", "JetBrainsMono-Bold-Italic.ttf");
for (String ffile : jreFontMap.values()) {
jreBundledFontFiles.add(ffile);
}
jreBundledFontFiles.addAll(jreFontMap.values());
}
static {

View File

@@ -181,6 +181,7 @@ public class TrueTypeFont extends FileFont {
private String localeFullName;
private Byte supportedCharset;
private int fontDataSize;
public TrueTypeFont(String platname, Object nativeNames, int fIndex,
boolean javaRasterizer)
@@ -539,11 +540,13 @@ public class TrueTypeFont extends FileFont {
fontIndex = fIndex;
buffer = readBlock(TTCHEADERSIZE+4*fIndex, 4);
headerOffset = buffer.getInt();
fontDataSize = Math.max(0, fileSize - headerOffset);
break;
case v1ttTag:
case trueTag:
case ottoTag:
fontDataSize = fileSize;
break;
default:
@@ -1780,6 +1783,11 @@ public class TrueTypeFont extends FileFont {
private static native void getSupportedCharsetsForFamily(String familyName, Map<String, Byte> supportedCharsets);
@Override
int getFontDataSize() {
return fontDataSize;
}
@Override
public String toString() {
return "** TrueType Font: Family="+familyName+ " Name="+fullName+

Binary file not shown.

View File

@@ -1,4 +1,4 @@
405
449
DroidSans-Bold.ttf -misc-droid sans-bold-r-normal--0-0-0-0-p-0-adobe-standard
DroidSans-Bold.ttf -misc-droid sans-bold-r-normal--0-0-0-0-p-0-ascii-0
DroidSans-Bold.ttf -misc-droid sans-bold-r-normal--0-0-0-0-p-0-iso10646-1
@@ -279,18 +279,62 @@ Inconsolata.ttf -misc-inconsolata-medium-r-normal--0-0-0-0-c-0-iso8859-1
Inconsolata.ttf -misc-inconsolata-medium-r-normal--0-0-0-0-c-0-iso8859-15
Inconsolata.ttf -misc-inconsolata-medium-r-normal--0-0-0-0-c-0-iso8859-2
Inconsolata.ttf -misc-inconsolata-medium-r-normal--0-0-0-0-c-0-iso8859-9
JetBrainsMono-Bold-Italic.ttf -misc-jetbrains mono-bold-i-normal--0-0-0-0-p-0-ascii-0
JetBrainsMono-Bold-Italic.ttf -misc-jetbrains mono-bold-i-normal--0-0-0-0-p-0-iso10646-1
JetBrainsMono-Bold-Italic.ttf -misc-jetbrains mono-bold-i-normal--0-0-0-0-p-0-iso8859-1
JetBrainsMono-Bold-Italic.ttf -misc-jetbrains mono-bold-i-normal--0-0-0-0-p-0-iso8859-10
JetBrainsMono-Bold-Italic.ttf -misc-jetbrains mono-bold-i-normal--0-0-0-0-p-0-iso8859-13
JetBrainsMono-Bold-Italic.ttf -misc-jetbrains mono-bold-i-normal--0-0-0-0-p-0-iso8859-15
JetBrainsMono-Bold-Italic.ttf -misc-jetbrains mono-bold-i-normal--0-0-0-0-p-0-iso8859-16
JetBrainsMono-Bold-Italic.ttf -misc-jetbrains mono-bold-i-normal--0-0-0-0-p-0-iso8859-2
JetBrainsMono-Bold-Italic.ttf -misc-jetbrains mono-bold-i-normal--0-0-0-0-p-0-iso8859-3
JetBrainsMono-Bold-Italic.ttf -misc-jetbrains mono-bold-i-normal--0-0-0-0-p-0-iso8859-4
JetBrainsMono-Bold-Italic.ttf -misc-jetbrains mono-bold-i-normal--0-0-0-0-p-0-iso8859-9
JetBrainsMono-Bold-Italic.ttf -misc-jetbrains mono-bold-i-normal--0-0-0-0-p-0-koi8-r
JetBrainsMono-Bold-Italic.ttf -misc-jetbrains mono-bold-i-normal--0-0-0-0-p-0-koi8-u
JetBrainsMono-Bold-Italic.ttf -misc-jetbrains mono-bold-i-normal--0-0-0-0-p-0-microsoft-cp1252
JetBrainsMono-Bold.ttf -misc-jetbrains mono-bold-r-normal--0-0-0-0-p-0-ascii-0
JetBrainsMono-Bold.ttf -misc-jetbrains mono-bold-r-normal--0-0-0-0-p-0-iso10646-1
JetBrainsMono-Bold.ttf -misc-jetbrains mono-bold-r-normal--0-0-0-0-p-0-iso8859-1
JetBrainsMono-Bold.ttf -misc-jetbrains mono-bold-r-normal--0-0-0-0-p-0-iso8859-10
JetBrainsMono-Bold.ttf -misc-jetbrains mono-bold-r-normal--0-0-0-0-p-0-iso8859-13
JetBrainsMono-Bold.ttf -misc-jetbrains mono-bold-r-normal--0-0-0-0-p-0-iso8859-15
JetBrainsMono-Bold.ttf -misc-jetbrains mono-bold-r-normal--0-0-0-0-p-0-iso8859-16
JetBrainsMono-Bold.ttf -misc-jetbrains mono-bold-r-normal--0-0-0-0-p-0-iso8859-2
JetBrainsMono-Bold.ttf -misc-jetbrains mono-bold-r-normal--0-0-0-0-p-0-iso8859-3
JetBrainsMono-Bold.ttf -misc-jetbrains mono-bold-r-normal--0-0-0-0-p-0-iso8859-4
JetBrainsMono-Bold.ttf -misc-jetbrains mono-bold-r-normal--0-0-0-0-p-0-iso8859-9
JetBrainsMono-Bold.ttf -misc-jetbrains mono-bold-r-normal--0-0-0-0-p-0-koi8-r
JetBrainsMono-Bold.ttf -misc-jetbrains mono-bold-r-normal--0-0-0-0-p-0-koi8-u
JetBrainsMono-Bold.ttf -misc-jetbrains mono-bold-r-normal--0-0-0-0-p-0-microsoft-cp1252
JetBrainsMono-Italic.ttf -misc-jetbrains mono-medium-i-normal--0-0-0-0-p-0-ascii-0
JetBrainsMono-Italic.ttf -misc-jetbrains mono-medium-i-normal--0-0-0-0-p-0-iso10646-1
JetBrainsMono-Italic.ttf -misc-jetbrains mono-medium-i-normal--0-0-0-0-p-0-iso8859-1
JetBrainsMono-Italic.ttf -misc-jetbrains mono-medium-i-normal--0-0-0-0-p-0-iso8859-10
JetBrainsMono-Italic.ttf -misc-jetbrains mono-medium-i-normal--0-0-0-0-p-0-iso8859-13
JetBrainsMono-Italic.ttf -misc-jetbrains mono-medium-i-normal--0-0-0-0-p-0-iso8859-15
JetBrainsMono-Italic.ttf -misc-jetbrains mono-medium-i-normal--0-0-0-0-p-0-iso8859-16
JetBrainsMono-Italic.ttf -misc-jetbrains mono-medium-i-normal--0-0-0-0-p-0-iso8859-2
JetBrainsMono-Italic.ttf -misc-jetbrains mono-medium-i-normal--0-0-0-0-p-0-iso8859-3
JetBrainsMono-Italic.ttf -misc-jetbrains mono-medium-i-normal--0-0-0-0-p-0-iso8859-4
JetBrainsMono-Italic.ttf -misc-jetbrains mono-medium-i-normal--0-0-0-0-p-0-iso8859-9
JetBrainsMono-Italic.ttf -misc-jetbrains mono-medium-i-normal--0-0-0-0-p-0-koi8-r
JetBrainsMono-Italic.ttf -misc-jetbrains mono-medium-i-normal--0-0-0-0-p-0-koi8-u
JetBrainsMono-Italic.ttf -misc-jetbrains mono-medium-i-normal--0-0-0-0-p-0-microsoft-cp1252
JetBrainsMono-Regular.ttf -misc-jetbrains mono-medium-r-normal--0-0-0-0-p-0-ascii-0
JetBrainsMono-Regular.ttf -misc-jetbrains mono-medium-r-normal--0-0-0-0-p-0-iso10646-1
JetBrainsMono-Thin.ttf -misc-jetbrains mono thin-thin-r-normal--0-0-0-0-p-0-iso10646-1
JetBrainsMono520-Bold.ttf -misc-jetbrains mono 520-bold-r-normal--0-0-0-0-p-0-iso10646-1
JetBrainsMono520-Regular.ttf -misc-jetbrains mono 520-medium-r-normal--0-0-0-0-p-0-iso10646-1
JetBrainsMono520-Thin.ttf -misc-jetbrains mono 520 thin-thin-r-normal--0-0-0-0-p-0-iso10646-1
JetBrainsMonoExpanded-Bold.ttf -misc-jetbrains mono expanded exp-bold-r-expanded--0-0-0-0-p-0-iso10646-1
JetBrainsMonoExpanded-Regular.ttf -misc-jetbrains mono expanded exp-medium-r-expanded--0-0-0-0-p-0-iso10646-1
JetBrainsMonoExpanded-Thin.ttf -misc-jetbrains mono expanded th ex-thin-r-expanded--0-0-0-0-p-0-iso10646-1
JetBrainsMonoExpanded520-Bold.ttf -misc-jetbrains mono expanded 520 exp-bold-r-expanded--0-0-0-0-p-0-iso10646-1
JetBrainsMonoExpanded520-Regular.ttf -misc-jetbrains mono expanded 520 exp-medium-r-expanded--0-0-0-0-p-0-iso10646-1
JetBrainsMonoExpanded520-Thin.ttf -misc-jetbrains mono expanded 520 th e-thin-r-expanded--0-0-0-0-p-0-iso10646-1
JetBrainsMono-Regular.ttf -misc-jetbrains mono-medium-r-normal--0-0-0-0-p-0-iso8859-1
JetBrainsMono-Regular.ttf -misc-jetbrains mono-medium-r-normal--0-0-0-0-p-0-iso8859-10
JetBrainsMono-Regular.ttf -misc-jetbrains mono-medium-r-normal--0-0-0-0-p-0-iso8859-13
JetBrainsMono-Regular.ttf -misc-jetbrains mono-medium-r-normal--0-0-0-0-p-0-iso8859-15
JetBrainsMono-Regular.ttf -misc-jetbrains mono-medium-r-normal--0-0-0-0-p-0-iso8859-16
JetBrainsMono-Regular.ttf -misc-jetbrains mono-medium-r-normal--0-0-0-0-p-0-iso8859-2
JetBrainsMono-Regular.ttf -misc-jetbrains mono-medium-r-normal--0-0-0-0-p-0-iso8859-3
JetBrainsMono-Regular.ttf -misc-jetbrains mono-medium-r-normal--0-0-0-0-p-0-iso8859-4
JetBrainsMono-Regular.ttf -misc-jetbrains mono-medium-r-normal--0-0-0-0-p-0-iso8859-9
JetBrainsMono-Regular.ttf -misc-jetbrains mono-medium-r-normal--0-0-0-0-p-0-koi8-r
JetBrainsMono-Regular.ttf -misc-jetbrains mono-medium-r-normal--0-0-0-0-p-0-koi8-u
JetBrainsMono-Regular.ttf -misc-jetbrains mono-medium-r-normal--0-0-0-0-p-0-microsoft-cp1252
Roboto-Light.ttf -misc-roboto light-light-r-normal--0-0-0-0-p-0-adobe-standard
Roboto-Light.ttf -misc-roboto light-light-r-normal--0-0-0-0-p-0-ascii-0
Roboto-Light.ttf -misc-roboto light-light-r-normal--0-0-0-0-p-0-iso10646-1

View File

@@ -171,8 +171,8 @@ JNIEXPORT jboolean JNICALL
JNIEXPORT jlong JNICALL
Java_sun_font_FileFontStrike__1getGlyphImageFromWindows
(JNIEnv *env, jobject unused,
jstring fontFamily, jint style, jint size, jint glyphCode, jboolean fm, jint rotation, jbyte charset) {
(JNIEnv *env, jobject unused, jstring fontFamily, jint style, jint size,
jint glyphCode, jboolean fm, jint rotation, jbyte charset, jint fontDataSize) {
GLYPHMETRICS glyphMetrics;
LOGFONTW lf;
@@ -188,6 +188,7 @@ Java_sun_font_FileFontStrike__1getGlyphImageFromWindows
LPWSTR name;
HFONT oldFont, hFont;
MAT2 mat2;
DWORD actualFontDataSize;
unsigned short width;
unsigned short height;
@@ -255,6 +256,17 @@ Java_sun_font_FileFontStrike__1getGlyphImageFromWindows
}
oldFont = SelectObject(hMemoryDC, hFont);
if (fontDataSize > 0) {
// We cannot specify via GDI which font file to use,
// so we check that it picks the exact font we need by validating font size.
// If it doesn't match, we cannot proceed, as same glyph code can correspond
// to a completely different glyph in the selected font.
actualFontDataSize = GetFontData(hMemoryDC, 0, 0, NULL, 0);
if (actualFontDataSize != fontDataSize) {
FREE_AND_RETURN;
}
}
tmpBitmap = CreateCompatibleBitmap(hDesktopDC, 1, 1);
if (tmpBitmap == NULL) {
FREE_AND_RETURN;

View File

@@ -83,6 +83,9 @@ gc/stress/TestReclaimStringsLeaksMemory.java
runtime/CompressedOops/UseCompressedOops.java 8079353 generic-all
runtime/NMT/MallocStressTest.java 8079353 generic-all
runtime/SelectionResolution/InvokeInterfaceICCE.java 8224795 generic-all
runtime/SelectionResolution/InvokeVirtualICCE.java 8224795 generic-all
runtime/SelectionResolution/InvokeVirtualSuccessTest.java 8224795 generic-all
runtime/SharedArchiveFile/SASymbolTableTest.java 8193639 solaris-all
vmTestbase/nsk/jdi/BScenarios/hotswap/tc10x001/TestDescription.java 8013728 generic-all
runtime/memory/ReadFromNoaccessArea.java nobug generic-all crash is the expected behaviour

View File

@@ -26,6 +26,7 @@ import javax.swing.WindowConstants;
import java.awt.Component;
import java.awt.Container;
import java.awt.FocusTraversalPolicy;
import java.awt.KeyboardFocusManager;
import java.awt.Point;
import java.awt.Robot;
import java.awt.Window;
@@ -45,43 +46,56 @@ import java.awt.event.KeyEvent;
/*
* Description: Test checks that focus goes to the parent popup when child popup is closed.
* Test opens several popups one by one, setting current popup as a parent for the next one.
* Then the popups are closed one by one. Test fails if the main frame gets closed or
* if the number of closed popups is not equal to the number of open popups.
* It means that focus went somewhere else than the parent popup.
* Then the popups are closed one by one. Test fails if focus went somewhere else than the parent popup.
*/
public class ChainOfPopupsFocusTest implements Runnable, ActionListener {
private static final int DEPTH = 5;
private static final String FRAMENAME = "MainFrame";
private static final String POPUPNAME = "Popup";
private static volatile boolean frameHidden = false;
private static volatile int popupsHidden = 0;
private static volatile Component focusOwner;
private static volatile int popupsCount;
private static Robot robot;
private JFrame frame;
public static void main(String[] args) throws Exception {
ChainOfPopupsFocusTest test = new ChainOfPopupsFocusTest();
SwingUtilities.invokeAndWait(test);
robot = new Robot();
robot.setAutoDelay(50);
for (int i = 0; i < DEPTH; i++) pressCtrlKey(KeyEvent.VK_N);
robot.delay(2000);
for (int i = 0; i < DEPTH; i++) pressCtrlKey(KeyEvent.VK_X);
robot.delay(2000);
ChainOfPopupsFocusTest test = new ChainOfPopupsFocusTest();
SwingUtilities.invokeAndWait(test);
robot.delay(3000);
try {
if(frameHidden) {
System.err.println("Error: frameHidden=" + frameHidden);
throw new RuntimeException("Test FAILED: Focus went to the main frame instead of the parent popup");
SwingUtilities.invokeAndWait(() ->
focusOwner = KeyboardFocusManager.getCurrentKeyboardFocusManager().getFocusOwner());
if(focusOwner == null || !focusOwner.getName().equals(FRAMENAME)) {
throw new RuntimeException("Test ERROR: " + FRAMENAME + " is not focused");
}
if(popupsHidden != DEPTH) {
System.err.println("Error: frameHidden=" + frameHidden + " popupsHidden=" + popupsHidden);
SwingUtilities.invokeAndWait(() -> focusOwner = test.frame.getFocusOwner());
throw new RuntimeException("Test FAILED: Focus went to " + focusOwner + " instead of the parent popup");
for (int count = 1; count <= DEPTH; count++) {
pressCtrlKey(KeyEvent.VK_N);
robot.delay(1000);
}
if(popupsCount != DEPTH) {
throw new RuntimeException("Test ERROR: Number of open popups is "
+ popupsCount + ", but " + DEPTH + " is expected");
}
for (int count = DEPTH-1; count >= 0; count--) {
pressCtrlKey(KeyEvent.VK_X);
robot.delay(1000);
SwingUtilities.invokeAndWait(() ->
focusOwner = KeyboardFocusManager.getCurrentKeyboardFocusManager().getFocusOwner());
String focusedComponent = (focusOwner != null ? focusOwner.getName() : "Nothing");
String expectedComponent = (count == 0 ? FRAMENAME : POPUPNAME + count);
if(!focusedComponent.equals(expectedComponent)) {
throw new RuntimeException("Test FAILED: "
+ focusedComponent + " is focused instead of " + expectedComponent);
}
}
} finally {
SwingUtilities.invokeAndWait(() -> test.frame.dispose());
@@ -99,22 +113,20 @@ public class ChainOfPopupsFocusTest implements Runnable, ActionListener {
@Override
public void run() {
JTextArea area = createTextArea(FRAMENAME);
frame = new JFrame(getClass().getSimpleName());
frame.add(new JScrollPane(createTextArea()));
frame.add(new JScrollPane(area));
frame.pack();
frame.setDefaultCloseOperation(WindowConstants.DISPOSE_ON_CLOSE);
frame.setLocationRelativeTo(null);
frame.addComponentListener(new ComponentAdapter() {
@Override
public void componentHidden(ComponentEvent event) {
frameHidden = true;
}
});
frame.setVisible(true);
frame.toFront();
area.requestFocusInWindow();
}
private JTextArea createTextArea() {
private JTextArea createTextArea(String locatedOn) {
JTextArea area = new JTextArea(20, 40);
area.setName(locatedOn);
area.registerKeyboardAction(this, "show", KeyStroke.getKeyStroke("control N"), JComponent.WHEN_FOCUSED);
area.registerKeyboardAction(event -> SwingUtilities.getWindowAncestor((Component) event.getSource()).setVisible(false), KeyStroke.getKeyStroke("control X"), JComponent.WHEN_FOCUSED);
area.addComponentListener(new ComponentAdapter() {
@@ -132,7 +144,7 @@ public class ChainOfPopupsFocusTest implements Runnable, ActionListener {
switch (event.getActionCommand()) {
case "show":
Point point = source.getLocationOnScreen();
Component area = createTextArea();
Component area = createTextArea(POPUPNAME + ++popupsCount);
Popup popup = PopupFactory.getSharedInstance().getPopup(source, new JScrollPane(area), point.x + 10, point.y + 10);
Window window = SwingUtilities.getWindowAncestor(area);
window.setAutoRequestFocus(true);
@@ -164,12 +176,6 @@ public class ChainOfPopupsFocusTest implements Runnable, ActionListener {
return area;
}
});
window.addComponentListener(new ComponentAdapter() {
@Override
public void componentHidden(ComponentEvent event) {
popupsHidden++;
}
});
popup.show();
break;
case "hide":

View File

@@ -119,7 +119,7 @@ java/awt/BasicStroke/DashZeroWidth.java
java/awt/Choice/ItemStateChangeTest/ItemStateChangeTest.java 8169108 windows-all
java/awt/Choice/ChoiceGeneratesItemEvents/ChoiceGeneratesItemEvents.html 8047703 generic-all
java/awt/Choice/ChoiceKeyEventReaction/ChoiceKeyEventReaction.html 6849922 macosx-all,windows-all
java/awt/Choice/ChoiceMouseWheelTest/ChoiceMouseWheelTest.java 7100044 macosx-all,windows-all
java/awt/Choice/ChoiceMouseWheelTest/ChoiceMouseWheelTest.java 7100044 macosx-all,windows-all,linux-all
java/awt/Choice/ChoicePopupLocation/ChoicePopupLocation.java 8202931 macosx-all,linux-all,windows-all
java/awt/Choice/GrabLockTest/GrabLockTest.java JRE-839 windows-all,macosx-all,linux-all
java/awt/Choice/PopdownGeneratesMouseEvents/PopdownGeneratesMouseEvents.html 8194045 generic-all
@@ -210,7 +210,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/DisplayChangeVITest/DisplayChangeVITest.java 8169469 windows-all,linux-all (linux: NPE commit testing)
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
java/awt/FullScreen/UninitializedDisplayModeChangeTest/UninitializedDisplayModeChangeTest.java 7188711 macosx-all
@@ -565,6 +565,7 @@ java/awt/Scrollbar/ScrollbarMouseWheelTest/ScrollbarMouseWheelTest.java
java/awt/SplashScreen/MultiResolutionSplash/MultiResolutionSplashTest.java 8061235,8159592,8134231 macosx-all,windows-all,linux-all
java/awt/SplashScreen/MultiResolutionSplash/unix/UnixMultiResolutionSplashTest.java 8203004 linux-all
java/awt/TextArea/AutoScrollOnSelectAndAppend/AutoScrollOnSelectAndAppend.java 8213120 macosx-all,linux-all, windows-all (windows, linux - time out)
java/awt/TextArea/DisposeTest/TestDispose.java JBR-1905 generic-all
java/awt/TextArea/TextAreaScrolling/TextAreaScrolling.java 8196300 windows-all
java/awt/TextField/SelectionInvisibleTest/SelectionInvisibleTest.java 8169533 macosx-all,windows-all
java/awt/Toolkit/DesktopProperties/rfe4758438.java 8193547 linux-all
@@ -616,7 +617,7 @@ java/awt/datatransfer/SystemFlavorMap/AddFlavorTest.java
java/awt/dnd/BadSerializaionTest/BadSerializationTest.java 8039082 generic-all
java/awt/dnd/Button2DragTest/Button2DragTest.java 8157172 macosx-all,linux-all,windows-all
java/awt/dnd/DisposeFrameOnDragCrash/DisposeFrameOnDragTest.java 8202790 macosx-all,linux-all
java/awt/dnd/DragInterceptorAppletTest/DragInterceptorAppletTest.html 8215538 windows-all
java/awt/dnd/DragInterceptorAppletTest/DragInterceptorAppletTest.html 8215538 windows-all,macosx-all,linux-all (macosx-all,linux-all: commit)
java/awt/dnd/DropTargetEnterExitTest/ExtraDragEnterTest.java 8029680 macosx-all,linux-all,windows-all
java/awt/dnd/DropTargetEnterExitTest/MissedDragExitTest.java 8028998,8159694 macosx-all,windows-all,linux-all
java/awt/dnd/ImageTransferTest/ImageTransferTest.java 8176556 generic-all
@@ -1191,6 +1192,7 @@ com/sun/jdi/RedefineCrossEvent.java
############################################################################
jdk/internal/platform/cgroup/TestCgroupMetrics.java 8222533 linux-all
jdk/internal/platform/docker/TestSystemMetrics.java 8224502 linux-all
# jdk_jfr

View File

@@ -110,7 +110,6 @@ java/awt/datatransfer/Independence/IndependenceAWTTest.java
java/awt/datatransfer/MissedHtmlAndRtfBug/MissedHtmlAndRtfBug.html nobug macosx-all,windows-all
java/awt/datatransfer/SystemSelection/SystemSelectionSwingTest.java nobug linux-all
java/awt/dnd/AcceptDropMultipleTimes/AcceptDropMultipleTimes.java nobug macosx-all,windows-all,linux-all
java/awt/dnd/DragInterceptorAppletTest/DragInterceptorAppletTest.html nobug macosx-all,linux-all,windows-all
java/awt/dnd/DnDTestWithHIDPI/DragTestWithHIDPI.java nobug macosx-all,windows-all,linux-all
java/awt/dnd/FileListBetweenJVMsTest/FileListBetweenJVMsTest.html nobug macosx-all,linux-all,windows-all
java/awt/dnd/InterJVMGetDropSuccessTest/InterJVMGetDropSuccessTest.html nobug macosx-all,windows-all,linux-all

View File

@@ -126,4 +126,14 @@ public class BundledFontTest {
public void testJetBrainsMonoBold() throws Exception {
doTestFont("JetBrains Mono", Font.BOLD);
}
@Test
public void testJetBrainsMonoItalic() throws Exception {
doTestFont("JetBrains Mono", Font.ITALIC);
}
@Test
public void testJetBrainsMonoBoldItalic() throws Exception {
doTestFont("JetBrains Mono", Font.BOLD | Font.ITALIC);
}
}

View File

@@ -354,10 +354,6 @@ public class Platform {
* This should match the #if condition in ClassListParser::load_class_from_source().
*/
public static boolean areCustomLoadersSupportedForCDS() {
boolean isLinux = Platform.isLinux();
boolean is64 = Platform.is64bit();
boolean isSolaris = Platform.isSolaris();
return (is64 && (isLinux || isSolaris));
return (is64bit() && (isLinux() || isSolaris() || isOSX() || isWindows()));
}
}