Compare commits

..

38 Commits

Author SHA1 Message Date
Artem Bochkarev
ae41b6933c JBR-1794: backport 8234522: [macos] Crash with use of native file dialog
cherry-picked from hg changeset (Node ID e07a60855a7631b5eac32da1f1e71d72986a2c06, Parent  221a47a6f6d335560d9dd532a1ac593e316b5954)

(cherry picked from commit 09eabbd567)
2019-12-11 14:45:08 +03:00
Denis Fokin
c8ad353f45 JBR-1991 Focus problems in Windows with X-Mouse style focus 2019-12-06 12:37:53 +03:00
Vitaly Provodin
57162c91c3 updated JTreg exclude list 2019-12-06 10:04:05 +07:00
Denis Konoplev
cab3f28907 Windows touch screen support 2019-12-04 13:48:56 +03:00
Alexey Ushakov
5d7fd2e1e5 JBR-1997 JetBrainsMono fonts update to v0.22 2019-12-04 12:03:44 +03:00
Vitaly Provodin
623a029e3b updated JTreg exclude list 2019-12-04 10:51:00 +07:00
Alexey Ushakov
dbd24232e4 JBR-1986 Enabling fractional metrics causes visual artifacts in font rendering on macOS 10.14+
Disable subpixel positioning for macOS 10.13+ if legacy LCD rendering is disabled
2019-11-28 16:07:56 +03:00
Dmitry Batrak
850653192b JBR-1987 Korean/Thai characters not printed properly in annotation tooltip (e.g. spellchecker)
This changes the fonts JDK uses for font fallback on Windows. These used to be DokChampa (for Thai) and Batang/Gulim/Gulim (for Korean).
Those fonts are not available by default on Windows 10, user needs to install supplementary font language packs to get them.
Now the following fonts will be used - Tahoma (for Thai) and Malgun Gothic (for Korean). They are available by default
on Windows 7, 8 and 10.
2019-11-28 11:44:38 +03:00
Vitaly Provodin
7108e075db updated JTreg exclude list 2019-11-28 11:25:22 +07:00
Denis Konoplev
f67d51a140 README build for windows 2019-11-27 12:49:59 +03:00
Vitaly Provodin
4a6c286035 updated JTreg exclude list 2019-11-26 09:36:23 +07:00
Anton Tarasov
b60fac96b4 JBR-1976 [jcef] need mouse-transparent window on Windows 2019-11-25 12:25:19 +03:00
Vitaly Provodin
9f25f84f11 updated JTreg exclude list 2019-11-25 10:42:32 +07:00
Alexey Ushakov
f5302a02f4 JBR-1974 JetBrainsMono fonts update to v0.21 2019-11-22 16:49:46 +03:00
Denis Fokin
c8b3c854d3 IDEA-215004 Focus is lost by editor on project opening 2019-11-21 19:14:43 +03:00
Elena Sayapina
588cfef576 JBR-1694: java.lang.IllegalArgumentException: Null charset name
Move GB18030.class from sun/nio/cs/ext (jdk.charsets) to sun/nio/cs (java.base),
so the charset is available during VM initialization on Windows.
2019-11-21 16:20:20 +07:00
Vitaly Provodin
bcf1255189 updated JTreg exclude list 2019-11-21 11:33:27 +07:00
Alexey Ushakov
faa8d3d258 JBR-1962 Allow to change font config
Replaced several privileged blocks with just one
2019-11-20 23:08:28 +03:00
Vitaly Provodin
23287956de updated JTreg exclude list 2019-11-20 10:42:11 +07:00
Alexey Ushakov
165ca35138 JBR-1962 Allow to change font config
-Djava2d.font.loadFontConf=true option loads .fonts.conf from user.home (if available)
2019-11-19 21:26:13 +03:00
Vitaly Provodin
18d077a5d0 updated JTreg exclude list 2019-11-19 15:52:48 +07:00
Vitaly Provodin
0dfdfde600 updated JTreg exclude list 2019-11-16 10:12:19 +07:00
Denis Konoplev
a2576ffa9a Turn off multitouch 2019-11-15 16:49:32 +03:00
Denis Konoplev
cca7fb97f4 Check XInput extension && touch inertia 2019-11-15 16:49:32 +03:00
Denis Konoplev
6dcec3dc31 Touch scroll handling 2019-11-15 16:49:32 +03:00
Denis Konoplev
588cd6ee73 XI2 Constants 2019-11-15 16:49:32 +03:00
Denis Konoplev
d6bd1bfa2b XLibWrapper XI2 functions 2019-11-15 16:49:32 +03:00
Denis Konoplev
f101bc1108 X11 native get put double 2019-11-15 16:49:32 +03:00
Denis Konoplev
9504574dbb Native data types 2019-11-15 16:49:32 +03:00
Denis Konoplev
ef108067a1 XI2 headers in xlib wrapper generator 2019-11-15 16:49:32 +03:00
Vitaly Provodin
6cc380ffb5 JBR-572: Regression test on the crash caused by the fix (clean reundant lines) 2019-11-15 12:03:50 +07:00
Vitaly Provodin
958e25ed21 JBR-572: Regression test on the crash caused by the fix (clean reundant lines) 2019-11-15 12:03:01 +07:00
Vitaly Provodin
a7de601d5f JBR-572: Regression test on the crash caused by the fix 2019-11-15 11:54:55 +07:00
Vitaly Provodin
1855de4afb updated JTreg exclude list 2019-11-15 07:06:45 +07:00
Vitaly Provodin
7ff48f638b Revert "JBR-572 In macOS 10.13 and JIS layout yen key outputs yen (¥) whatever the setting of "¥ key generates" of Keyboard Settings"
This reverts commit e1a500ba
2019-11-13 18:09:02 +07:00
Alexey Ushakov
c430a66615 JBR-1954 .AppleSystemUIFont font rendering issues still exist for non-HiDPI displays on macOS Catalina
Removed workaround for fixed JBR-226 to have correct device transform. Additional transform for font size calculation is not necessary any more.
2019-11-13 00:46:40 +03:00
Denis Fokin
6c1c66e3e7 JBR-1883 Button states are changed on Toolbar after significant delay 2019-11-12 19:43:08 +03:00
Dmitry Batrak
e1a500ba8b JBR-572 In macOS 10.13 and JIS layout yen key outputs yen (¥) whatever the setting of "¥ key generates" of Keyboard Settings
backport JDK-8214578 from OpenJDK
2019-11-08 12:44:01 +03:00
29 changed files with 492 additions and 125 deletions

View File

