I2P Address: [http://git.idk.i2p]

Skip to content
Snippets Groups Projects
Commit 2d088899 authored by zzz's avatar zzz
Browse files

DTG swing event handling tweaks

parent ab3dbd58
No related branches found
No related tags found
No related merge requests found
...@@ -102,9 +102,12 @@ abstract class TrayManager { ...@@ -102,9 +102,12 @@ abstract class TrayManager {
public void mousePressed(MouseEvent e) { handle(e); } public void mousePressed(MouseEvent e) { handle(e); }
public void mouseReleased(MouseEvent e) { handle(e); } public void mouseReleased(MouseEvent e) { handle(e); }
private void handle(MouseEvent e) { private void handle(MouseEvent e) {
//System.out.println("Button " + e.getButton() + " Frame was visible? " +
// frame.isVisible() + " menu was visible? " + menu.isVisible() +
// " trigger? " + menu.isPopupTrigger(e));
// http://stackoverflow.com/questions/17258250/changing-the-laf-of-a-popupmenu-for-a-trayicon-in-java // http://stackoverflow.com/questions/17258250/changing-the-laf-of-a-popupmenu-for-a-trayicon-in-java
// menu visible check is failsafe, for when menu gets cancelled // menu visible check is never true
if (!frame.isVisible() || !menu.isVisible()) { if (!frame.isVisible() /* || !menu.isVisible() */ ) {
frame.setLocation(e.getX(), e.getY()); frame.setLocation(e.getX(), e.getY());
frame.setVisible(true); frame.setVisible(true);
menu.show(frame, 0, 0); menu.show(frame, 0, 0);
...@@ -113,8 +116,8 @@ abstract class TrayManager { ...@@ -113,8 +116,8 @@ abstract class TrayManager {
} }
}); });
menu.addPopupMenuListener(new PopupMenuListener() { menu.addPopupMenuListener(new PopupMenuListener() {
public void popupMenuCanceled(PopupMenuEvent e) { frame.setVisible(false); } public void popupMenuCanceled(PopupMenuEvent e) { /* frame.setVisible(false); */ }
public void popupMenuWillBecomeInvisible(PopupMenuEvent e) {} public void popupMenuWillBecomeInvisible(PopupMenuEvent e) { frame.setVisible(false); }
public void popupMenuWillBecomeVisible(PopupMenuEvent e) {} public void popupMenuWillBecomeVisible(PopupMenuEvent e) {}
}); });
// this is to make it go away when we click elsewhere // this is to make it go away when we click elsewhere
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment