提交 e01d0a82 编写于 作者: D dcherepanov

6508505: JComboBox collapses immediately if it is placed to embedded frame

Summary: XWindowPeer should translate absolute coordinates to local
Reviewed-by: son
上级 e010e3fa
...@@ -1974,8 +1974,9 @@ class XWindowPeer extends XPanelPeer implements WindowPeer, ...@@ -1974,8 +1974,9 @@ class XWindowPeer extends XPanelPeer implements WindowPeer,
// So, I do not want to implement complicated logic for better retargeting. // So, I do not want to implement complicated logic for better retargeting.
target = pressTarget.isVisible() ? pressTarget : this; target = pressTarget.isVisible() ? pressTarget : this;
xme.set_window(target.getWindow()); xme.set_window(target.getWindow());
xme.set_x(xme.get_x_root() - target.getX()); Point localCoord = target.toLocal(xme.get_x_root(), xme.get_y_root());
xme.set_y(xme.get_y_root() - target.getY()); xme.set_x(localCoord.x);
xme.set_y(localCoord.y);
} }
grabLog.log(Level.FINER, " - Grab event target {0}", new Object[] {target}); grabLog.log(Level.FINER, " - Grab event target {0}", new Object[] {target});
if (target != null) { if (target != null) {
...@@ -2026,8 +2027,9 @@ class XWindowPeer extends XPanelPeer implements WindowPeer, ...@@ -2026,8 +2027,9 @@ class XWindowPeer extends XPanelPeer implements WindowPeer,
// see 6390326 for more information. // see 6390326 for more information.
target = pressTarget.isVisible() ? pressTarget : this; target = pressTarget.isVisible() ? pressTarget : this;
xbe.set_window(target.getWindow()); xbe.set_window(target.getWindow());
xbe.set_x(xbe.get_x_root() - target.getX()); Point localCoord = target.toLocal(xbe.get_x_root(), xbe.get_y_root());
xbe.set_y(xbe.get_y_root() - target.getY()); xbe.set_x(localCoord.x);
xbe.set_y(localCoord.y);
pressTarget = this; pressTarget = this;
} }
if (target != null && target != getContentXWindow() && target != this) { if (target != null && target != getContentXWindow() && target != this) {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册