Compare commits

..

11 Commits

Author SHA1 Message Date
Egor Ushakov
9b960dd02a navigation to issues from vcs log 2020-09-16 15:38:20 +03:00
Mikhail Grishchenko
6b7d5fd58c updated JTreg exclude list 2020-09-16 16:25:07 +07:00
Dmitry Batrak
ebcdeb7d80 JBR-2698 setAutoRequestFocus(false) breaks focus logic under i3 window manager on Linux 2020-09-11 11:11:17 +03:00
Vitaly Provodin
67870df19e updated JTreg exclude list 2020-09-11 10:36:59 +07:00
Nikita Gubarkov
afd19dbefd JBR-2614 Fixed LCD glyph width to include both left & right padding, so that rowBytes = width * 3 2020-09-10 15:45:25 +03:00
Nikita Gubarkov
a55097289b Revert "JBR-2614 Passed real glyph type from native code instead of guessing on rowBytes & width"
This reverts commit 8de39b80
2020-09-10 15:39:00 +03:00
Nikita Gubarkov
8de39b80cd JBR-2614 Passed real glyph type from native code instead of guessing on rowBytes & width 2020-09-10 01:50:34 +03:00
Dmitry Batrak
0f038754e5 JBR-2696 Log focus API invocations with stack traces 2020-09-07 14:19:43 +03:00
Vitaly Provodin
4aa278e4a0 Revert "JBR-2577 implemented precise CompilationMXBean#getTotalCompilationTime"
This reverts commit 89163e73
2020-09-07 16:44:40 +07:00
Vitaly Provodin
e3562ecc99 Revert "thread.cpp:4574:43: error: ‘nullptr’ quick fix"
This reverts commit 82a36017
2020-09-07 16:44:20 +07:00
Vitaly Provodin
b62d47da9c updated JTreg exclude list 2020-09-06 06:27:20 +07:00
16 changed files with 70 additions and 43 deletions

