We're Hiring!

BUG: Insight 4.3.2 - No context menu on Unix

General user discussion about using the OMERO platform to its fullest. Please ask new questions at https://forum.image.sc/tags/omero
Please note:
Historical discussions about OMERO. Please look for and ask new questions at https://forum.image.sc/tags/omero

There are workflow guides for various OMERO functions on our help site - http://help.openmicroscopy.org

You should find answers to any basic questions about using the clients there.

BUG: Insight 4.3.2 - No context menu on Unix

Postby a.herbert » Fri Sep 23, 2011 10:09 am

Hi,

I have just upgraded to OMERO 4.3.2 and have lost the right-click context menu from Insight on my Linux client. A quick check of our Windows and Mac versions show that the menu is still available.

Any ideas of how this has changed in the recent build? I can easily patch all our clients if you can identify a fix.

Alex
a.herbert
 
Posts: 53
Joined: Tue Jan 11, 2011 1:35 pm

Re: BUG: Insight 4.3.2 - No context menu on Unix

Postby a.herbert » Tue Sep 27, 2011 11:35 am

Hi,

I have tracked this problem down to a change in the code for:

insight/SRC/org/openmicroscopy/shoola/agents/treeviewer/browser/BrowserUI.java
private void createTrees(ExperimenterData exp)

In version 4.3.0 the mouse listeners for the treeDisplay would always call the onClick() event for both mousePressed() and mouseReleased(). In version 4.3.2 there is now code to call onClick() on the mouse pressed event if the machine is a Mac, otherwise call the onClick() event in the mouse released event.

However the code within onClick() tests for the mouseEvent.isPopupTrigger() result to determine whether to show the pop-up menu. Unfortunately on a Linux system the isPopupTrigger() returns true for mousePressed() and false for mouseReleased(). This means that onClick() should be called in the same place as the Mac variant. So:

Code: Select all
        treeDisplay.addMouseListener(new MouseAdapter() {
           public void mousePressed(MouseEvent e)
           {
              rightClickPad = UIUtilities.isMacOS() &&
            SwingUtilities.isLeftMouseButton(e) && e.isControlDown();
              rightClickButton = SwingUtilities.isRightMouseButton(e);
              ctrl = e.isControlDown();
              if (UIUtilities.isMacOS()) ctrl = e.isMetaDown();
              leftMouseButton = SwingUtilities.isLeftMouseButton(e);
              if (UIUtilities.isMacOS() || UIUtilities.isLinuxOS()) onClick(e, false);
           }
           public void mouseReleased(MouseEvent e)
           {
              leftMouseButton = SwingUtilities.isLeftMouseButton(e);
              if (!(UIUtilities.isMacOS() || UIUtilities.isLinuxOS())) onClick(e, true);
           }


An alternative may be:

Code: Select all
        treeDisplay.addMouseListener(new MouseAdapter() {
           public void mousePressed(MouseEvent e)
           {
              rightClickPad = UIUtilities.isMacOS() &&
            SwingUtilities.isLeftMouseButton(e) && e.isControlDown();
              rightClickButton = SwingUtilities.isRightMouseButton(e);
              ctrl = e.isControlDown();
              if (UIUtilities.isMacOS()) ctrl = e.isMetaDown();
              leftMouseButton = SwingUtilities.isLeftMouseButton(e);
              if (e.isPopupTrigger()) onClick(e, false);
           }
           public void mouseReleased(MouseEvent e)
           {
              leftMouseButton = SwingUtilities.isLeftMouseButton(e);
              if (e.isPopupTrigger()) onClick(e, true);
           }


The first version would perform as expected on a Mac and Windows system, it just changes the Linux behaviour. However I have not tested the second variant on all platforms so cannot be sure that on Mac/Windows it will be OK.

Alex
a.herbert
 
Posts: 53
Joined: Tue Jan 11, 2011 1:35 pm

Re: BUG: Insight 4.3.2 - No context menu on Unix

Postby jburel » Tue Sep 27, 2011 11:57 am

Hi Alex

Thanks for pointing that out.
I have created a ticket http://trac.openmicroscopy.org.uk/ome/ticket/6864.

I will get that sorted for 4.3.3.

Thanks
Jmarie
User avatar
jburel
Team Member
 
Posts: 348
Joined: Thu May 21, 2009 6:38 pm
Location: dundee

Re: BUG: Insight 4.3.2 - No context menu on Unix

Postby a.herbert » Tue Sep 27, 2011 1:34 pm

Here is another place that I have found where the same fix is needed:

org.openmicroscopy.shoola.agents.dataBrowser.browser.BrowserControl
mousePressed() + mouseReleased()

A search within the code for isPopupTrigger() did not find any other places where the code appears to be broken on Linux.

Regards,

Alex
a.herbert
 
Posts: 53
Joined: Tue Jan 11, 2011 1:35 pm

Re: BUG: Insight 4.3.2 - No context menu on Unix

Postby jburel » Wed Oct 12, 2011 5:01 pm

Hi

I forgot to mention in my previous post: we did not use the isPopuptrigger() b/c I noticed some issues while selecting via the trackpad

Jmarie
User avatar
jburel
Team Member
 
Posts: 348
Joined: Thu May 21, 2009 6:38 pm
Location: dundee


Return to User Discussion

Who is online

Users browsing this forum: No registered users and 1 guest