mirror of
https://github.com/JFormDesigner/FlatLaf.git
synced 2025-12-08 15:00:54 +03:00
Window decorations on Linux: limit window resizing/moving to left mouse button (issue #482)
This commit is contained in:
@@ -1016,6 +1016,9 @@ debug*/
|
||||
if( window == null )
|
||||
return; // should newer occur
|
||||
|
||||
if( !SwingUtilities.isLeftMouseButton( e ) )
|
||||
return;
|
||||
|
||||
dragOffset = SwingUtilities.convertPoint( FlatTitlePane.this, e.getPoint(), window );
|
||||
}
|
||||
|
||||
@@ -1030,6 +1033,9 @@ debug*/
|
||||
if( window == null )
|
||||
return; // should newer occur
|
||||
|
||||
if( !SwingUtilities.isLeftMouseButton( e ) )
|
||||
return;
|
||||
|
||||
if( hasNativeCustomDecoration() )
|
||||
return; // do nothing if having native window border
|
||||
|
||||
|
||||
@@ -43,6 +43,7 @@ import javax.swing.JComponent;
|
||||
import javax.swing.JInternalFrame;
|
||||
import javax.swing.JLayeredPane;
|
||||
import javax.swing.JRootPane;
|
||||
import javax.swing.SwingUtilities;
|
||||
import javax.swing.UIManager;
|
||||
import com.formdev.flatlaf.util.SystemInfo;
|
||||
import com.formdev.flatlaf.util.UIScale;
|
||||
@@ -521,7 +522,7 @@ debug*/
|
||||
|
||||
@Override
|
||||
public void mousePressed( MouseEvent e ) {
|
||||
if( !isWindowResizable() )
|
||||
if( !SwingUtilities.isLeftMouseButton( e ) || !isWindowResizable() )
|
||||
return;
|
||||
|
||||
int xOnScreen = e.getXOnScreen();
|
||||
@@ -550,7 +551,7 @@ debug*/
|
||||
|
||||
@Override
|
||||
public void mouseReleased( MouseEvent e ) {
|
||||
if( !isWindowResizable() )
|
||||
if( !SwingUtilities.isLeftMouseButton( e ) || !isWindowResizable() )
|
||||
return;
|
||||
|
||||
dragLeftOffset = dragRightOffset = dragTopOffset = dragBottomOffset = 0;
|
||||
@@ -576,7 +577,7 @@ debug*/
|
||||
|
||||
@Override
|
||||
public void mouseDragged( MouseEvent e ) {
|
||||
if( !isWindowResizable() )
|
||||
if( !SwingUtilities.isLeftMouseButton( e ) || !isWindowResizable() )
|
||||
return;
|
||||
|
||||
int xOnScreen = e.getXOnScreen();
|
||||
|
||||
Reference in New Issue
Block a user