Changeset 2d08889


Ignore:
Timestamp:
May 9, 2016 12:45:29 PM (4 years ago)
Author:
zzz <zzz@…>
Branches:
master
Children:
ea38672
Parents:
ab3dbd5
Message:

DTG swing event handling tweaks

File:
1 edited

Legend:

Unmodified
Added
Removed
  • apps/desktopgui/src/net/i2p/desktopgui/TrayManager.java

    rab3dbd5 r2d08889  
    103103            public void mouseReleased(MouseEvent e) { handle(e); }
    104104            private void handle(MouseEvent e) {
     105                //System.out.println("Button " + e.getButton() + " Frame was visible? " +
     106                //                   frame.isVisible() + " menu was visible? " + menu.isVisible() +
     107                //                   " trigger? " + menu.isPopupTrigger(e));
    105108                // http://stackoverflow.com/questions/17258250/changing-the-laf-of-a-popupmenu-for-a-trayicon-in-java
    106                 // menu visible check is failsafe, for when menu gets cancelled
    107                 if (!frame.isVisible() || !menu.isVisible()) {
     109                // menu visible check is never true
     110                if (!frame.isVisible() /* || !menu.isVisible() */ ) {
    108111                    frame.setLocation(e.getX(), e.getY());
    109112                    frame.setVisible(true);
     
    114117        });
    115118        menu.addPopupMenuListener(new PopupMenuListener() {
    116             public void popupMenuCanceled(PopupMenuEvent e)            { frame.setVisible(false); }
    117             public void popupMenuWillBecomeInvisible(PopupMenuEvent e) {}
     119            public void popupMenuCanceled(PopupMenuEvent e)            { /* frame.setVisible(false); */ }
     120            public void popupMenuWillBecomeInvisible(PopupMenuEvent e) { frame.setVisible(false); }
    118121            public void popupMenuWillBecomeVisible(PopupMenuEvent e)   {}
    119122        });
Note: See TracChangeset for help on using the changeset viewer.