Skip to content

Commit 50d1ccc

Browse files
committed
Made respondsToPointerEvents() more resilient to execution off-EDT by only calling isScrollable() if it is running on the EDT. This is because isScrollable may trigger some mutations from the UI while it determines if the component is scrollable. This likely fixes the issue that #3323 is meant to address.
1 parent b33a1d2 commit 50d1ccc

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

CodenameOne/src/com/codename1/ui/Component.java

+2-1
Original file line numberDiff line numberDiff line change
@@ -4299,7 +4299,8 @@ public void addPullToRefresh(Runnable task){
42994299
* @return True if the pointer responds to pointer events.
43004300
*/
43014301
public boolean respondsToPointerEvents() {
4302-
return isVisible() && isEnabled() && (isScrollable() || isFocusable() || isGrabsPointerEvents() || isDraggable());
4302+
boolean isScrollable = CN.isEdt() ? isScrollable() : (scrollableXFlag() || scrollableYFlag());
4303+
return isVisible() && isEnabled() && (isScrollable || isFocusable() || isGrabsPointerEvents() || isDraggable());
43034304
}
43044305

43054306
private boolean pointerReleaseMaterialPullToRefresh() {

0 commit comments

Comments
 (0)