14
.idea/vcs.xml generated
View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@@ -28,7 +28,6 @@ package sun.awt.X11;
import java.awt.*;
import java.awt.event.ComponentEvent;
import java.awt.event.FocusEvent;
import java.awt.event.InvocationEvent;
import java.awt.event.WindowEvent;
import java.awt.peer.ComponentPeer;
import java.awt.peer.WindowPeer;
@@ -36,13 +35,7 @@ import java.io.UnsupportedEncodingException;
import java.security.AccessController;
import java.security.PrivilegedAction;
import java.util.*;
import java.util.List;
import java.util.concurrent.atomic.AtomicBoolean;
import java.util.concurrent.locks.Condition;
import java.util.concurrent.locks.Lock;
import java.util.concurrent.locks.ReentrantLock;
import java.util.function.BooleanSupplier;
import java.util.function.Consumer;
import sun.awt.AWTAccessor;
import sun.awt.AWTAccessor.ComponentAccessor;
@@ -1112,7 +1105,7 @@ class XWindowPeer extends XPanelPeer implements WindowPeer,
if (!isVisible() && vis) {
isBeforeFirstMapNotify = true;
winAttr.initialFocus = isAutoRequestFocus();
if (!winAttr.initialFocus) {
if (!winAttr.initialFocus && XWM.getWMID() != XWM.I3_WM) {
/*
* It's easier and safer to temporary suppress WM_TAKE_FOCUS
* protocol itself than to ignore WM_TAKE_FOCUS client message.
@@ -1120,6 +1113,13 @@ class XWindowPeer extends XPanelPeer implements WindowPeer,
* the message come after showing and the message come after
* activation. Also, on Metacity, for some reason, we have _two_
* WM_TAKE_FOCUS client messages when showing a frame/dialog.
*
* i3 window manager doesn't track updates to WM_TAKE_FOCUS
* property, so this approach won't work for it, breaking
* focus behaviour completely. So another way is used to
* suppress focus take over - via setting _NET_WM_USER_TIME
* to 0, as specified in EWMH spec (see
* 'setUserTimeBeforeShowing' method).
*/
suppressWmTakeFocus(true);
}
@@ -1184,6 +1184,16 @@ class XWindowPeer extends XPanelPeer implements WindowPeer,
protected void suppressWmTakeFocus(boolean doSuppress) {
}
@Override
void setUserTimeBeforeShowing() {
if (winAttr.initialFocus || XWM.getWMID() != XWM.I3_WM) {
super.setUserTimeBeforeShowing();
}
else {
setUserTime(0, false);
}
}
final boolean isSimpleWindow() {
return !(target instanceof Frame || target instanceof Dialog);
}
@@ -1425,7 +1435,7 @@ class XWindowPeer extends XPanelPeer implements WindowPeer,
isUnhiding |= isWMStateNetHidden();
super.handleMapNotifyEvent(xev);
if (!winAttr.initialFocus) {
if (!winAttr.initialFocus && XWM.getWMID() != XWM.I3_WM) {
suppressWmTakeFocus(false); // restore the protocol.
/*
* For some reason, on Metacity, a frame/dialog being shown
@@ -2053,7 +2063,7 @@ class XWindowPeer extends XPanelPeer implements WindowPeer,
this.visible = visible;
if (visible) {
applyWindowType();
setUserTimeFromGlobal();
setUserTimeBeforeShowing();
XlibWrapper.XMapRaised(XToolkit.getDisplay(), getWindow());
} else {
XlibWrapper.XUnmapWindow(XToolkit.getDisplay(), getWindow());

View File

@@ -596,6 +596,7 @@ java/awt/TrayIcon/PopupMenuLeakTest/PopupMenuLeakTest.java
java/awt/Window/8159168/SetShapeTest.java 8208507 generic-all
java/awt/Window/BackgroundIsNotUpdated/BackgroundIsNotUpdated.java 8142536 generic-all
java/awt/Window/Grab/GrabTest.java 8196019 macosx-all,windows-all,linux-all
java/awt/Window/GetScreenLocation/GetScreenLocationTest.java 8225787 linux-all
java/awt/Window/MultiWindowApp/ChildAlwaysOnTopTest.java 8215132,8194941 macosx-all,windows-all,linux-all
java/awt/Window/MultiWindowApp/MultiWindowAppTest.java 8159904 macosx-all,windows-all,linux-all
java/awt/Window/OwnedWindowsLeak/OwnedWindowsLeak.java 8225116 windows-all
@@ -636,6 +637,7 @@ java/awt/dnd/NoFormatsCrashTest/NoFormatsCrashTest.html
java/awt/dnd/URIListBetweenJVMsTest/URIListBetweenJVMsTest.html 8171510,7124379 macosx-all,linux-all
java/awt/dnd/URIListToFileListBetweenJVMsTest/URIListToFileListBetweenJVMsTest.html 8194947 generic-all
java/awt/event/ComponentEvent/MovedResizedTardyEventTest/MovedResizedTardyEventTest.html 6511207 generic-all
java/awt/event/ComponentEvent/MovedResizedTwiceTest/MovedResizedTwiceTest.java 8225787 linux-all
java/awt/event/HierarchyEvent/AncestorResized/AncestorResized.java 6618538 generic-all
java/awt/event/InputEvent/EventWhenTest/EventWhenTest.java 8168646 generic-all
java/awt/event/KeyEvent/CorrectTime/CorrectTime.java 6626492 generic-all
@@ -1263,6 +1265,6 @@ javax/swing/LookAndFeel/8146276/NimbusGlueTest.java
sanity/client/SwingSet/src/GridBagLayoutDemoTest.java JBR-1977 linux-aarch64
jb/java/jcef/JCEFStartupTest.java JBR-1996 linux-i386,windows-x86
jb/java/awt/event/TouchScreenEvent/TouchScreenEventsTest.java nobug windows-6.1 not supported on Windows 7
jb/java/awt/event/TouchScreenEvent/TouchScreenEventsTest.java JBR-2585 linux-all,windows-all nobug windows-6.1 not supported on Windows 7
jb/java/awt/event/TouchScreenEvent/TouchScreenEventsTestLinux.sh JBR-2585 linux-all
jb/java/awt/Focus/ChainOfPopupsFocusTest.java JBR-2657 windows-all
jb/java/awt/Focus/ChainOfPopupsFocusTest.java JBR-2657 windows-all,linux-all