Skip to content

Commit

Permalink
Merge PR #595: Switch and close tabs on left mouse click only
Browse files Browse the repository at this point in the history
  • Loading branch information
DevCharly committed Sep 30, 2022
2 parents 92c1105 + 9552284 commit 0699454
Showing 1 changed file with 2 additions and 2 deletions.
Expand Up @@ -2589,7 +2589,7 @@ public void mouseClicked( MouseEvent e ) {
public void mousePressed( MouseEvent e ) {
updateRollover( e );

if( !isPressedTabClose() )
if( !isPressedTabClose() && SwingUtilities.isLeftMouseButton( e ) )
mouseDelegate.mousePressed( e );
}

Expand Down Expand Up @@ -2644,7 +2644,7 @@ private void updateRollover( MouseEvent e ) {

// check whether mouse hit tab close area
boolean hitClose = isTabClosable( tabIndex ) && getTabCloseHitArea( tabIndex ).contains( x, y );
if( e.getID() == MouseEvent.MOUSE_PRESSED )
if( e.getID() == MouseEvent.MOUSE_PRESSED && SwingUtilities.isLeftMouseButton( e ) )
pressedTabIndex = hitClose ? tabIndex : -1;
setRolloverTabClose( hitClose );
setPressedTabClose( hitClose && tabIndex == pressedTabIndex );
Expand Down

0 comments on commit 0699454

Please sign in to comment.