Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions app/src/cc/arduino/contributions/ContributionsSelfCheck.java
Original file line number Diff line number Diff line change
Expand Up @@ -125,6 +125,9 @@ public void run() {

SwingUtilities.invokeLater(() -> {
Editor ed = base.getActiveEditor();
if (ed == null) {
return;
}
boolean accessibleIde = PreferencesData.getBoolean("ide.accessible");
if (accessibleIde) {
notificationPopup = new NotificationPopup(ed, hyperlinkListener, text, false, this, button1Name, button2Name);
Expand Down
39 changes: 22 additions & 17 deletions app/src/cc/arduino/view/NotificationPopup.java
Original file line number Diff line number Diff line change
Expand Up @@ -220,27 +220,32 @@ public void mouseClicked(MouseEvent e) {
pack();

updateLocation(parent);
ComponentAdapter parentMovedListener = new ComponentAdapter() {
@Override
public void componentMoved(ComponentEvent e) {
updateLocation(parent);
}
if (parent != null) {
ComponentAdapter parentMovedListener = new ComponentAdapter() {
@Override
public void componentMoved(ComponentEvent e) {
updateLocation(parent);
}

@Override
public void componentResized(ComponentEvent e) {
updateLocation(parent);
}
};
parent.addComponentListener(parentMovedListener);
addWindowListener(new WindowAdapter() {
@Override
public void windowClosed(WindowEvent e) {
parent.removeComponentListener(parentMovedListener);
}
});
@Override
public void componentResized(ComponentEvent e) {
updateLocation(parent);
}
};
parent.addComponentListener(parentMovedListener);
addWindowListener(new WindowAdapter() {
@Override
public void windowClosed(WindowEvent e) {
parent.removeComponentListener(parentMovedListener);
}
});
}
}

private void updateLocation(Frame parent) {
if (parent == null) {
return;
}
Point parentLocation = parent.getLocation();

int parentX = Double.valueOf(parentLocation.getX()).intValue();
Expand Down
6 changes: 4 additions & 2 deletions app/src/processing/app/NewBoardListener.java
Original file line number Diff line number Diff line change
Expand Up @@ -73,9 +73,11 @@ public void checkForNewBoardAttached() {
}

SwingUtilities.invokeLater(() -> {

ed = base.getActiveEditor();
NotificationPopup notificationPopup = new NotificationPopup(ed,
if (ed == null) {
return;
}
NotificationPopup notificationPopup = new NotificationPopup(ed,
new UpdatableBoardsLibsFakeURLsHandler(base),
newBoardManagerLink, false);
if (ed.isFocused()) {
Expand Down
Loading