diff options
author | Yana Stamcheva <yana@jitsi.org> | 2012-10-15 19:45:08 +0000 |
---|---|---|
committer | Yana Stamcheva <yana@jitsi.org> | 2012-10-15 19:45:08 +0000 |
commit | 52680ff85f47f9e1e3b3a9d01f1125be187e4d30 (patch) | |
tree | 09a5055bd699dfb2ffb901590e7b58de59e29168 /src/net/java/sip/communicator/util | |
parent | 8ab5ddd1bdf897612cc098bf3fe0caf610b4e40e (diff) | |
download | jitsi-52680ff85f47f9e1e3b3a9d01f1125be187e4d30.zip jitsi-52680ff85f47f9e1e3b3a9d01f1125be187e4d30.tar.gz jitsi-52680ff85f47f9e1e3b3a9d01f1125be187e4d30.tar.bz2 |
Fixes tool tips in conference and transfer invite windows.
Diffstat (limited to 'src/net/java/sip/communicator/util')
-rw-r--r-- | src/net/java/sip/communicator/util/swing/ExtendedTooltip.java | 62 |
1 files changed, 34 insertions, 28 deletions
diff --git a/src/net/java/sip/communicator/util/swing/ExtendedTooltip.java b/src/net/java/sip/communicator/util/swing/ExtendedTooltip.java index 2c24646..077c4c1 100644 --- a/src/net/java/sip/communicator/util/swing/ExtendedTooltip.java +++ b/src/net/java/sip/communicator/util/swing/ExtendedTooltip.java @@ -59,7 +59,7 @@ public class ExtendedTooltip * Created a <tt>MetaContactTooltip</tt>. * @param isListViewEnabled indicates if the list view is enabled */ - public ExtendedTooltip(final Window parentWindow, boolean isListViewEnabled) + public ExtendedTooltip(boolean isListViewEnabled) { this.isListViewEnabled = isListViewEnabled; @@ -99,6 +99,10 @@ public class ExtendedTooltip bottomTextArea.setFont(bottomTextArea.getFont().deriveFont(10f)); mainPanel.add(bottomTextArea, BorderLayout.SOUTH); + final Window parentWindow + = KeyboardFocusManager.getCurrentKeyboardFocusManager() + .getActiveWindow(); + // Hide the tooltip when the parent window hides. /* * FIXME The parentWindow will surely outlive this ExtendedTooltip so @@ -130,34 +134,36 @@ public class ExtendedTooltip public void windowGainedFocus(WindowEvent e) {} }); + // Comments this code as it hides the tool tip once it's opened and this + // appears as a buggy behavior. // Hide the tooltip if the parent window isn't active - addComponentListener(new ComponentAdapter() - { - public void componentResized(ComponentEvent evt) - { - if (!parentWindow.isActive()) - { - Window popupWindow - = SwingUtilities.getWindowAncestor( - ExtendedTooltip.this); - - if (popupWindow != null - && popupWindow.isVisible() - && !(popupWindow instanceof JFrame) - // The popup window should normally be a JWindow, so we - // check here explicitly if for some reason we didn't get - // something else. - && (popupWindow instanceof JWindow)) - { - if (logger.isInfoEnabled()) - logger.info("Tooltip window ancestor to hide: " - + popupWindow); - - popupWindow.setVisible(false); - } - } - } - }); +// addComponentListener(new ComponentAdapter() +// { +// public void componentResized(ComponentEvent evt) +// { +// if (!parentWindow.isActive()) +// { +// Window popupWindow +// = SwingUtilities.getWindowAncestor( +// ExtendedTooltip.this); +// +// if (popupWindow != null +// && popupWindow.isVisible() +// && !(popupWindow instanceof JFrame) +// // The popup window should normally be a JWindow, so we +// // check here explicitly if for some reason we didn't +// // get something else. +// && (popupWindow instanceof JWindow)) +// { +// if (logger.isInfoEnabled()) +// logger.info("Tooltip window ancestor to hide: " +// + popupWindow); +// +// popupWindow.setVisible(false); +// } +// } +// } +// }); this.add(mainPanel); } |