273 |
|
|
274 |
RootPaneContainer rootContainer = (RootPaneContainer) SwingUtilities |
RootPaneContainer rootContainer = (RootPaneContainer) SwingUtilities |
275 |
.getRoot(invoker); |
.getRoot(invoker); |
276 |
((Container) rootContainer).removeComponentListener(topWindowListener); |
if (rootContainer != null) |
277 |
|
{ |
278 |
|
((Container) rootContainer).removeComponentListener(topWindowListener); |
279 |
|
|
280 |
// If this popup menu is the last popup menu visible on the screen, then |
// If this popup menu is the last popup menu visible on the screen, |
281 |
// stop interrupting mouse events in the glass pane before hiding this |
// then |
282 |
// last popup menu. |
// stop interrupting mouse events in the glass pane before hiding this |
283 |
boolean topLevelMenu = (popupMenu.getInvoker() instanceof JMenu) |
// last popup menu. |
284 |
&& ((JMenu) popupMenu.getInvoker()) |
boolean topLevelMenu = (popupMenu.getInvoker() instanceof JMenu) |
285 |
.isTopLevelMenu(); |
&& ((JMenu) popupMenu.getInvoker()).isTopLevelMenu(); |
286 |
|
|
287 |
if (topLevelMenu || ! (popupMenu.getInvoker() instanceof MenuElement)) |
if (topLevelMenu || !(popupMenu.getInvoker() instanceof MenuElement)) |
288 |
{ |
{ |
289 |
// set glass pane not to interrupt mouse events and remove |
// set glass pane not to interrupt mouse events and remove |
290 |
// mouseInputListener |
// mouseInputListener |
291 |
Container glassPane = (Container) rootContainer.getGlassPane(); |
Container glassPane = (Container) rootContainer.getGlassPane(); |
292 |
glassPane.setVisible(false); |
glassPane.setVisible(false); |
293 |
glassPane.removeMouseListener(mouseInputListener); |
glassPane.removeMouseListener(mouseInputListener); |
294 |
mouseInputListener = null; |
mouseInputListener = null; |
295 |
|
} |
296 |
} |
} |
297 |
} |
} |
298 |
|
|