Skip to content

Commit 3c8f201

Browse files
committed
macOS touchbar: Run event handler later to prevent hanging if a dialog needs to be open
1 parent 980b70e commit 3c8f201

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

app/src/processing/app/EditorToolbar.java

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -188,7 +188,15 @@ private void buildTouchBar() {
188188

189189
touchBarButtons[i] = new TouchBarButton();
190190
touchBarButtons[i].setImage(touchBarImages[i][ROLLOVER]);
191-
touchBarButtons[i].setAction(event -> handleSelectionPressed(selection));
191+
touchBarButtons[i].setAction(event -> {
192+
// Run event handler later to prevent hanging if a dialog needs to be open
193+
EventQueue.invokeLater(new Runnable() {
194+
@Override
195+
public void run() {
196+
handleSelectionPressed(selection);
197+
}
198+
});
199+
});
192200

193201
TouchBarItem touchBarItem = new TouchBarItem(title[i], touchBarButtons[i], true);
194202
touchBarItem.setCustomizationLabel(title[i]);

0 commit comments

Comments
 (0)