Skip to content

Commit

Permalink
Made respondsToPointerEvents() more resilient to execution off-EDT by…
Browse files Browse the repository at this point in the history
… 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.
  • Loading branch information
shannah committed Dec 8, 2020
1 parent b33a1d2 commit 50d1ccc
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion CodenameOne/src/com/codename1/ui/Component.java
Original file line number Diff line number Diff line change
Expand Up @@ -4299,7 +4299,8 @@ public void addPullToRefresh(Runnable task){
* @return True if the pointer responds to pointer events.
*/
public boolean respondsToPointerEvents() {
return isVisible() && isEnabled() && (isScrollable() || isFocusable() || isGrabsPointerEvents() || isDraggable());
boolean isScrollable = CN.isEdt() ? isScrollable() : (scrollableXFlag() || scrollableYFlag());
return isVisible() && isEnabled() && (isScrollable || isFocusable() || isGrabsPointerEvents() || isDraggable());
}

private boolean pointerReleaseMaterialPullToRefresh() {
Expand Down

0 comments on commit 50d1ccc

Please sign in to comment.