-
Bug
-
Resolution: Fixed
-
P3
-
21
-
b24
Issue | Fix Version | Assignee | Priority | Status | Resolution | Resolved In Build |
---|---|---|---|---|---|---|
JDK-8335474 | 17.0.13-oracle | Harshitha Onkar | P3 | Resolved | Fixed | b01 |
JDK-8335954 | 17.0.13 | Matthias Baesken | P3 | Resolved | Fixed | b01 |
JDK-8337044 | 11.0.26-oracle | Harshitha Onkar | P3 | Resolved | Fixed | b01 |
JDK-8338001 | 8u441 | Renjith Kannath Pariyangad | P3 | Resolved | Fixed | b01 |
Obviously, it does not work when we are trying to mouse click outside of area controlled by XWayland(window's title, desktop, wayland native apss).
prototype of not perfect workaround
diff --git a/src/java.desktop/unix/classes/sun/awt/X11/XPopupMenuPeer.java b/src/java.desktop/unix/classes/sun/awt/X11/XPopupMenuPeer.java
index a19f56249ae..db88ef49f37 100644
--- a/src/java.desktop/unix/classes/sun/awt/X11/XPopupMenuPeer.java
+++ b/src/java.desktop/unix/classes/sun/awt/X11/XPopupMenuPeer.java
@@ -111,6 +111,16 @@ public class XPopupMenuPeer extends XMenuWindow implements PopupMenuPeer {
// Get menus from the target.
Vector<MenuItem> targetItemVector = getMenuTargetItems();
if (targetItemVector != null) {
+ //TODO: add focus listener only for XWayland
+ target.addFocusListener(new FocusAdapter() {
+ @Override
+ public void focusLost(FocusEvent e) {
+ target.removeFocusListener(this);
+ if (isShowing()) {
+ hide();
+ }
+ }
+ });
reloadItems(targetItemVector);
//Fix for 6287092: JCK15a: api/java_awt/interactive/event/EventTests.html#EventTest0015 fails, mustang
For a first look this workaround seems to work reliably except only one case:
clicking on window's title containing origin component does not lead to focus change, thus we don't hiding popup.
- backported by
-
JDK-8335474 [XWayland] Popup is not closed on click outside of area controlled by XWayland
- Resolved
-
JDK-8335954 [XWayland] Popup is not closed on click outside of area controlled by XWayland
- Resolved
-
JDK-8337044 [XWayland] Popup is not closed on click outside of area controlled by XWayland
- Resolved
-
JDK-8338001 [XWayland] Popup is not closed on click outside of area controlled by XWayland
- Resolved
- csr for
-
JDK-8307529 [XWayland] Popup is not closed on click outside of area controlled by XWayland
- Closed
- relates to
-
JDK-8319103 Popups that request focus are not shown on Linux with Wayland
- Resolved
- links to
-
Commit openjdk/jdk17u-dev/0485f4c0
-
Commit openjdk/jdk/3d550f74
-
Review openjdk/jdk/13830
-
Review(master) openjdk/jdk17u-dev/2677