8166772: Touch keyboard is not shown for text components on a screen touch

Reviewed-by: serb, azvegint
This commit is contained in:
Anton Litvinov 2017-10-11 15:53:25 +01:00
parent a9cb8eb350
commit dd41b7691f
24 changed files with 726 additions and 13 deletions

View file

@ -33,6 +33,8 @@ import java.io.IOException;
import java.io.ObjectInputStream;
import java.awt.IllegalComponentStateException;
import java.awt.MouseInfo;
import sun.awt.AWTAccessor;
import sun.awt.SunToolkit;
/**
@ -331,6 +333,11 @@ public class MouseEvent extends InputEvent {
*/
int clickCount;
/**
* Indicates whether the event is a result of a touch event.
*/
private boolean causedByTouchEvent;
/**
* Indicates which, if any, of the mouse buttons has changed state.
*
@ -399,6 +406,17 @@ public class MouseEvent extends InputEvent {
//whatever besides SunToolkit) could also operate.
cachedNumberOfButtons = 3;
}
AWTAccessor.setMouseEventAccessor(
new AWTAccessor.MouseEventAccessor() {
public boolean isCausedByTouchEvent(MouseEvent ev) {
return ev.causedByTouchEvent;
}
public void setCausedByTouchEvent(MouseEvent ev,
boolean causedByTouchEvent) {
ev.causedByTouchEvent = causedByTouchEvent;
}
});
}
/**