Skip to main content

Popup menu goes behind the taskbar

5 replies [Last post]
espectro
Offline
Joined: 2006-02-17

We are trying to use your systray code for our project, and our developer says that if you have auto-hide the taskbar' enabled, and you right click the tray icon, the popupmenu is shown behind the taskbar where
it should appear in front. He tried the latest version

Reply viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
jd
Offline
Joined: 2004-05-04

I believe that this is a Windows bug. It occurs sporadically, and when it does, it affect all items in the tray. If this is the problem you're seeing, there is no known solution (or at least none that I've heard of).

Sergey Astakhov
Offline
Joined: 2006-02-17

You can use "alwaysOnTop" (new feature of 1.5) to fix this problem. We did following changes (using sources from 0.8.6) - seems to work.

WinTrayIconService.java
[code]
...
public void setPopupMenu(JPopupMenu m)
{
if( menu!=null )
{
menu.removePopupMenuListener(this);
}

menu = m;

if( menu != null )
{
menu.setLightWeightPopupEnabled(false);
menu.addPopupMenuListener(this);
}
}
...
public void processEvent(int mouseState, int x, int y)
...

case 0x205: // WM_RBUTTONUP

if (!isShowing) {
isShowing = true;

popupParentFrame = new JDialog();
popupParentFrame.setUndecorated(true);
popupParentFrame.setAlwaysOnTop(true);

popupParentFrame.setBounds(x, y, 1, 1);
popupParentFrame.setVisible(true);

menu.show(popupParentFrame, 0, 0);
}
popupParentFrame.toFront();
break;
[/code]

armin_chen
Offline
Joined: 2004-09-29

Hi espectro,

I'm sorry for the problem. We will fix this bug as soon as possible.

Thanks for your bug report.

-Armin

espectro
Offline
Joined: 2006-02-17

If you can, please post back to this topic once it is fixed, so i can confirm it and be of additional help to you guys

armin_chen
Offline
Joined: 2004-09-29

If you unset the allways-in-front property of the taskbar, the popupmenu will be shown in front. So this promble maybe due to the defect of JPopupMenu. Anyway, if we solve this promble, we will post back to this topic.

Thanks for your attention.
-Armin