From eac740c648c151b1988bf50a0bb73ef1b514010e Mon Sep 17 00:00:00 2001 From: "Kirill Lipatov (Leency)" Date: Mon, 14 Dec 2020 15:54:00 +0000 Subject: [PATCH] APP_PLUS: revert last change: so it can handle param again C-- LIBIMG: fix memory leak SYSMON: always on top now WebView: fix: remove garbage on the top of the UTF pages git-svn-id: svn://kolibrios.org@8407 a494cfbc-eb01-0410-851d-a64ba20cac60 --- programs/cmm/app_plus/app_plus.c | 5 +++++ programs/cmm/browser/TWB/TWB.c | 14 +++++++++++++- programs/cmm/lib/obj/libimg.h | 3 +++ programs/cmm/sysmon/sysmon.c | 5 +++-- 4 files changed, 24 insertions(+), 3 deletions(-) diff --git a/programs/cmm/app_plus/app_plus.c b/programs/cmm/app_plus/app_plus.c index d05c748bbf..d3d3d27df2 100644 --- a/programs/cmm/app_plus/app_plus.c +++ b/programs/cmm/app_plus/app_plus.c @@ -70,6 +70,11 @@ need to reboot system to try again." void main() { + if (param) { + SetAdditionalSystemDirectory("kolibrios", #param+1); + ExitProcess(); + } + WaitAutosearch(); CheckKosMounted(); diff --git a/programs/cmm/browser/TWB/TWB.c b/programs/cmm/browser/TWB/TWB.c index 5c338f0d98..b6a0528a4c 100644 --- a/programs/cmm/browser/TWB/TWB.c +++ b/programs/cmm/browser/TWB/TWB.c @@ -282,7 +282,19 @@ void TWebBrowser::ParseHtml(dword _bufpointer, _bufsize){ if (tag.name) { CheckForLineBreak(); Paint(); - if (tag.name) SetStyle(); + if (tag.name) { + EAX = cur_encoding; + $push eax + SetStyle(); + $pop eax + // The thing is that UTF if longer than other encodings. + // So if encoding was changed to UTF than $bufpos position is wrong now, + // and we have to start parse from the very beginning + if (EAX != cur_encoding) && (cur_encoding == CH_UTF8) { + ParseHtml(bufpointer, bufsize); + return; + } + } } break; default: diff --git a/programs/cmm/lib/obj/libimg.h b/programs/cmm/lib/obj/libimg.h index b73dd42098..45ddb55c39 100644 --- a/programs/cmm/lib/obj/libimg.h +++ b/programs/cmm/lib/obj/libimg.h @@ -147,6 +147,9 @@ struct libimg_image :void libimg_image::convert_into(dword _to) { img_convert stdcall(image, 0, _to, 0, 0); + $push eax + img_destroy stdcall(image); + $pop eax if (!EAX) { notify("'LibImg convertation error!'E"); } else { diff --git a/programs/cmm/sysmon/sysmon.c b/programs/cmm/sysmon/sysmon.c index eabdb703eb..949681f45f 100644 --- a/programs/cmm/sysmon/sysmon.c +++ b/programs/cmm/sysmon/sysmon.c @@ -108,7 +108,8 @@ void main() int btn; //dword cpu_frequency = GetCpuFrequency()/1000; load_lib(); - SetEventMask(EVM_REDRAW + EVM_KEY + EVM_BUTTON + EVM_MOUSE + EVM_MOUSE_FILTER); + @SetWindowLayerBehaviour(-1, ZPOS_ALWAYS_TOP); + @SetEventMask(EVM_REDRAW + EVM_KEY + EVM_BUTTON + EVM_MOUSE + EVM_MOUSE_FILTER); loop() switch(@WaitEventTimeout(50)) { case evMouse: @@ -121,7 +122,7 @@ void main() if (select_list.ProcessKey(key_scancode)) SelectList_LineChanged(); break; case evButton: - btn = GetButtonID(); + btn = @GetButtonID(); if (1==btn) ExitProcess(); if (show_system.click(btn)) {