mirror of
https://github.com/openjdk/jdk.git
synced 2025-08-28 15:24:43 +02:00
8156042: Modifiers of swing ActionEvent does not work when "-Djavafx.embed.singleThread=true"
Reviewed-by: azvegint
This commit is contained in:
parent
a8ce9febcd
commit
34500e27fe
1 changed files with 18 additions and 3 deletions
|
@ -191,6 +191,8 @@ public class EventQueue {
|
|||
return eventLog;
|
||||
}
|
||||
|
||||
private static boolean fxAppThreadIsDispatchThread;
|
||||
|
||||
static {
|
||||
AWTAccessor.setEventQueueAccessor(
|
||||
new AWTAccessor.EventQueueAccessor() {
|
||||
|
@ -227,6 +229,13 @@ public class EventQueue {
|
|||
return eventQueue.getMostRecentEventTimeImpl();
|
||||
}
|
||||
});
|
||||
AccessController.doPrivileged(new PrivilegedAction<Object>() {
|
||||
public Object run() {
|
||||
fxAppThreadIsDispatchThread =
|
||||
"true".equals(System.getProperty("javafx.embed.singleThread"));
|
||||
return null;
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -854,9 +863,15 @@ public class EventQueue {
|
|||
private AWTEvent getCurrentEventImpl() {
|
||||
pushPopLock.lock();
|
||||
try {
|
||||
if (fxAppThreadIsDispatchThread) {
|
||||
return (currentEvent != null)
|
||||
? currentEvent.get()
|
||||
: null;
|
||||
} else {
|
||||
return (Thread.currentThread() == dispatchThread)
|
||||
? currentEvent.get()
|
||||
: null;
|
||||
? currentEvent.get()
|
||||
: null;
|
||||
}
|
||||
} finally {
|
||||
pushPopLock.unlock();
|
||||
}
|
||||
|
@ -1247,7 +1262,7 @@ public class EventQueue {
|
|||
private void setCurrentEventAndMostRecentTimeImpl(AWTEvent e) {
|
||||
pushPopLock.lock();
|
||||
try {
|
||||
if (Thread.currentThread() != dispatchThread) {
|
||||
if (!fxAppThreadIsDispatchThread && Thread.currentThread() != dispatchThread) {
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue