mirror of
https://github.com/JFormDesigner/FlatLaf.git
synced 2025-12-06 14:00:55 +03:00
FlatLaf window decorations on Windows: fixed possible application freeze when using custom component that overrides Component.contains(int x, int y) and invokes SwingUtilities.convertPoint() (or similar) from the overridden method (issue #878)
This commit is contained in:
10
CHANGELOG.md
10
CHANGELOG.md
@@ -1,6 +1,16 @@
|
||||
FlatLaf Change Log
|
||||
==================
|
||||
|
||||
## 3.6-SNAPSHOT
|
||||
|
||||
#### Fixed bugs
|
||||
|
||||
- FlatLaf window decorations on Windows: Fixed possible application freeze when
|
||||
using custom component that overrides `Component.contains(int x, int y)` and
|
||||
invokes `SwingUtilities.convertPoint()` (or similar) from the overridden
|
||||
method. (issue #878)
|
||||
|
||||
|
||||
## 3.5.1
|
||||
|
||||
#### Fixed bugs
|
||||
|
||||
@@ -1079,7 +1079,7 @@ public class FlatTitlePane
|
||||
}
|
||||
|
||||
private boolean isTitleBarCaptionAt( Component c, int x, int y ) {
|
||||
if( !c.isDisplayable() || !c.isVisible() || !c.contains( x, y ) || c == mouseLayer )
|
||||
if( !c.isDisplayable() || !c.isVisible() || !contains( c, x, y ) || c == mouseLayer )
|
||||
return true; // continue checking with next component
|
||||
|
||||
if( c.isEnabled() &&
|
||||
@@ -1131,6 +1131,16 @@ public class FlatTitlePane
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* Same as {@link Component#contains(int, int)}, but not using that method
|
||||
* because it may be overridden by custom components and invoke code that
|
||||
* tries to request AWT tree lock on 'AWT-Windows' thread.
|
||||
* This could freeze the application if AWT tree is already locked on 'AWT-EventQueue' thread.
|
||||
*/
|
||||
private boolean contains( Component c, int x, int y ) {
|
||||
return x >= 0 && y >= 0 && x < c.getWidth() && y < c.getHeight();
|
||||
}
|
||||
|
||||
private int lastCaptionHitTestX;
|
||||
private int lastCaptionHitTestY;
|
||||
private long lastCaptionHitTestTime;
|
||||
|
||||
Reference in New Issue
Block a user