Skip to content

Commit 265b816

Browse files
committed
fix UI slowdown bug (added proper Begin/EndRefresh calls)
1 parent 113caf0 commit 265b816

File tree

5 files changed

+32
-2
lines changed

5 files changed

+32
-2
lines changed

CHANGELOG.adoc

+1
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ Bug Fixes::
1717
* ide: fix line length check on cursor up/down
1818
* ide: fix vertical scroll area
1919
* ide: fix run memleak
20+
* ide: fix UI slowdown bug (added proper Begin/EndRefresh calls)
2021
* compiler: fix EOL token leak, REM comment processing
2122

2223
== 0.7.1alpha1

src/compiler/ide.c

+11
Original file line numberDiff line numberDiff line change
@@ -1880,6 +1880,9 @@ static void event_cb (uint16_t key, void *user_data)
18801880
{
18811881
IDE_editor ed = (IDE_editor) user_data;
18821882

1883+
#ifdef __amigaos__
1884+
BOOL bInRefresh = FALSE;
1885+
#endif
18831886
switch (key)
18841887
{
18851888
case KEY_CTRL_C:
@@ -1889,6 +1892,10 @@ static void event_cb (uint16_t key, void *user_data)
18891892
break;
18901893

18911894
case KEY_REFRESH:
1895+
#ifdef __amigaos__
1896+
UI_beginRefresh();
1897+
bInRefresh = TRUE;
1898+
#endif
18921899
invalidateAll (ed);
18931900
break;
18941901

@@ -2028,6 +2035,10 @@ static void event_cb (uint16_t key, void *user_data)
20282035

20292036
scroll(ed);
20302037
repaint(ed);
2038+
#ifdef __amigaos__
2039+
if (bInRefresh)
2040+
UI_endRefresh();
2041+
#endif
20312042
}
20322043

20332044
IDE_editor openEditor(void)

src/compiler/run.c

+8-2
Original file line numberDiff line numberDiff line change
@@ -108,11 +108,17 @@ void RUN_start (const char *binfn)
108108

109109
LOG_printf (LOG_DEBUG, "RUN_start: CreateNewProc for %s ...\n", binfn);
110110
g_childProc = CreateNewProcTags(NP_Seglist, (ULONG) g_seglist,
111+
NP_FreeSeglist, FALSE,
112+
NP_Input, 0l,
113+
NP_Output, Output(),
114+
NP_CloseInput, FALSE,
111115
NP_CloseOutput, FALSE,
112116
NP_StackSize, DEFAULT_STACKSIZE,
113117
NP_Name, (ULONG) g_binfn,
114-
NP_Output, Output());
115-
118+
//NP_WindowPtr, 0l,
119+
//NP_HomeDir, 0l,
120+
NP_CopyVars, FALSE,
121+
TAG_DONE);
116122

117123
LOG_printf (LOG_DEBUG, "RUN_start: CreateProc for %s ... done. process: 0x%08lx\n", binfn, (ULONG) g_childProc);
118124

src/compiler/ui.h

+2
Original file line numberDiff line numberDiff line change
@@ -122,6 +122,8 @@ void UI_HelpBrowser (void);
122122

123123
#ifdef __amigaos__
124124
struct MsgPort *UI_debugPort (void);
125+
void UI_beginRefresh (void);
126+
void UI_endRefresh (void);
125127
#endif
126128

127129
bool UI_init (void);

src/compiler/ui_amiga.c

+10
Original file line numberDiff line numberDiff line change
@@ -407,6 +407,16 @@ struct MsgPort *UI_debugPort(void)
407407
return g_debugPort;
408408
}
409409

410+
void UI_beginRefresh (void)
411+
{
412+
BeginRefresh(g_win);
413+
}
414+
415+
void UI_endRefresh (void)
416+
{
417+
EndRefresh(g_win, TRUE);
418+
}
419+
410420
void UI_bell (void)
411421
{
412422
DisplayBeep (NULL);

0 commit comments

Comments
 (0)