Skip to content

Commit

Permalink
Display: Make sure the next displayable has a return if is an Alert
Browse files Browse the repository at this point in the history
Some jars create an Alert and set it as the next Displayable without
using the specific method for Alerts. So treat those cases.
  • Loading branch information
AShiningRay committed Dec 16, 2024
1 parent 199aece commit d1b5399
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
4 changes: 4 additions & 0 deletions src/javax/microedition/lcdui/Alert.java
Original file line number Diff line number Diff line change
Expand Up @@ -218,6 +218,10 @@ else if ((key == Canvas.DOWN || key == Canvas.KEY_NUM8) && scrollY < maxScroll)
{
scrollY = Math.min(maxScroll, scrollY + scrollAmount);
}
else if((key == Canvas.FIRE || key == Canvas.KEY_NUM5))
{
defaultListener.commandAction(DISMISS_COMMAND, nextScreen);
}

if (handled) { _invalidate(); }

Expand Down
2 changes: 1 addition & 1 deletion src/javax/microedition/lcdui/Display.java
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,7 @@ public void setCurrent(Displayable next)
next.showNotify();
}
finally { isSettingCurrent = false; }

if(next instanceof Alert) { ((Alert) next).setNextScreen(current); }
current = next;
current.notifySetCurrent();
Mobile.getPlatform().flushGraphics(current.platformImage, 0,0, current.width, current.height);
Expand Down

0 comments on commit d1b5399

Please sign in to comment.