Compare commits

..

12 Commits

Author SHA1 Message Date
Alexey Ushakov
6d6de1034a JBR-3827 SIGILL at [libsystem_kernel] __kill in Java Exception at -[CDragSource convertData:]
Added check for drag source
2022-03-18 18:36:10 +01:00
Vitaly Provodin
2333999906 JBR-4303 add a regression test
(cherry picked from commit bc7cb5711b)
2022-03-18 09:50:29 +07:00
Alexey Ushakov
6ffcd2bf91 JBR-3366 SIGILL at [libsystem_kernel] __kill in NSWindowStyleMaskFullScreen cleared on a window outside of a full screen transition
Wrapped the native exception and added logging
2022-03-17 18:09:49 +01:00
Artem Semenov
822b4a8c49 JBR-4235 Context menu not readable after opening on Mac OS 2022-03-17 16:34:39 +03:00
Dmitry Batrak
debc6336c0 JBR-4314 2022.1 EAP version's JBR use incorrect fallback font to render Chinese characters in macOS
(cherry picked from commit 82048d1d73)
2022-03-17 15:15:34 +03:00
Mikhail Grishchenko
1f93154f62 JBR-3975 add PASSED message in check_jbr_size.sh 2022-03-17 03:35:05 +07:00
Mikhail Grishchenko
9f069ca59e JBR-3975 Fix regexp in check_jbr_size.sh
(cherry picked from commit 23131fc435)
2022-03-17 01:45:51 +07:00
Vladimir Kempik
53f1a647fd JBR-4309: jdk/tools/launcher/modules/illegalaccess/IllegalAccessTest.java fails after JBR-4291 2022-03-14 11:27:16 +03:00
Alexander Lobas
7d31563471 JBR-4305 (#119)
* IDEA-283934 Top panel (toolbar, Editor tabs) hides under the Mac menu in full-screen mode

* IDEA-283934 Top panel (toolbar, Editor tabs) hides under the Mac menu in full-screen mode

* JBR-4305 IDEA-283934 Top panel (toolbar, Editor tabs) hides under the Mac menu in full-screen mode

* JBR-4305 IDEA-283934 Top panel (toolbar, Editor tabs) hides under the Mac menu in full-screen mode
2022-03-10 20:23:11 +01:00
Alexey Ushakov
36ded60698 JBR-3365 SIGILL at [libsystem_kernel] __kill in java.lang.RuntimeException: Failed to convert, no screen / primaryScreen
Wrapped the native exception and added logging
2022-03-10 14:28:18 +01:00
Dmitry Batrak
d53de90f8a JBR-3751 Window content isn't rendered with some window managers on Linux
(cherry picked from commit 8d22e4dcb0)
2022-03-09 13:40:40 +03:00
VladimirKempik
6196076b95 JBR-4291: Ability to ignore all add-opens 2022-03-04 15:05:43 +03:00
11 changed files with 203 additions and 28 deletions

View File

@@ -25,16 +25,39 @@ case "${unameOut}" in
echo "Unknown machine: ${unameOut}"
exit 1
esac
FILENAME=$(basename ${NEWFILEPATH})
#
# Get pattern of artifact name
# Base filename pattern: <BUNDLE_TYPE>-<JDK_VERSION>-<OS>-<ARCH>-b<BUILD>.tar.gz: jbr_dcevm-17.0.2-osx-x64-b1234.tar.gz
# BUNDLE_TYPE: jbr, jbrsdk, jbr_dcevm, jbrsdk_jcef etc.
# OS_ARCH_PATTERN - <os_architecture>: osx-x64, linux-aarch64, windows-x64 etc.
echo "New size of $NEWFILEPATH = $NEWFILESIZE bytes."
BUNDLE_TYPE=jbrsdk
OS_ARCH_PATTERN=""
re='(jbr[a-z_]*).+[0-9_]+-(.+)-b.+\.tar\.gz'
if [[ $FILENAME =~ $re ]]; then
BUNDLE_TYPE=${BASH_REMATCH[1]}
OS_ARCH_PATTERN=${BASH_REMATCH[2]}
fi
echo "BUNDLE_TYPE: " $BUNDLE_TYPE
echo "OS_ARCH_PATTERN: " $OS_ARCH_PATTERN
echo "New size of $FILENAME = $NEWFILESIZE bytes."
# example: IntellijCustomJdk_Jdk17_Master_LinuxX64jcef
#
# Get previous successful build ID
# Example:
# CONFIGID=IntellijCustomJdk_Jdk17_Master_LinuxX64jcef
# BUILDID=12345678
#
# expected return value
# id="123".number="567"
#
CURL_RESPONSE=$(curl --header "Authorization: Bearer $TOKEN" "https://buildserver.labs.intellij.net/app/rest/builds/?locator=buildType:(id:$CONFIGID),status:success,count:1,finishDate:(build:$BUILDID,condition:before)")
re='id=\"([0-9]+)\".+number=\"([0-9\.]+)\"'
re='id=\"([0-9]+)\".+number=\"([0-9]+)\"'
# ID: Previous successful build id
ID=0
if [[ $CURL_RESPONSE =~ $re ]]; then
ID=${BASH_REMATCH[1]}
echo "BUILD Number: ${BASH_REMATCH[2]}"
@@ -44,13 +67,18 @@ else
exit 1
fi
#
# Get artifacts from previous successful build
#
# expected return value
# name="jbrsdk_jcef*.tar.gz size="123'
#
CURL_RESPONSE=$(curl --header "Authorization: Bearer $TOKEN" "https://buildserver.labs.intellij.net/app/rest/builds/$ID?fields=id,number,artifacts(file(name,size))")
echo "Atrifacts of last pinned build of $CONFIGID :\n"
echo "Atrifacts of previous build of $CONFIGID :"
echo $CURL_RESPONSE
# Find size (in response) with reg exp
re='name=\"(jbrsdk_jcef[^\"]+\.tar\.gz)\" size=\"([0-9]+)\"'
# Find binary size (in response) with reg exp
re='name=\"('$BUNDLE_TYPE'[^\"]+'${OS_ARCH_PATTERN}'[^\"]+\.tar\.gz)\" size=\"([0-9]+)\"'
if [[ $CURL_RESPONSE =~ $re ]]; then
OLDFILENAME=${BASH_REMATCH[1]}
@@ -63,6 +91,8 @@ if [[ $CURL_RESPONSE =~ $re ]]; then
if [[ "$NEWFILESIZE" -gt "$allowedSize" ]]; then
echo "ERROR: new size is significally greater than prev size (need to investigate)"
exit 1
else
echo "PASSED"
fi
else
echo "ERROR: can't find string with size in xml response:"

View File

@@ -2501,6 +2501,10 @@ jint Arguments::parse_each_vm_init_arg(const JavaVMInitArgs* args, bool* patch_m
if (res != JNI_OK) {
return res;
}
} else if (match_option(option, "--illegal-access=", &tail)) {
char version[256];
JDK_Version::jdk(17).to_string(version, sizeof(version));
warning("Ignoring option %s; support was removed in %s", option->optionString, version);
} else if (match_option(option, "--jbr-illegal-access", &tail)) {
warning("Option --jbr-illegal-access is deprecated and will be removed in a future release.");
if (!create_module_property("jdk.module.illegalAccess", "permit", ExternalProperty)) {

View File

@@ -205,6 +205,7 @@ class CAccessible extends CFRetainedResource implements Accessible {
} else if (oldValue != null &&
((AccessibleState) oldValue) == AccessibleState.VISIBLE) {
execute(ptr -> menuClosed(ptr));
execute(ptr -> unregisterFromCocoaAXSystem(ptr));
}
} else if (thisRole == AccessibleRole.MENU_ITEM) {
if (newValue != null &&

View File

@@ -106,6 +106,7 @@ public class CPlatformWindow extends CFRetainedResource implements PlatformWindo
private static native boolean nativeDelayShowing(long nsWindowPtr);
private static native void nativeRaiseLevel(long nsWindowPtr, boolean popup, boolean onlyIfParentIsActive);
private static native void nativeSetTransparentTitleBarHeight(long nsWindowPtr, float height);
private static native void nativeCallDeliverMoveResizeEvent(long nsWindowPtr);
// Loger to report issues happened during execution but that do not affect functionality
private static final PlatformLogger logger = PlatformLogger.getLogger("sun.lwawt.macosx.CPlatformWindow");
@@ -1196,6 +1197,10 @@ public class CPlatformWindow extends CFRetainedResource implements PlatformWindo
responder.handleWindowFocusEvent(gained, oppositePeer);
}
public void doDeliverMoveResizeEvent() {
execute(ptr -> nativeCallDeliverMoveResizeEvent(ptr));
}
protected void deliverMoveResizeEvent(int x, int y, int width, int height,
boolean byUser) {
AtomicBoolean ref = new AtomicBoolean();

View File

@@ -776,7 +776,7 @@ AWT_ASSERT_APPKIT_THREAD;
// NSWindowDelegate methods
- (void) _deliverMoveResizeEvent {
AWT_ASSERT_APPKIT_THREAD;
AWT_ASSERT_APPKIT_THREAD;
// deliver the event if this is a user-initiated live resize or as a side-effect
// of a Java initiated resize, because AppKit can override the bounds and force
@@ -785,10 +785,18 @@ AWT_ASSERT_APPKIT_THREAD;
JNIEnv *env = [ThreadUtilities getJNIEnv];
jobject platformWindow = (*env)->NewLocalRef(env, self.javaPlatformWindow);
if (platformWindow == NULL) {
// TODO: create generic AWT assert
NSLog(@"[AWTWindow _deliverMoveResizeEvent]: platformWindow == NULL");
return;
}
NSRect frame;
@try {
frame = ConvertNSScreenRect(env, [self.nsWindow frame]);
} @catch (NSException *e) {
NSLog(@"WARNING: suppressed exception from ConvertNSScreenRect() in [AWTWindow _deliverMoveResizeEvent]");
NSProcessInfo *processInfo = [NSProcessInfo processInfo];
[NSApplicationAWT logException:e forProcess:processInfo];
return;
}
NSRect frame = ConvertNSScreenRect(env, [self.nsWindow frame]);
GET_CPLATFORM_WINDOW_CLASS();
DECLARE_METHOD(jm_deliverMoveResizeEvent, jc_CPlatformWindow, "deliverMoveResizeEvent", "(IIIIZ)V");
@@ -1645,7 +1653,15 @@ JNI_COCOA_ENTER(env);
// resets the NSWindow's style mask if the mask intersects any of those bits
if (mask & MASK(_STYLE_PROP_BITMASK)) {
[nsWindow setStyleMask:[AWTWindow styleMaskForStyleBits:newBits]];
NSWindowStyleMask styleMask = [AWTWindow styleMaskForStyleBits:newBits];
@try {
[nsWindow setStyleMask:styleMask];
} @catch (NSException *e) {
NSLog(@"WARNING: suppressed exception from [NSWindow setStyleMask] in CPlatformWindow"
".nativeSetNSWindowStyleBits");
NSProcessInfo *processInfo = [NSProcessInfo processInfo];
[NSApplicationAWT logException:e forProcess:processInfo];
}
}
// calls methods on NSWindow to change other properties, based on the mask
@@ -2333,4 +2349,18 @@ JNIEXPORT void JNICALL Java_sun_lwawt_macosx_CPlatformWindow_nativeSetTransparen
[window setTransparentTitleBarHeight:((CGFloat) transparentTitleBarHeight)];
JNI_COCOA_EXIT(env);
}
}
JNIEXPORT void JNICALL Java_sun_lwawt_macosx_CPlatformWindow_nativeCallDeliverMoveResizeEvent
(JNIEnv *env, jclass clazz, jlong windowPtr)
{
JNI_COCOA_ENTER(env);
NSWindow *nsWindow = (NSWindow *)jlong_to_ptr(windowPtr);
[ThreadUtilities performOnMainThreadWaiting:NO block:^(){
AWTWindow *window = (AWTWindow*)[nsWindow delegate];
[window _deliverMoveResizeEvent];
}];
JNI_COCOA_EXIT(env);
}

View File

@@ -237,7 +237,7 @@ static BOOL sNeedsEnter;
jobject transferer = [self dataTransferer:env];
jbyteArray data = nil;
if (transferer != NULL) {
if (transferer != NULL && fComponent != NULL) {
GET_DT_CLASS_RETURN(NULL);
DECLARE_METHOD_RETURN(convertDataMethod, DataTransfererClass, "convertData", "(Ljava/lang/Object;Ljava/awt/datatransfer/Transferable;JLjava/util/Map;Z)[B", NULL);
data = (*env)->CallObjectMethod(env, transferer, convertDataMethod, fComponent, fTransferable, format, fFormatMap, (jboolean) TRUE);

View File

@@ -39,7 +39,7 @@
- (BOOL)isAccessibilityElement
{
return YES;
return [[[self accessibilityParent] accessibilityRole] isEqualToString:NSAccessibilityComboBoxRole];
}
@end

View File

@@ -3371,7 +3371,7 @@ JNI_COCOA_ENTER(env);
anotherBaseFont = true;
}
CTFontRef font = (CTFontRef)nsFont;
CFArrayRef codes = CFLocaleCopyISOLanguageCodes();
CFArrayRef codes = CFLocaleCopyPreferredLanguages();
CFArrayRef fds = CTFontCopyDefaultCascadeListForLanguages(font, codes);
CFRelease(codes);

View File

@@ -781,19 +781,12 @@ abstract class XDecoratedPeer extends XWindowPeer {
return;
}
/*
* Some window managers configure before we are reparented and
* the send event flag is set! ugh... (Enlighetenment for one,
* possibly MWM as well). If we haven't been reparented yet
* this is just the WM shuffling us into position. Ignore
* it!!!! or we wind up in a bogus location.
*/
int runningWM = XWM.getWMID();
if (insLog.isLoggable(PlatformLogger.Level.FINE)) {
insLog.fine("reparented={0}, visible={1}, WM={2}, decorations={3}",
isReparented(), isVisible(), runningWM, getDecorations());
}
if (!isReparented() && isVisible() && runningWM != XWM.NO_WM
if (ENABLE_REPARENTING_CHECK && !isReparented() && isVisible() && runningWM != XWM.NO_WM
&& !XWM.isNonReparentingWM()
&& getDecorations() != XWindowAttributesData.AWT_DECOR_NONE) {
insLog.fine("- visible but not reparented, skipping");

View File

@@ -52,6 +52,8 @@ import sun.awt.X11GraphicsEnvironment;
import sun.java2d.pipe.Region;
import sun.util.logging.PlatformLogger;
import sun.security.action.GetPropertyAction;
class XWindowPeer extends XPanelPeer implements WindowPeer,
DisplayChangedListener {
@@ -61,6 +63,9 @@ class XWindowPeer extends XPanelPeer implements WindowPeer,
private static final PlatformLogger grabLog = PlatformLogger.getLogger("sun.awt.X11.grab.XWindowPeer");
private static final PlatformLogger iconLog = PlatformLogger.getLogger("sun.awt.X11.icon.XWindowPeer");
static final boolean ENABLE_REPARENTING_CHECK
= "true".equals(GetPropertyAction.privilegedGetProperty("reparenting.check"));
// should be synchronized on awtLock
private static Set<XWindowPeer> windows = new HashSet<XWindowPeer>();
@@ -747,7 +752,8 @@ class XWindowPeer extends XPanelPeer implements WindowPeer,
int runningWM = XWM.getWMID();
Point newLocation = targetBounds.getLocation();
if (xe.get_send_event() || runningWM == XWM.NO_WM || XWM.isNonReparentingWM()) {
if (xe.get_send_event() ||
(ENABLE_REPARENTING_CHECK ? (runningWM == XWM.NO_WM || XWM.isNonReparentingWM()) : !isReparented())) {
// Location, Client size + insets
newLocation = new Point(scaleDown(xe.get_x()) - leftInset,
scaleDown(xe.get_y()) - topInset);
@@ -1443,6 +1449,14 @@ class XWindowPeer extends XPanelPeer implements WindowPeer,
isUnhiding |= isWMStateNetHidden();
super.handleMapNotifyEvent(xev);
if (!ENABLE_REPARENTING_CHECK && delayedModalBlocking) {
// case of non-re-parenting WM
// (for a re-parenting WM this should have been already done on ReparentNotify processing)
addToTransientFors(AWTAccessor.getComponentAccessor().getPeer(modalBlocker));
delayedModalBlocking = false;
}
if (isBeforeFirstMapNotify && !winAttr.initialFocus && shouldSuppressWmTakeFocus()) {
suppressWmTakeFocus(false); // restore the protocol.
if (!XWM.isKDE2()) {
@@ -1662,7 +1676,7 @@ class XWindowPeer extends XPanelPeer implements WindowPeer,
}
modalBlocker = d;
if (isReparented() || XWM.isNonReparentingWM()) {
if (isReparented() || ENABLE_REPARENTING_CHECK && XWM.isNonReparentingWM()) {
addToTransientFors(blockerPeer, javaToplevels);
} else {
delayedModalBlocking = true;
@@ -1673,7 +1687,7 @@ class XWindowPeer extends XPanelPeer implements WindowPeer,
}
modalBlocker = null;
if (isReparented() || XWM.isNonReparentingWM()) {
if (isReparented() || ENABLE_REPARENTING_CHECK && XWM.isNonReparentingWM()) {
removeFromTransientFors();
} else {
delayedModalBlocking = false;

View File

@@ -0,0 +1,98 @@
/*
* Copyright 2000-2022 JetBrains s.r.o.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
/*
@test
@key headful
@summary a regression test for JBR-4303.
@run main GetPointerInfoTest
*/
import java.awt.*;
/**
* The test checks <code>MouseInfo.getPointerInfo()</code> for all locations with the steps <code>X_STEP</code> and
* <code>Y_STEP</code> on all graphic devices.
* It moves mouse to the current location via <code>Robot.mouseMove()</code> and checks that
* <code>MouseInfo.getPointerInfo()</code> is not NULL.
* It also checks <code>MouseInfo.getPointerInfo().getLocation()</code> returns expected values.
*/
public class GetPointerInfoTest {
public static int X_STEP = 100;
public static int Y_STEP = 100;
static boolean isPassed = true;
public static void main(String[] args) throws Exception {
GraphicsEnvironment ge = GraphicsEnvironment.getLocalGraphicsEnvironment();
GraphicsDevice[] graphicsDevices = ge.getScreenDevices();
for (GraphicsDevice gd : graphicsDevices) {
String name = gd.getIDstring();
int width = gd.getDisplayMode().getWidth();
int height = gd.getDisplayMode().getHeight();
System.out.println("Check for device: " + name + " " + width + "x" + height);
Robot robot = new Robot(gd);
robot.setAutoDelay(0);
robot.setAutoWaitForIdle(true);
robot.delay(10);
robot.waitForIdle();
GraphicsConfiguration gc = gd.getDefaultConfiguration();
Rectangle bounds = gc.getBounds();
for (double y = bounds.getY(); y < bounds.getY() + bounds.getHeight(); y += Y_STEP) {
for (double x = bounds.getX(); x < bounds.getX() + bounds.getWidth(); x += X_STEP) {
Point p = new Point((int)x, (int)y);
System.out.println("\tmouse move to x=" + p.x + " y=" + p.y);
robot.mouseMove(p.x, p.y);
System.out.print("\t\tMouseInfo.getPointerInfo.getLocation");
PointerInfo pi = MouseInfo.getPointerInfo();
if (pi == null) {
throw new RuntimeException("Test failed. getPointerInfo() returned null value.");
}
Point piLocation = pi.getLocation();
if (piLocation.x != p.x || piLocation.y != p.y) {
System.out.println(" - ***FAILED*** x=" + piLocation.x + " y=" + piLocation.y);
isPassed = false;
} else {
System.out.println(" x=" + p.x + ", y=" + p.y + " - passed");
}
}
}
}
if ( !isPassed )
throw new RuntimeException("PointerInfo.getLocation() returns unexpected value(s).");
System.out.println("Test PASSED.");
}
}