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