# HG changeset patch
# User bagiras
# Date 1385467069 -14400
# Node ID 3a7def8aa5fb7abd6839f35ec0f7e21d6eb458f2
# Parent 561ed508292b38eeeb4a2326aff5fe515d4eae10
7160604: Using non-opaque windows - popups are initially not painted correctly
Reviewed-by: serb, alexsch
diff -r 561ed508292b -r 3a7def8aa5fb jdk/src/share/classes/javax/swing/JPopupMenu.java
--- a/jdk/src/share/classes/javax/swing/JPopupMenu.java Tue Nov 26 13:30:44 2013 +0400
+++ b/jdk/src/share/classes/javax/swing/JPopupMenu.java Tue Nov 26 15:57:49 2013 +0400
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1997, 2012, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -736,7 +736,7 @@
if (pref == null || pref.width != getWidth() ||
pref.height != getHeight()) {
- popup = getPopup();
+ showPopup();
} else {
validate();
}
@@ -787,7 +787,7 @@
if(b) {
firePopupMenuWillBecomeVisible();
- popup = getPopup();
+ showPopup();
firePropertyChange("visible", Boolean.FALSE, Boolean.TRUE);
@@ -805,7 +805,7 @@
}
/**
- * Returns a Popup
instance from the
+ * Retrieves Popup
instance from the
* PopupMenuUI
that has had show
invoked on
* it. If the current popup
is non-null,
* this will invoke dispose
of it, and then
@@ -814,7 +814,7 @@
* This does NOT fire any events, it is up the caller to dispatch
* the necessary events.
*/
- private Popup getPopup() {
+ private void showPopup() {
Popup oldPopup = popup;
if (oldPopup != null) {
@@ -838,8 +838,8 @@
desiredLocationY);
popupFactory.setPopupType(PopupFactory.LIGHT_WEIGHT_POPUP);
+ popup = newPopup;
newPopup.show();
- return newPopup;
}
/**
@@ -873,7 +873,7 @@
desiredLocationX = x;
desiredLocationY = y;
if(popup != null && (x != oldX || y != oldY)) {
- popup = getPopup();
+ showPopup();
}
}
@@ -1030,7 +1030,7 @@
Dimension newSize = getPreferredSize();
if (!oldSize.equals(newSize)) {
- popup = getPopup();
+ showPopup();
}
}
}
diff -r 561ed508292b -r 3a7def8aa5fb jdk/test/javax/swing/JPopupMenu/7160604/bug7160604.html
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/jdk/test/javax/swing/JPopupMenu/7160604/bug7160604.html Tue Nov 26 15:57:49 2013 +0400
@@ -0,0 +1,30 @@
+
+
+
+