@@ -26,6 +26,10 @@ git clone git@github.com:JetBrains/JetBrainsRuntime.git
```
# Configure Local Build Environment
[OpenJDK build docs](http://hg.openjdk.java.net/jdk/jdk11/raw-file/tip/doc/building.html)
Tip for all platforms: run ./configure and check output.
Usually, it has meaningful advice how to solve your problem.
## Linux (docker)
```
$ cd jb/project/docker
@@ -51,7 +55,29 @@ $ make images
```
## Windows
#### TBD
Install:
* [Cygwin x64](http://www.cygwin.com/)
Required packages: autoconf, binutils, cpio, diffutils, file, gawk, gcc-core, make, m4, unzip, zip.
**Install them while installing cygwin**.
* Visual Studio compiler toolset [Download](https://visualstudio.microsoft.com/downloads/)
Visual Studio 2015 has support by default.
**Install with desktop development kit, it includes Windows SDK and compilers**.
* [Java 11](http://www.oracle.com/technetwork/java/javase/downloads/index.html)
If you have problems while configuring [read java tips on cygwin](http://horstmann.com/articles/cygwin-tips.html)
From command line
```
"c:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\vcvarsall.bat" amd64
"c:\Program_Files\cygwin64\bin\mintty.exe" /bin/bash -l
```
First command will set env vars, the second will run cygwin shell with proper environment.
In cygwin shell
```
cd JetBrainsRuntime
./configure --disable-warnings-as-errors
make images
```
## OSX

View File

@@ -2,6 +2,7 @@
# generate these charsets into sun.nio.cs
#
GBK
GB18030
Johab
MS1255
MS1256

View File

@@ -42,7 +42,7 @@ allfonts.myanmar=Myanmar Text
allfonts.dingbats=Wingdings
allfonts.symbol=Symbol
allfonts.symbols=Segoe UI Symbol
allfonts.thai=DokChampa
allfonts.thai=Tahoma
allfonts.georgian=Sylfaen
serif.plain.alphabetic=Times New Roman
@@ -50,140 +50,140 @@ serif.plain.chinese-ms950=MingLiU
serif.plain.chinese-ms950-extb=MingLiU-ExtB
serif.plain.hebrew=David
serif.plain.japanese=MS Mincho
serif.plain.korean=Batang
serif.plain.korean=Malgun Gothic
serif.bold.alphabetic=Times New Roman Bold
serif.bold.chinese-ms950=PMingLiU
serif.bold.chinese-ms950-extb=PMingLiU-ExtB
serif.bold.hebrew=David Bold
serif.bold.japanese=MS Mincho
serif.bold.korean=Batang
serif.bold.korean=Malgun Gothic
serif.italic.alphabetic=Times New Roman Italic
serif.italic.chinese-ms950=PMingLiU
serif.italic.chinese-ms950-extb=PMingLiU-ExtB
serif.italic.hebrew=David
serif.italic.japanese=MS Mincho
serif.italic.korean=Batang
serif.italic.korean=Malgun Gothic
serif.bolditalic.alphabetic=Times New Roman Bold Italic
serif.bolditalic.chinese-ms950=PMingLiU
serif.bolditalic.chinese-ms950-extb=PMingLiU-ExtB
serif.bolditalic.hebrew=David Bold
serif.bolditalic.japanese=MS Mincho
serif.bolditalic.korean=Batang
serif.bolditalic.korean=Malgun Gothic
sansserif.plain.alphabetic=Arial
sansserif.plain.chinese-ms950=MingLiU
sansserif.plain.chinese-ms950-extb=MingLiU-ExtB
sansserif.plain.hebrew=David
sansserif.plain.japanese=MS Gothic
sansserif.plain.korean=Gulim
sansserif.plain.korean=Malgun Gothic
sansserif.bold.alphabetic=Arial Bold
sansserif.bold.chinese-ms950=PMingLiU
sansserif.bold.chinese-ms950-extb=PMingLiU-ExtB
sansserif.bold.hebrew=David Bold
sansserif.bold.japanese=MS Gothic
sansserif.bold.korean=Gulim
sansserif.bold.korean=Malgun Gothic
sansserif.italic.alphabetic=Arial Italic
sansserif.italic.chinese-ms950=PMingLiU
sansserif.italic.chinese-ms950-extb=PMingLiU-ExtB
sansserif.italic.hebrew=David
sansserif.italic.japanese=MS Gothic
sansserif.italic.korean=Gulim
sansserif.italic.korean=Malgun Gothic
sansserif.bolditalic.alphabetic=Arial Bold Italic
sansserif.bolditalic.chinese-ms950=PMingLiU
sansserif.bolditalic.chinese-ms950-extb=PMingLiU-ExtB
sansserif.bolditalic.hebrew=David Bold
sansserif.bolditalic.japanese=MS Gothic
sansserif.bolditalic.korean=Gulim
sansserif.bolditalic.korean=Malgun Gothic
monospaced.plain.alphabetic=Courier New
monospaced.plain.chinese-ms950=MingLiU
monospaced.plain.chinese-ms950-extb=MingLiU-ExtB
monospaced.plain.hebrew=Courier New
monospaced.plain.japanese=MS Gothic
monospaced.plain.korean=GulimChe
monospaced.plain.korean=Malgun Gothic
monospaced.bold.alphabetic=Courier New Bold
monospaced.bold.chinese-ms950=PMingLiU
monospaced.bold.chinese-ms950-extb=PMingLiU-ExtB
monospaced.bold.hebrew=Courier New Bold
monospaced.bold.japanese=MS Gothic
monospaced.bold.korean=GulimChe
monospaced.bold.korean=Malgun Gothic
monospaced.italic.alphabetic=Courier New Italic
monospaced.italic.chinese-ms950=PMingLiU
monospaced.italic.chinese-ms950-extb=PMingLiU-ExtB
monospaced.italic.hebrew=Courier New
monospaced.italic.japanese=MS Gothic
monospaced.italic.korean=GulimChe
monospaced.italic.korean=Malgun Gothic
monospaced.bolditalic.alphabetic=Courier New Bold Italic
monospaced.bolditalic.chinese-ms950=PMingLiU
monospaced.bolditalic.chinese-ms950-extb=PMingLiU-ExtB
monospaced.bolditalic.hebrew=Courier New Bold
monospaced.bolditalic.japanese=MS Gothic
monospaced.bolditalic.korean=GulimChe
monospaced.bolditalic.korean=Malgun Gothic
dialog.plain.alphabetic=Arial
dialog.plain.chinese-ms950=MingLiU
dialog.plain.chinese-ms950-extb=MingLiU-ExtB
dialog.plain.hebrew=David
dialog.plain.japanese=MS Gothic
dialog.plain.korean=Gulim
dialog.plain.korean=Malgun Gothic
dialog.bold.alphabetic=Arial Bold
dialog.bold.chinese-ms950=PMingLiU
dialog.bold.chinese-ms950-extb=PMingLiU-ExtB
dialog.bold.hebrew=David Bold
dialog.bold.japanese=MS Gothic
dialog.bold.korean=Gulim
dialog.bold.korean=Malgun Gothic
dialog.italic.alphabetic=Arial Italic
dialog.italic.chinese-ms950=PMingLiU
dialog.italic.chinese-ms950-extb=PMingLiU-ExtB
dialog.italic.hebrew=David
dialog.italic.japanese=MS Gothic
dialog.italic.korean=Gulim
dialog.italic.korean=Malgun Gothic
dialog.bolditalic.alphabetic=Arial Bold Italic
dialog.bolditalic.chinese-ms950=PMingLiU
dialog.bolditalic.chinese-ms950-extb=PMingLiU-ExtB
dialog.bolditalic.hebrew=David Bold
dialog.bolditalic.japanese=MS Gothic
dialog.bolditalic.korean=Gulim
dialog.bolditalic.korean=Malgun Gothic
dialoginput.plain.alphabetic=Courier New
dialoginput.plain.chinese-ms950=MingLiU
dialoginput.plain.chinese-ms950-extb=MingLiU-ExtB
dialoginput.plain.hebrew=David
dialoginput.plain.japanese=MS Gothic
dialoginput.plain.korean=Gulim
dialoginput.plain.korean=Malgun Gothic
dialoginput.bold.alphabetic=Courier New Bold
dialoginput.bold.chinese-ms950=PMingLiU
dialoginput.bold.chinese-ms950-extb=PMingLiU-ExtB
dialoginput.bold.hebrew=David Bold
dialoginput.bold.japanese=MS Gothic
dialoginput.bold.korean=Gulim
dialoginput.bold.korean=Malgun Gothic
dialoginput.italic.alphabetic=Courier New Italic
dialoginput.italic.chinese-ms950=PMingLiU
dialoginput.italic.chinese-ms950-extb=PMingLiU-ExtB
dialoginput.italic.hebrew=David
dialoginput.italic.japanese=MS Gothic
dialoginput.italic.korean=Gulim
dialoginput.italic.korean=Malgun Gothic
dialoginput.bolditalic.alphabetic=Courier New Bold Italic
dialoginput.bolditalic.chinese-ms950=PMingLiU
dialoginput.bolditalic.chinese-ms950-extb=PMingLiU-ExtB
dialoginput.bolditalic.hebrew=David Bold
dialoginput.bolditalic.japanese=MS Gothic
dialoginput.bolditalic.korean=Gulim
dialoginput.bolditalic.korean=Malgun Gothic
# Search Sequences
@@ -241,7 +241,7 @@ sequence.allfonts.x-windows-874=alphabetic,thai,dingbats,symbol
sequence.fallback=symbols,\
chinese-ms950,chinese-hkscs,chinese-ms936,chinese-gb18030,\
japanese,korean,chinese-ms950-extb,chinese-ms936-extb,\
georgian,kannada,myanmar
georgian,kannada,thai,myanmar
# Exclusion Ranges
@@ -291,11 +291,8 @@ filename.MS_PMincho=MSMINCHO.TTC
filename.MS_Gothic=MSGOTHIC.TTC
filename.MS_PGothic=MSGOTHIC.TTC
filename.Gulim=gulim.TTC
filename.Batang=batang.TTC
filename.GulimChe=gulim.TTC
filename.DokChampa=dokchamp.ttf
filename.Malgun_Gothic=malgun.ttf
filename.Tahoma=tahoma.ttf
filename.Mangal=MANGAL.TTF
filename.Tunga=TUNGA.TTF
filename.Myanmar_Text=mmrtext.ttf

View File

@@ -233,7 +233,6 @@ public class LWWindowPeer
setOpaque(getTarget().isOpaque());
updateInsets(platformWindow.getInsets());
if (getSurfaceData() == null) {
replaceSurfaceData(false);
}
@@ -310,6 +309,7 @@ public class LWWindowPeer
}
}
}
updateInsets(platformWindow.getInsets());
}
@Override

View File

@@ -40,6 +40,8 @@ extern int gNumberOfButtons;
// InputEvent mask array
extern jint* gButtonDownMasks;
extern int lcdSubPixelPosSupported;
@interface AWTToolkit : NSObject { }
+ (long) getEventCount;
+ (void) eventCountPlusPlus;

View File

@@ -52,6 +52,7 @@
int gNumberOfButtons;
jint* gButtonDownMasks;
int lcdSubPixelPosSupported;
// Indicates that the app has been started with -XstartOnFirstThread
// (directly or via WebStart settings), and AWT should not run its

View File

@@ -163,7 +163,7 @@ JNF_COCOA_ENTER(env);
const CTFontRef fallback = CTS_CopyCTFallbackFontAndGlyphForJavaGlyphCode(awtFont, glyphCode, &glyph);
const CGFontRef cgFallback = CTFontCopyGraphicsFont(fallback, NULL);
if (IS_OSX_GT10_14 || CGGI_IsColorFont(cgFallback)) {
CGAffineTransform matrix = CGAffineTransformConcat(awtStrike->fAltTx, awtStrike->fFontTx);
CGAffineTransform matrix = awtStrike->fAltTx;
CGFloat fontSize = sqrt(fabs(matrix.a * matrix.d - matrix.b * matrix.c));
CTFontRef font = CTFontCreateWithGraphicsFont(cgFallback, fontSize, NULL, NULL);
CTFontGetAdvancesForGlyphs(font, kCTFontDefaultOrientation, &glyph, &advance, 1);

View File

@@ -337,7 +337,7 @@ Java_sun_java2d_opengl_CGLGraphicsConfig_getCGLConfigInfo
CFPreferencesGetAppBooleanValue(
CFSTR("CGFontRenderingFontSmoothingDisabled"),
kCFPreferencesCurrentApplication, &status);
lcdSubPixelPosSupported = YES;
if (status) {
if (fontSmoothingDisabled) {
J2dRlsTraceLn(J2D_TRACE_INFO,
@@ -355,7 +355,7 @@ Java_sun_java2d_opengl_CGLGraphicsConfig_getCGLConfigInfo
if (!status) {
smoothFonts = YES;
}
lcdSubPixelPosSupported = !smoothFonts;
if (!smoothFonts) {
J2dRlsTraceLn(J2D_TRACE_INFO,
"LCD_SHADER: disabled on macOS 10.14+ by default");

View File

@@ -50,7 +50,7 @@ BOOL postEventDuringEventSynthesis = NO;
* Subtypes of NSApplicationDefined, which are used for custom events.
*/
enum {
ExecuteBlockEvent, NativeSyncQueueEvent
ExecuteBlockEvent = 777, NativeSyncQueueEvent
};
@implementation NSApplicationAWT
@@ -366,11 +366,15 @@ untilDate:(NSDate *)expiration inMode:(NSString *)mode dequeue:(BOOL)deqFlag {
{
if ([event type] == NSApplicationDefined
&& TS_EQUAL([event timestamp], dummyEventTimestamp)
&& [event subtype] == NativeSyncQueueEvent) {
&& (short)[event subtype] == NativeSyncQueueEvent
&& [event data1] == NativeSyncQueueEvent
&& [event data2] == NativeSyncQueueEvent) {
[seenDummyEventLock lockWhenCondition:NO];
[seenDummyEventLock unlockWithCondition:YES];
} else if ([event type] == NSApplicationDefined && [event subtype] == ExecuteBlockEvent) {
} else if ([event type] == NSApplicationDefined
&& (short)[event subtype] == ExecuteBlockEvent
&& [event data1] != 0 && [event data2] == ExecuteBlockEvent) {
void (^block)() = (void (^)()) [event data1];
block();
[block release];
@@ -401,7 +405,7 @@ untilDate:(NSDate *)expiration inMode:(NSString *)mode dequeue:(BOOL)deqFlag {
context: nil
subtype: ExecuteBlockEvent
data1: encode
data2: 0];
data2: ExecuteBlockEvent];
[NSApp postEvent: event atStart: NO];
[pool drain];
@@ -419,8 +423,8 @@ untilDate:(NSDate *)expiration inMode:(NSString *)mode dequeue:(BOOL)deqFlag {
windowNumber: 0
context: nil
subtype: NativeSyncQueueEvent
data1: 0
data2: 0];
data1: NativeSyncQueueEvent
data2: NativeSyncQueueEvent];
if (useCocoa) {
[NSApp postEvent:event atStart:NO];
} else {

View File

@@ -7214,6 +7214,13 @@ public abstract class Component implements ImageObserver, MenuContainer,
: 0));
dispatchEvent(e);
}
Window window = getContainingWindow();
// window is supposed to be not a null value (addNotify)
Component mostRecentFocusOwner = KeyboardFocusManager.getMostRecentFocusOwner(window);
if (mostRecentFocusOwner != this) {
requestFocusInWindow();
}
}
}

View File

@@ -51,17 +51,25 @@ class FreetypeFontScaler extends FontScaler {
and therefore no need to load it explicitly here */
FontManagerNativeLibrary.load();
String jreFontConfName = java.security.AccessController.doPrivileged(
(PrivilegedAction<String>) () ->
"true".equals(System.getProperty(
"java2d.font.loadFontConf", "")) ?
System.getProperty("java.home", "") +
File.separator + "lib" + File.separator +
"fonts" + File.separator + "font.conf" :
null);
String fontConfName = java.security.AccessController.doPrivileged(
(PrivilegedAction<String>) () -> {
if ("true".equals(System.getProperty(
"java2d.font.loadFontConf", ""))) {
File f = new File(System.getProperty("user.home", "") +
File.separator + ".fonts.conf");
if (!f.exists()) {
f = new File(System.getProperty("java.home", "") +
File.separator + "lib" + File.separator +
"fonts" + File.separator + "font.conf");
}
return f.getAbsolutePath();
}
return null;
});
initIDs(FreetypeFontScaler.class, Toolkit.class, PhysicalFont.class,
jreFontConfName);
fontConfName);
}
private static native void initIDs(Class<?> FFS, Class<?> toolkitClass, Class<?> pfClass,

View File

@@ -1252,8 +1252,7 @@ public class SwingUtilities2 {
GraphicsConfiguration gc = c.getGraphicsConfiguration();
AffineTransform tx = (gc == null) ? null : gc.getDefaultTransform();
// [tav] workaround deadlock on MacOSX until fixed, JRE-226
if (!FontUtilities.isMacOSX && tx == null && !GraphicsEnvironment.isHeadless()) {
if (tx == null && !GraphicsEnvironment.isHeadless()) {
tx = GraphicsEnvironment
.getLocalGraphicsEnvironment()
.getDefaultScreenDevice()

View File

@@ -1027,6 +1027,10 @@ OGLTR_DrawColorGlyphNoCache(OGLContext *oglc, GlyphInfo *ginfo, jint x, jint y)
return JNI_TRUE;
}
// Control subpixel positioning for macOS 13+ grayscale glyphs
#ifdef MACOSX
extern int lcdSubPixelPosSupported;
#endif
// see DrawGlyphList.c for more on this macro...
#define FLOOR_ASSIGN(l, r) \
@@ -1079,6 +1083,8 @@ OGLTR_DrawGlyphList(JNIEnv *env, OGLContext *oglc, OGLSDOps *dstOps,
{
dstTextureID = dstOps->textureID;
}
subPixPos = lcdSubPixelPosSupported ? subPixPos : 0;
#endif
for (glyphCounter = 0; glyphCounter < totalGlyphs; glyphCounter++) {

View File

@@ -260,7 +260,7 @@ Java_sun_font_FreetypeFontScaler_initIDs(
fcConfig = (*FcInitLoadConfigAndFontsPtr)();
if (fcConfig != NULL && fontConf != NULL) {
result = (*FcConfigParseAndLoadPtr)(fcConfig, (const FcChar8 *) fontConf, FcFalse);
if (logFC) fprintf(stderr, "FC_LOG: FcConfigParseAndLoad %d \n", result);
if (logFC) fprintf(stderr, "FC_LOG: FcConfigParseAndLoad(\"%s\") %d \n", fontConf, result);
result = (*FcConfigSetCurrentPtr)(fcConfig);
if (logFC) fprintf(stderr, "FC_LOG: FcConfigSetCurrent %d \n", result);
}

View File

@@ -224,10 +224,11 @@ BOOL windowMoveLockHeld = FALSE;
AwtComponent::AwtComponent()
{
m_mouseButtonClickAllowed = 0;
m_touchDownOccurred = FALSE;
m_touchUpOccurred = FALSE;
m_touchDownPoint.x = m_touchDownPoint.y = 0;
m_touchUpPoint.x = m_touchUpPoint.y = 0;
m_isTouchScroll = FALSE;
m_touchDownPoint = {0, 0};
m_lastTouchPoint = {0, 0};
m_callbacksEnabled = FALSE;
m_hwnd = NULL;
@@ -1394,6 +1395,10 @@ void SpyWinMessage(HWND hwnd, UINT message, LPCTSTR szComment) {
#endif /* SPY_MESSAGES */
static BOOL IsMouseEventFromTouch()
{
return (::GetMessageExtraInfo() & MOUSEEVENTF_FROMTOUCH) == MOUSEEVENTF_FROMTOUCH;
}
/*
* Dispatch messages for this window class--general component
*/
@@ -1646,7 +1651,7 @@ LRESULT AwtComponent::WindowProc(UINT message, WPARAM wParam, LPARAM lParam)
window->AwtSetActiveWindow(TRUE, LOWORD(lParam)/*hittest*/);
}
mr = mrConsume;
retValue = MA_NOACTIVATE;
retValue = AwtToolkit::GetInstance().IsActiveWindowTrackingEnabled() ? MA_ACTIVATE : MA_NOACTIVATE;
break;
}
case WM_CTLCOLORMSGBOX:
@@ -1710,6 +1715,9 @@ LRESULT AwtComponent::WindowProc(UINT message, WPARAM wParam, LPARAM lParam)
case WM_MOUSEHWHEEL:
case WM_AWT_MOUSEENTER:
case WM_AWT_MOUSEEXIT:
if (IsMouseEventFromTouch()) {
break;
}
curPos = ::GetMessagePos();
POINT myPos;
myPos.x = GET_X_LPARAM(curPos);
@@ -2385,27 +2393,90 @@ void AwtComponent::WmTouch(WPARAM wParam, LPARAM lParam) {
UINT inputsCount = LOWORD(wParam);
TOUCHINPUT* pInputs = new TOUCHINPUT[inputsCount];
if (pInputs != NULL) {
if (tk.TIGetTouchInputInfo((HTOUCHINPUT)lParam, inputsCount, pInputs,
sizeof(TOUCHINPUT)) != 0) {
for (UINT i = 0; i < inputsCount; i++) {
TOUCHINPUT ti = pInputs[i];
if (ti.dwFlags & TOUCHEVENTF_PRIMARY) {
if (ti.dwFlags & TOUCHEVENTF_DOWN) {
m_touchDownPoint.x = ti.x / 100;
m_touchDownPoint.y = ti.y / 100;
::ScreenToClient(GetHWnd(), &m_touchDownPoint);
m_touchDownOccurred = TRUE;
} else if (ti.dwFlags & TOUCHEVENTF_UP) {
m_touchUpPoint.x = ti.x / 100;
m_touchUpPoint.y = ti.y / 100;
::ScreenToClient(GetHWnd(), &m_touchUpPoint);
m_touchUpOccurred = TRUE;
}
}
}
if (tk.TIGetTouchInputInfo((HTOUCHINPUT)lParam, inputsCount, pInputs,
sizeof(TOUCHINPUT)) != 0) {
for (UINT i = 0; i < inputsCount; i++) {
WmTouchHandler(pInputs[i]);
}
}
delete[] pInputs;
}
BOOL AwtComponent::IsInsideTouchClickBoundaries(POINT p)
{
return abs(p.x - m_touchDownPoint.x) <= TOUCH_MOUSE_COORDS_DELTA &&
abs(p.y - m_touchDownPoint.y) <= TOUCH_MOUSE_COORDS_DELTA;
}
POINT AwtComponent::TouchCoordsToLocal(LONG x, LONG y)
{
POINT p{TOUCH_COORD_TO_PIXEL(x), TOUCH_COORD_TO_PIXEL(y)};
::ScreenToClient(GetHWnd(), &p);
return p;
}
void AwtComponent::SendMouseWheelEventFromTouch(POINT p, jint modifiers, jint scrollType, jint pixels)
{
SendMouseWheelEvent(java_awt_event_MouseEvent_MOUSE_WHEEL, ::JVM_CurrentTimeMillis(NULL, 0),
p.x, p.y, modifiers, 0, 0, scrollType,
/*scrollAmount*/ 1, pixels,
static_cast<double>(pixels), /*msg*/ nullptr);
}
void AwtComponent::SendMouseEventFromTouch(jint id, POINT p, jint modifiers)
{
SendMouseEvent(id, ::JVM_CurrentTimeMillis(NULL, 0), p.x, p.y,
modifiers, /*clickCount*/ 1, JNI_FALSE,
java_awt_event_MouseEvent_BUTTON1,
/*msg*/ nullptr, /*causedByTouchEvent*/ TRUE);
}
void AwtComponent::WmTouchHandler(const TOUCHINPUT& touchInput)
{
// skip multitouch, remove after gesture support
if (!(touchInput.dwFlags & TOUCHEVENTF_PRIMARY)) {
return;
}
jint modifiers = GetJavaModifiers();
// turn off horizontal
modifiers &= ~java_awt_event_InputEvent_SHIFT_DOWN_MASK;
const POINT p = TouchCoordsToLocal(touchInput.x, touchInput.y);
if (touchInput.dwFlags & TOUCHEVENTF_DOWN) {
m_touchDownPoint = p;
m_lastTouchPoint = p;
m_isTouchScroll = FALSE;
} else if (touchInput.dwFlags & TOUCHEVENTF_MOVE) {
if (IsInsideTouchClickBoundaries(p)) {
return;
}
if (!m_isTouchScroll) {
SendMouseWheelEventFromTouch(p, modifiers, TOUCH_BEGIN, 1);
m_isTouchScroll = TRUE;
}
const int deltaY = ScaleDownY(static_cast<int>(m_lastTouchPoint.y - p.y));
if (abs(deltaY) != 0) {
SendMouseWheelEventFromTouch(p, modifiers, TOUCH_UPDATE, deltaY);
}
const int deltaX = ScaleDownX(static_cast<int>(m_lastTouchPoint.x - p.x));
if (abs(deltaX) != 0) {
modifiers |= java_awt_event_InputEvent_SHIFT_DOWN_MASK;
SendMouseWheelEventFromTouch(p, modifiers, TOUCH_UPDATE, deltaX);
}
m_lastTouchPoint = p;
} else if (touchInput.dwFlags & TOUCHEVENTF_UP) {
if (m_isTouchScroll) {
SendMouseWheelEventFromTouch(p, modifiers, TOUCH_END, 1);
} else {
SendMouseEventFromTouch(java_awt_event_MouseEvent_MOUSE_PRESSED, p, modifiers);
SendMouseEventFromTouch(java_awt_event_MouseEvent_MOUSE_RELEASED, p, modifiers);
SendMouseEventFromTouch(java_awt_event_MouseEvent_MOUSE_CLICKED, p, modifiers);
}
delete[] pInputs;
}
}
@@ -2451,14 +2522,6 @@ MsgRouting AwtComponent::WmMouseDown(UINT flags, int x, int y, int button)
m_mouseButtonClickAllowed |= GetButtonMK(button);
lastTime = now;
BOOL causedByTouchEvent = FALSE;
if (m_touchDownOccurred &&
(abs(m_touchDownPoint.x - x) <= TOUCH_MOUSE_COORDS_DELTA) &&
(abs(m_touchDownPoint.y - y) <= TOUCH_MOUSE_COORDS_DELTA)) {
causedByTouchEvent = TRUE;
m_touchDownOccurred = FALSE;
}
MSG msg;
InitMessage(&msg, lastMessage, flags, MAKELPARAM(x, y), x, y);
@@ -2477,7 +2540,7 @@ MsgRouting AwtComponent::WmMouseDown(UINT flags, int x, int y, int button)
SendMouseEvent(java_awt_event_MouseEvent_MOUSE_PRESSED, now, x, y,
GetJavaModifiers(), clickCount, JNI_FALSE,
GetButton(button), &msg, causedByTouchEvent);
GetButton(button), &msg, /*causedByTouchEvent*/ FALSE);
/*
* NOTE: this call is intentionally placed after all other code,
* since AwtComponent::WmMouseDown() assumes that the cached id of the
@@ -2499,21 +2562,13 @@ MsgRouting AwtComponent::WmMouseDown(UINT flags, int x, int y, int button)
MsgRouting AwtComponent::WmMouseUp(UINT flags, int x, int y, int button)
{
BOOL causedByTouchEvent = FALSE;
if (m_touchUpOccurred &&
(abs(m_touchUpPoint.x - x) <= TOUCH_MOUSE_COORDS_DELTA) &&
(abs(m_touchUpPoint.y - y) <= TOUCH_MOUSE_COORDS_DELTA)) {
causedByTouchEvent = TRUE;
m_touchUpOccurred = FALSE;
}
MSG msg;
InitMessage(&msg, lastMessage, flags, MAKELPARAM(x, y), x, y);
SendMouseEvent(java_awt_event_MouseEvent_MOUSE_RELEASED, ::JVM_CurrentTimeMillis(NULL, 0),
x, y, GetJavaModifiers(), clickCount,
(GetButton(button) == java_awt_event_MouseEvent_BUTTON3 ?
TRUE : FALSE), GetButton(button), &msg, causedByTouchEvent);
TRUE : FALSE), GetButton(button), &msg, /*causedByTouchEvent*/ FALSE);
/*
* If no movement, then report a click following the button release.
* When WM_MOUSEUP comes to a window without previous WM_MOUSEDOWN,

View File

@@ -71,6 +71,9 @@ const int X_BUTTONS = MK_XBUTTON1|MK_XBUTTON2;
// corresponding WM_LBUTTONDOWN/WM_LBUTTONUP event letting to associate these
// events, when their coordinates are slightly different.
const int TOUCH_MOUSE_COORDS_DELTA = 10;
const int TOUCH_BEGIN = 2;
const int TOUCH_UPDATE = 3;
const int TOUCH_END = 4;
// Whether to check for embedded frame and adjust location
#define CHECK_EMBEDDED 0
@@ -532,6 +535,11 @@ public:
virtual MsgRouting WmWindowPosChanging(LPARAM windowPos);
virtual MsgRouting WmWindowPosChanged(LPARAM windowPos);
virtual void WmTouch(WPARAM wParam, LPARAM lParam);
void WmTouchHandler(const TOUCHINPUT& touchInput);
BOOL IsInsideTouchClickBoundaries(POINT p);
POINT TouchCoordsToLocal(LONG x, LONG y);
void SendMouseWheelEventFromTouch(POINT p, jint modifiers, jint scrollType, jint pixels);
void SendMouseEventFromTouch(jint id, POINT p, jint modifiers);
// NB: 64-bit: vkey is wParam of the message, but other API's take
// vkey parameters of type UINT, so we do the cast before dispatching.
@@ -781,10 +789,9 @@ private:
*/
UINT m_mouseButtonClickAllowed;
BOOL m_touchDownOccurred;
BOOL m_touchUpOccurred;
BOOL m_isTouchScroll;
POINT m_touchDownPoint;
POINT m_touchUpPoint;
POINT m_lastTouchPoint;
BOOL m_bSubclassed;
BOOL m_bPauseDestroy;

View File

@@ -700,6 +700,13 @@ BOOL AwtToolkit::Initialize(BOOL localPump) {
tk.m_touchKbrdAutoShowIsEnabled = env->CallStaticBooleanMethod(
sunToolkitCls, isTouchKeyboardAutoShowEnabledMID);
BOOL tracking = FALSE;
int result = 0;
result = ::SystemParametersInfo(SPI_GETACTIVEWINDOWTRACKING, 0,
&tracking, 0);
tk.m_active_window_tracking_mode_enabled = (tracking && (result != 0));
CATCH_BAD_ALLOC_RET(FALSE);
if (tk.m_isWin8OrLater && tk.m_touchKbrdAutoShowIsEnabled) {
@@ -803,6 +810,10 @@ BOOL AwtToolkit::IsDynamicLayoutSet() {
return m_isDynamicLayoutSet;
}
BOOL AwtToolkit::IsActiveWindowTrackingEnabled() {
return m_active_window_tracking_mode_enabled;
}
BOOL AwtToolkit::IsDynamicLayoutSupported() {
// SPI_GETDRAGFULLWINDOWS is only supported on Win95 if
// Windows Plus! is installed. Otherwise, box frame resize.

View File

@@ -198,6 +198,13 @@ class CriticalSection {
#define TOUCHEVENTF_NOCOALESCE 0x0020
#define TOUCHEVENTF_PEN 0x0040
#define TOUCHEVENTF_PALM 0x0080
#define MOUSEEVENTF_FROMTOUCH 0xFF515700
/*
* Conversion of touch input coordinates to pixels
*/
#define TOUCH_COORD_TO_PIXEL(l) ((l) / 100)
#endif
/************************************************************************
@@ -233,6 +240,7 @@ public:
void SetDynamicLayout(BOOL dynamic);
BOOL IsDynamicLayoutSet();
BOOL IsDynamicLayoutSupported();
BOOL IsActiveWindowTrackingEnabled();
BOOL IsDynamicLayoutActive();
BOOL areExtraMouseButtonsEnabled();
void setExtraMouseButtonsEnabled(BOOL enable);
@@ -470,6 +478,7 @@ private:
BOOL m_isActive; // set to FALSE at beginning of Dispose
BOOL m_isDisposed; // set to TRUE at end of Dispose
BOOL m_areExtraMouseButtonsEnabled;
BOOL m_active_window_tracking_mode_enabled;
typedef BOOL (WINAPI *RegisterTouchWindowFunc)(HWND hWnd, ULONG ulFlags);
typedef BOOL (WINAPI *GetTouchInputInfoFunc)(HTOUCHINPUT hTouchInput,

View File

@@ -1179,6 +1179,9 @@ AwtWindow* AwtWindow::Create(jobject self, jobject parent)
if (env->ExceptionCheck()) goto done;
DWORD style = WS_CLIPCHILDREN | WS_POPUP;
DWORD exStyle = WS_EX_NOACTIVATE;
if (JNU_CallMethodByName(env, NULL, target, "isIgnoreMouseEvents", "()Z").z) {
exStyle |= WS_EX_LAYERED | WS_EX_TRANSPARENT;
}
if (GetRTL()) {
exStyle |= WS_EX_RIGHT | WS_EX_LEFTSCROLLBAR;
if (GetRTLReadingOrder())

View File

@@ -38,7 +38,7 @@
#
#############################################################################
applications/jcstress/acqrel/Test.java generic-all
applications/jcstress/acqrel/Test.java - generic-all
# :hotspot_compiler
@@ -47,6 +47,7 @@ compiler/codecache/stress/OverloadCompileQueueTest.java
compiler/codegen/Test6896617.java 8193479 generic-all
compiler/codegen/aes/TestCipherBlockChainingEncrypt.java 8219513 generic-all
compiler/compilercontrol/jcmd/ClearDirectivesFileStackTest.java 8140405 generic-all
compiler/intrinsics/sha/sanity/TestSHA512MultiBlockIntrinsics.java 8209459 linux-aarch64
compiler/jsr292/ContinuousCallSiteTargetChange.java 8222030 generic-all
compiler/jvmci/compilerToVM/GetFlagValueTest.java 8204459 generic-all
compiler/jvmci/compilerToVM/GetResolvedJavaTypeTest.java 8158860 generic-all
@@ -56,6 +57,7 @@ compiler/types/correctness/CorrectnessTest.java
compiler/types/correctness/OffTest.java 8066173 generic-all
compiler/c2/Test6852078.java 8194310 generic-all
compiler/c2/Test6857159.java 8234290 generic-all
applications/ctw/modules/java_desktop.java 8189604 windows-all
applications/ctw/modules/java_desktop_2.java 8189604,8204842 generic-all
@@ -89,11 +91,15 @@ runtime/SelectionResolution/InvokeVirtualSuccessTest.java
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
runtime/modules/ModuleStress/ExportModuleStressTest.java 8230055 windows-all
runtime/modules/ModuleStress/ModuleStressGC.java 8230055 windows-all
#############################################################################
# :hotspot_serviceability
serviceability/logging/TestQuotedLogOutputs.java 8224505 windows-all
serviceability/sa/ClhsdbAttach.java 8193639 solaris-all
serviceability/sa/ClhsdbCDSCore.java 8207832 linux-all,generic-all crash is the expected behaviour
serviceability/sa/ClhsdbCDSJstackPrintAll.java 8193639 solaris-all
@@ -205,29 +211,33 @@ vmTestbase/nsk/jvmti/IterateThroughHeap/filter-untagged/TestDescription.java
vmTestbase/nsk/sysdict/vm/stress/chain/chain007/chain007.java JRE-1282 macosx-10.13
vmTestbase/gc/lock/jni/jnilock002/TestDescription.java 8208243,8192647 generic-all
vmTestbase/gc/lock/jni/jnilock002/TestDescription.java 8208243,8192647 generic-all
vmTestbase/jit/escape/LockCoarsening/LockCoarsening001/TestDescription.java 8148743 generic-all
vmTestbase/jit/escape/LockCoarsening/LockCoarsening002/TestDescription.java 8208259 generic-all
vmTestbase/jit/escape/LockCoarsening/LockCoarsening001/TestDescription.java 8148743 generic-all
vmTestbase/jit/escape/LockCoarsening/LockCoarsening002/TestDescription.java 8208259 generic-all
vmTestbase/vm/mlvm/indy/func/jvmti/redefineClassInBootstrap/TestDescription.java 8013267 generic-all
vmTestbase/vm/mlvm/indy/stress/java/relinkMutableCallSite/Test.java 8079664 generic-all
vmTestbase/vm/mlvm/indy/stress/java/relinkVolatileCallSite/Test.java 8079664 generic-all
vmTestbase/vm/mlvm/meth/func/java/throwException/Test.java 8208255 generic-all
vmTestbase/vm/mlvm/meth/func/jdi/breakpointOtherStratum/Test.java 8208257,8208255 generic-all
vmTestbase/vm/mlvm/meth/stress/compiler/deoptimize/Test.java 8079642,8208255 generic-all
vmTestbase/vm/mlvm/meth/stress/compiler/i2c_c2i/Test.java 8208255 generic-all
vmTestbase/vm/mlvm/meth/stress/compiler/sequences/Test.java 8208255 generic-all
vmTestbase/vm/mlvm/meth/stress/gc/callSequencesDuringGC/Test.java 8208255 generic-all
vmTestbase/vm/mlvm/meth/stress/java/sequences/Test.java 8208255 generic-all
vmTestbase/vm/mlvm/meth/stress/jdi/breakpointInCompiledCode/Test.java 8208255 generic-all
vmTestbase/vm/mlvm/mixed/stress/java/findDeadlock/TestDescription.java 8208278 generic-all
vmTestbase/vm/mlvm/mixed/stress/regression/b6969574/INDIFY_Test.java 8079650 generic-all
vmTestbase/vm/mlvm/indy/func/jvmti/mergeCP_indy2none_a/TestDescription.java 8013267 generic-all
vmTestbase/vm/mlvm/indy/func/jvmti/mergeCP_indy2manyDiff_b/TestDescription.java 8013267 generic-all
vmTestbase/vm/mlvm/indy/func/jvmti/mergeCP_indy2manySame_b/TestDescription.java 8013267 generic-all
vmTestbase/vm/mlvm/indy/func/jvmti/redefineClassInBootstrap/TestDescription.java 8013267 generic-all
vmTestbase/vm/mlvm/indy/stress/java/relinkMutableCallSite/Test.java 8079664 generic-all
vmTestbase/vm/mlvm/indy/stress/java/relinkVolatileCallSite/Test.java 8079664 generic-all
vmTestbase/vm/mlvm/cp/stress/classfmt/correctBootstrap/TestDescription.java 8231169 linux-aarch64
vmTestbase/vm/mlvm/cp/stress/classfmt/mh/TestDescription.java 8231169 linux-aarch64
vmTestbase/vm/mlvm/meth/stress/gc/createLotsOfMHConsts/Test.java 8231169 linux-aarch64
vmTestbase/vm/mlvm/meth/func/java/throwException/Test.java 8208255 generic-all
vmTestbase/vm/mlvm/meth/func/jdi/breakpointOtherStratum/Test.java 8208257,8208255 generic-all
vmTestbase/vm/mlvm/meth/stress/compiler/deoptimize/Test.java 8079642,8208255 generic-all
vmTestbase/vm/mlvm/meth/stress/compiler/i2c_c2i/Test.java 8208255 generic-all
vmTestbase/vm/mlvm/meth/stress/compiler/sequences/Test.java 8208255 generic-all
vmTestbase/vm/mlvm/meth/stress/gc/callSequencesDuringGC/Test.java 8208255 generic-all
vmTestbase/vm/mlvm/meth/stress/java/sequences/Test.java 8208255 generic-all
vmTestbase/vm/mlvm/meth/stress/jdi/breakpointInCompiledCode/Test.java 8208255 generic-all
vmTestbase/vm/mlvm/mixed/stress/java/findDeadlock/TestDescription.java 8208278 generic-all
vmTestbase/vm/mlvm/mixed/stress/regression/b6969574/INDIFY_Test.java 8079650 generic-all
vmTestbase/vm/mlvm/indy/func/jvmti/mergeCP_indy2none_a/TestDescription.java 8013267 generic-all
vmTestbase/vm/mlvm/indy/func/jvmti/mergeCP_indy2manyDiff_b/TestDescription.java 8013267 generic-all
vmTestbase/vm/mlvm/indy/func/jvmti/mergeCP_indy2manySame_b/TestDescription.java 8013267 generic-all
vmTestbase/nsk/jdb/exclude/exclude001/exclude001.java 8197938 windows-all
vmTestbase/nsk/jdb/exclude/exclude001/exclude001.java 8197938 windows-all
vmTestbase/nsk/jdb/unwatch/unwatch002/unwatch002.java.unwatch002 8208471 windows-all
vmTestbase/nsk/jdwp/ThreadReference/ForceEarlyReturn/forceEarlyReturn001/forceEarlyReturn001.java 7199837 generic-all

View File

@@ -0,0 +1,62 @@
/*
* Copyright (c) 2019, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
import java.awt.EventQueue;
import java.awt.FileDialog;
import java.awt.Frame;
import java.awt.Robot;
import java.awt.event.KeyEvent;
/**
* @test
* @key headful
* @bug 8234522
* @requires (os.family == "mac")
*/
public final class MacOSGoToFolderCrash {
public static void main(final String[] args) throws Exception {
EventQueue.invokeLater(() -> {
FileDialog fd = new FileDialog((Frame) null);
fd.setVisible(true);
});
Robot robot = new Robot();
robot.setAutoDelay(400);
robot.waitForIdle();
// "⌘+Shift+G" Open "Go To Folder" window
robot.keyPress(KeyEvent.VK_META);
robot.keyPress(KeyEvent.VK_SHIFT);
robot.keyPress(KeyEvent.VK_G);
robot.keyRelease(KeyEvent.VK_G);
robot.keyRelease(KeyEvent.VK_SHIFT);
robot.keyRelease(KeyEvent.VK_META);
// Select something
robot.keyPress(KeyEvent.VK_DOWN);
robot.keyRelease(KeyEvent.VK_DOWN);
robot.keyPress(KeyEvent.VK_ENTER);
robot.keyRelease(KeyEvent.VK_ENTER);
// Close File dialog
robot.keyPress(KeyEvent.VK_ESCAPE);
robot.keyRelease(KeyEvent.VK_ESCAPE);
}
}

View File

@@ -0,0 +1,62 @@
/*
* Copyright 2000-2019 JetBrains s.r.o.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import javax.swing.*;
import java.awt.*;
import java.awt.event.KeyEvent;
public class KeyboardLayoutSwitchTest implements Runnable {
private static Robot robot;
private JFrame frame;
public static void main(String[] args) throws Exception {
System.out.println("VK_TAB = " + KeyEvent.VK_TAB);
robot = new Robot();
robot.setAutoDelay(50);
KeyboardLayoutSwitchTest test = new KeyboardLayoutSwitchTest();
SwingUtilities.invokeAndWait(test);
robot.delay(3000);
try {
SwingUtilities.invokeAndWait(() ->
pressCtrlKey(KeyEvent.VK_TAB));
} finally {
SwingUtilities.invokeAndWait(() -> test.frame.dispose());
robot.delay(2000);
}
System.out.println("Test PASSED");
}
private static void pressCtrlKey(int vk) {
robot.keyPress(KeyEvent.VK_CONTROL);
robot.keyPress(vk);
robot.keyRelease(vk);
robot.keyRelease(KeyEvent.VK_CONTROL);
}
@Override
public void run() {
frame = new JFrame(getClass().getSimpleName());
frame.pack();
frame.setDefaultCloseOperation(WindowConstants.DISPOSE_ON_CLOSE);
frame.setLocationRelativeTo(null);
frame.setVisible(true);
frame.toFront();
}
}

View File

@@ -0,0 +1,71 @@
#!/bin/bash
#
# Copyright 2000-2019 JetBrains s.r.o.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
# @test
# @summary KeyboardLayoutSwitchTest.sh checks memory leaks
# @run shell KeyboardLayoutSwitchTest.sh
OS=`uname -s`
case "$OS" in
Darwin)
echo "Detected OS $OS"
;;
* )
echo "PASSED: The test is valid for MacOSX"
exit 0;
;;
esac
if [ -z "${TESTSRC}" ]; then
echo "TESTSRC undefined: set to ."
TESTSRC=.
fi
if [ -z "${TESTCLASSES}" ]; then
echo "TESTCLASSES undefined: set to ."
TESTCLASSES=.
fi
if [ -z "${TESTJAVA}" ]; then
echo "TESTJAVA undefined: testing cancelled"
exit 1
fi
cd ${TESTSRC}
//${TESTJAVA}/bin/javac -d ${TESTCLASSES} AppleSymbolicHotKeysReader.java
${TESTJAVA}/bin/javac -d ${TESTCLASSES} KeyboardLayoutSwitchTest.java
echo "reading current hot keys"
oldKeyValue=$(defaults read "com.apple.symbolichotkeys" | grep -A10 " 60 =" | sed '$d' | sed '1d' | tr -d '\r\n' | tr -s ' ' | sed s/standard/\'standard\'/)
defaults write com.apple.symbolichotkeys AppleSymbolicHotKeys -dict-add 60 "{ enabled = 1; value = { parameters = ( 65535, 48, 262144 ); type = 'standard'; };}"
${TESTJAVA}/bin/java -cp ${TESTCLASSES} KeyboardLayoutSwitchTest
exit_code=$?
defaults write com.apple.symbolichotkeys AppleSymbolicHotKeys -dict-add 60 "$oldKeyValue"
case $exit_code in
0) echo "PASSED"
;;
*) echo "FAILED"
exit 1
;;
esac
exit 0

View File

@@ -591,7 +591,7 @@ java/awt/Window/8159168/SetShapeTest.java
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/MultiWindowApp/ChildAlwaysOnTopTest.java 8215132,8194941 macosx-all,windows-all,linux-all
java/awt/Window/MultiWindowApp/MultiWindowAppTest.java 8159904 macosx-all,windows-all
java/awt/Window/MultiWindowApp/MultiWindowAppTest.java 8159904 macosx-all,windows-all,linux-all
java/awt/Window/ShapedAndTranslucentWindows/FocusAWTTest.java 8061236 macosx-all,windows-all,linux-all
java/awt/Window/ShapedAndTranslucentWindows/SetShape.java 8208509 macosx-all,windows-all,linux-all
java/awt/Window/ShapedAndTranslucentWindows/SetShapeAndClick.java 8197936 macosx-all,windows-all,linux-4.18.16-200.fc28.x86_64,linux-all (linux-all timeout reproduced with Adopt)
@@ -620,12 +620,13 @@ java/awt/dnd/DisposeFrameOnDragCrash/DisposeFrameOnDragTest.java
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/FileListBetweenJVMsTest/FileListBetweenJVMsTest.html 7124379,7188825 macosx-all,linux-all,windows-all
java/awt/dnd/ImageTransferTest/ImageTransferTest.java 8176556 generic-all
java/awt/dnd/InterJVMGetDropSuccessTest/InterJVMGetDropSuccessTest.html
java/awt/dnd/InterJVMGetDropSuccessTest/InterJVMGetDropSuccessTest.html 8208555 windows-all
java/awt/dnd/MissingDragExitEventTest/MissingDragExitEventTest.java 8030121 macosx-all,windows-all,linux-all
java/awt/dnd/MissingEventsOnModalDialog/MissingEventsOnModalDialogTest.java 8164464 linux-all,macosx-all,windows-all
java/awt/dnd/NoFormatsCrashTest/NoFormatsCrashTest.html 8214221 windows-all,linux-all,macosx-all
java/awt/dnd/URIListBetweenJVMsTest/URIListBetweenJVMsTest.html 8171510 macosx-all
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/HierarchyEvent/AncestorResized/AncestorResized.java 6618538 generic-all
@@ -760,6 +761,7 @@ javax/management/remote/mandatory/notif/NotifReconnectDeadlockTest.java
# jdk_net
java/net/CookieHandler/B6791927.java 8234007 generic-all
java/net/MulticastSocket/NoLoopbackPackets.java 7122846 macosx-all
java/net/MulticastSocket/SetLoopbackMode.java 7122846 macosx-all
java/net/MulticastSocket/Test.java 7145658,8207404 macosx-all,aix-all
@@ -770,6 +772,8 @@ java/net/DatagramSocket/SendDatagramToBadAddress.java
java/net/httpclient/ProxyAuthDisabledSchemesSSL.java 8212695 macosx-all
java/net/httpclient/UnknownBodyLengthTest.java 8210130 macosx-all,windows-all
javax/net/ssl/SSLSocket/Tls13PacketSize.java 8224829 windows-all
com/sun/net/httpserver/bugs/B6361557.java 8196070 windows-all
sun/net/www/protocol/jar/jarbug/TestDriver.java nobug windows-6.1 fails on Windows 7 only
@@ -946,7 +950,7 @@ javax/swing/JSplitPane/4201995/bug4201995.java
javax/swing/JSplitPane/4885629/bug4885629.java 8019935,8194941 macosx-all,linux-all,windows-all (windows: commit testing)
javax/swing/JTabbedPane/4361477/bug4361477.java 8170260 macosx-all,windows-all
javax/swing/JTabbedPane/4624207/bug4624207.java 8197552,8064922 macosx-all,windows-all,linux-all
javax/swing/JTabbedPane/7024235/Test7024235.java 8028281 macosx-all
javax/swing/JTabbedPane/7024235/Test7024235.java 8028281,JBR-1977 macosx-all,linux-aarch64
javax/swing/JTabbedPane/8007563/Test8007563.java 8051591 generic-all
javax/swing/JTable/4235420/bug4235420.java 8079127 generic-all
javax/swing/JTable/6263446/bug6263446.java 8169959 macosx-all,windows-all
@@ -1168,3 +1172,26 @@ tools/jlink/plugins/IncludeLocalesPluginTest.java
tools/jlink/plugins/SystemModuleDescriptors/CompiledVersionTest.java nobug windows-6.1 fails on Windows 7 only
tools/jlink/plugins/SystemModuleDescriptors/UserModuleTest.java nobug windows-6.1 fails on Windows 7 only
tools/launcher/modules/patch/systemmodules/PatchSystemModules.java nobug windows-6.1 fails on Windows 7 only
# aarch64: GTK look and feel - not supported
java/awt/Component/DimensionEncapsulation/DimensionEncapsulation.java JBR-1977 linux-aarch64
java/awt/Component/InsetsEncapsulation/InsetsEncapsulation.java JBR-1977 linux-aarch64
javax/swing/JColorChooser/Test6707406.java JBR-1977 linux-aarch64
javax/swing/JFileChooser/8013442/Test8013442.java JBR-1977 linux-aarch64
javax/swing/JInternalFrame/4769772/TestJInternalFrameIconify.java JBR-1977 linux-aarch64
javax/swing/JInternalFrame/8075314/bug8075314.java JBR-1977 linux-aarch64
javax/swing/JInternalFrame/NormalBoundsTest.java JBR-1977 linux-aarch64
javax/swing/JList/BasicListTest.java JBR-1977 linux-aarch64
javax/swing/JList/ListSelectionModelTest.java JBR-1977 linux-aarch64
javax/swing/JMenuBar/MisplacedBorder/MisplacedBorder.java JBR-1977 linux-aarch64
javax/swing/JMenuItem/8158566/CloseOnMouseClickPropertyTest.java JBR-1977 linux-aarch64
javax/swing/JRootPane/SilenceOfDeprecatedMenuBar/SilenceOfDeprecatedMenuBar.java JBR-1977 linux-aarch64
javax/swing/JScrollBar/7163696/Test7163696.java JBR-1977 linux-aarch64
javax/swing/JSlider/6794831/bug6794831.java JBR-1977 linux-aarch64
javax/swing/JSpinner/WrongEditorTextFieldFont/FontByDefault.java JBR-1977 linux-aarch64
javax/swing/JSpinner/WrongEditorTextFieldFont/FontSetByUser.java JBR-1977 linux-aarch64
javax/swing/JSpinner/WrongEditorTextFieldFont/FontSetToNull.java JBR-1977 linux-aarch64
javax/swing/JTextArea/4697612/bug4697612.java JBR-1977 linux-aarch64
javax/swing/LookAndFeel/8145547/DemandGTK.java JBR-1977 linux-aarch64
javax/swing/LookAndFeel/8146276/NimbusGlueTest.java JBR-1977 linux-aarch64
sanity/client/SwingSet/src/GridBagLayoutDemoTest.java JBR-1977 linux-aarch64

View File

@@ -52,7 +52,7 @@ java/awt/KeyboardFocusmanager/TypeAhead/EnqueueWithDialogTest/EnqueueWithDialogT
java/awt/KeyboardFocusmanager/TypeAhead/MenuItemActivatedTest/MenuItemActivatedTest.html nobug windows-all reproduced with Adopt
java/awt/LightweightDispatcher/LWDispatcherMemoryLeakTest.java nobug windows-all
java/awt/List/ActionAfterRemove/ActionAfterRemove.java nobug windows-all
java/awt/List/ActionEventTest/ActionEventTest.java nobug linux-all
java/awt/List/ActionEventTest/ActionEventTest.java nobug generic-all timeout
java/awt/List/EmptyListEventTest/EmptyListEventTest.java nobug windows-all
java/awt/List/ItemEventTest/ItemEventTest.java nobug macosx-all,windows-all
java/awt/List/NofocusListDblClickTest/NofocusListDblClickTest.java nobug macosx-all,windows-all
@@ -104,6 +104,7 @@ java/awt/Window/SetWindowLocationByPlatformTest/SetWindowLocationByPlatformTest.
java/awt/Window/ShapedAndTranslucentWindows/Translucent.java nobug windows-all,macosx-all
java/awt/Window/ShapedAndTranslucentWindows/WindowOpacity.java nobug windows-all
java/awt/Window/TopLevelLocation/TopLevelLocation.java nobug linux-all,macosx-all
java/awt/Window/WindowDeadlockTest/WindowDeadlockTest.java nobug macosx-all timeout
java/awt/Window/WindowOwnedByEmbeddedFrameTest/WindowOwnedByEmbeddedFrameTest.java nobug macosx-all
java/awt/Window/WindowResizing/DoubleClickTitleBarTest.java nobug macosx-all
java/awt/datatransfer/Independence/IndependenceAWTTest.java nobug linux-all
@@ -111,11 +112,9 @@ java/awt/datatransfer/MissedHtmlAndRtfBug/MissedHtmlAndRtfBug.html
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/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
java/awt/dnd/RecognizedActionTest/RecognizedActionTest.java nobug macosx-all,windows-all,linux-all
java/awt/dnd/RemoveDropTargetCrashTest/RemoveDropTargetCrashTest.java nobug macosx-all,windows-all
java/awt/dnd/URIListBetweenJVMsTest/URIListBetweenJVMsTest.html nobug macosx-all,linux-all
java/awt/event/KeyEvent/AltCharAcceleratorTest/AltCharAcceleratorTest.java nobug macosx-all,windows-all,linux-all
java/awt/event/KeyEvent/DeadKey/DeadKeyMacOSXInputText.java nobug macosx-all
java/awt/event/KeyEvent/DeadKey/deadKeyMacOSX.java nobug macosx-all
@@ -184,7 +183,7 @@ javax/swing/JPopupMenu/6827786/bug6827786.java
javax/swing/JProgressBar/8015748/JProgressBarOrientationRobotTest.java nobug macosx-all,windows-all
javax/swing/JRadioButton/8041561/bug8041561.java nobug windows-all
javax/swing/JScrollBar/7163696/Test7163696.java nobug windows-all
javax/swing/JScrollBar/bug4202954/bug4202954.java nobug windows-all
javax/swing/JScrollBar/bug4202954/bug4202954.java nobug generic-all timeout
javax/swing/JSlider/6401380/bug6401380.java nobug windows-all
javax/swing/JTabbedPane/7161568/bug7161568.java nobug windows-all,linux-all
javax/swing/JTabbedPane/7170310/bug7170310.java nobug macosx-all,linux-all