Skip to content

Commit 8c07670

Browse files
committed
UI: avoid flicker from with ALT+F4 -e edit startup
1 parent 4affbce commit 8c07670

File tree

5 files changed

+11
-7
lines changed

5 files changed

+11
-7
lines changed

ChangeLog

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
2019-11-02 (0.12.15)
2+
UI: ALT+F4 from edit/run now returns to edit
3+
UI: avoid flicker from with ALT+F4 -e edit startup
4+
15
2019-02-02 (0.12.15)
26
UI: Edit enter now continues prior line comment
37

src/platform/android/jni/runtime.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -934,7 +934,7 @@ void System::completeKeyword(int index) {
934934
}
935935
}
936936

937-
void System::editSource(strlib::String loadPath) {
937+
void System::editSource(strlib::String loadPath, bool restoreOnExit) {
938938
logEntered();
939939

940940
strlib::String fileName;
@@ -1119,7 +1119,7 @@ void System::editSource(strlib::String loadPath) {
11191119

11201120
// deletes editWidget unless it has been removed
11211121
_output->removeInputs();
1122-
if (!isClosing()) {
1122+
if (!isClosing() && restoreOnExit) {
11231123
_output->selectScreen(prevScreenId);
11241124
}
11251125
logLeaving();

src/platform/sdl/editor.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -155,7 +155,7 @@ void exportBuffer(AnsiWidget *out, const char *text, String &dest, String &token
155155
out->setStatus(buffer);
156156
}
157157

158-
void System::editSource(String loadPath) {
158+
void System::editSource(String loadPath, bool restoreOnExit) {
159159
logEntered();
160160

161161
int w = _output->getWidth();
@@ -510,7 +510,7 @@ void System::editSource(String loadPath) {
510510

511511
// deletes editWidget unless it has been removed
512512
_output->removeInputs();
513-
if (!isClosing()) {
513+
if (!isClosing() && restoreOnExit) {
514514
_output->selectScreen(prevScreenId, false);
515515
}
516516
logLeaving();

src/ui/system.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -581,7 +581,7 @@ void System::runEdit(const char *startupBas) {
581581
while (true) {
582582
if (loadSource(_loadPath)) {
583583
setupPath(_loadPath);
584-
editSource(_loadPath);
584+
editSource(_loadPath, false);
585585
if (isBack() || isClosing()) {
586586
break;
587587
} else {
@@ -656,7 +656,7 @@ void System::runMain(const char *mainBasPath) {
656656
}
657657

658658
if (!_mainBas && isEditReady() && loadSource(_loadPath)) {
659-
editSource(_loadPath);
659+
editSource(_loadPath, true);
660660
if (isBack()) {
661661
_loadPath.clear();
662662
_state = kActiveState;

src/ui/system.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ struct System {
7171
virtual char *getClipboardText() = 0;
7272

7373
protected:
74-
void editSource(strlib::String loadPath);
74+
void editSource(strlib::String loadPath, bool restoreOnExit);
7575
bool execute(const char *bas);
7676
bool fileExists(strlib::String &path);
7777
MAEvent getNextEvent() { return processEvents(1); }

0 commit comments

Comments
 (0)