diff --git a/uppsrc/CtrlCore/ImageWin32.cpp b/uppsrc/CtrlCore/ImageWin32.cpp index ff3b4f24e..6fd0fb46e 100644 --- a/uppsrc/CtrlCore/ImageWin32.cpp +++ b/uppsrc/CtrlCore/ImageWin32.cpp @@ -14,39 +14,29 @@ bool ImageFallBack ; class BitmapInfo32__ { - Buffer data; + BITMAPV5HEADER bi; public: - operator BITMAPINFO *() { return (BITMAPINFO *)~data; } - operator BITMAPINFOHEADER *() { return (BITMAPINFOHEADER *)~data; } - BITMAPINFOHEADER *operator->() { return (BITMAPINFOHEADER *)~data; } + operator BITMAPINFO *() { return (BITMAPINFO *)&bi; } + operator BITMAPINFOHEADER *() { return (BITMAPINFOHEADER *)&bi; } + BITMAPINFOHEADER *operator->() { return (BITMAPINFOHEADER *)&bi; } BitmapInfo32__(int cx, int cy); }; BitmapInfo32__::BitmapInfo32__(int cx, int cy) { - data.Alloc(sizeof(BITMAPINFOHEADER) + sizeof(RGBQUAD)*256); - BITMAPINFOHEADER *hi = (BITMAPINFOHEADER *) ~data;; - memset8(hi, 0, sizeof(BITMAPINFOHEADER)); - hi->biSize = sizeof(BITMAPINFOHEADER); - hi->biPlanes = 1; -#ifdef PLATFORM_WINCE - hi->biBitCount = 32; - hi->biCompression = BI_BITFIELDS; - dword *x = (dword *)(~data + sizeof(BITMAPINFOHEADER)); - x[2] = 0xff; - x[1] = 0xff00; - x[0] = 0xff0000; -#else - hi->biBitCount = 32; - hi->biCompression = BI_RGB; -#endif - hi->biSizeImage = 0; - hi->biClrUsed = 0; - hi->biClrImportant = 0; - hi->biWidth = cx; - hi->biHeight = -cy; + ZeroMemory(&bi, sizeof(BITMAPV5HEADER)); + bi.bV5Size = sizeof(BITMAPV5HEADER); + bi.bV5Width = cx; + bi.bV5Height = -cy; + bi.bV5Planes = 1; + bi.bV5BitCount = 32; + bi.bV5Compression = BI_BITFIELDS; + bi.bV5RedMask = 0x00FF0000; + bi.bV5GreenMask = 0x0000FF00; + bi.bV5BlueMask = 0x000000FF; + bi.bV5AlphaMask = 0xFF000000; } HBITMAP CreateBitMask(const RGBA *data, Size sz, Size tsz, Size csz, RGBA *ct) diff --git a/uppsrc/CtrlCore/TopWin32.cpp b/uppsrc/CtrlCore/TopWin32.cpp index ed21f534f..91a165f61 100644 --- a/uppsrc/CtrlCore/TopWin32.cpp +++ b/uppsrc/CtrlCore/TopWin32.cpp @@ -79,17 +79,6 @@ void TopWindow::SyncTitle() ::SetWindowTextW(hwnd, ToSystemCharsetW(title)); } -void TopWindow::DeleteIco() -{ - GuiLock __; - LLOG("TopWindow::DeleteIco " << UPP::Name(this)); - if(ico) - DestroyIcon(ico); - if(lico) - DestroyIcon(lico); - ico = lico = NULL; -} - String WindowStyleAsString(dword style, dword exstyle) { String r1; @@ -192,14 +181,41 @@ void TopWindow::SyncCaption() FlashWindowEx(&fi); } } - DeleteIco(); + SetIco(); + Ptr ptr = this; + PostCallback([=] { // windows 11 ignores icon if Window does not start processing messages within ~200ms + if(ptr) ptr->SetIco(); // set it again when we are processing events + }); +} + +void TopWindow::SetIco() +{ + HWND hwnd = GetHWND(); if(hwnd) { - ::SendMessage(hwnd, WM_SETICON, false, (LPARAM)(ico = SystemDraw::IconWin32(icon))); - ::SendMessage(hwnd, WM_SETICON, true, (LPARAM)(lico = SystemDraw::IconWin32(largeicon))); + HICON new_ico = SystemDraw::IconWin32(Nvl(icon, largeicon)); + HICON new_lico = SystemDraw::IconWin32(Nvl(largeicon, icon)); + ::SendMessage(hwnd, WM_SETICON, ICON_SMALL, (LPARAM)(new_ico)); + ::SendMessage(hwnd, WM_SETICON, ICON_BIG, (LPARAM)(new_lico)); + + DeleteIco(); + + ico = new_ico; + lico = new_lico; } } +void TopWindow::DeleteIco() +{ + GuiLock __; + LLOG("TopWindow::DeleteIco " << UPP::Name(this)); + if(ico) + DestroyIcon(ico); + if(lico) + DestroyIcon(lico); + ico = lico = NULL; +} + void TopWindow::CenterRect(HWND hwnd, int center) { GuiLock __; diff --git a/uppsrc/CtrlCore/Win32Msg.i b/uppsrc/CtrlCore/Win32Msg.i index 47e189694..52a1c80ca 100644 --- a/uppsrc/CtrlCore/Win32Msg.i +++ b/uppsrc/CtrlCore/Win32Msg.i @@ -9,6 +9,8 @@ x_MSG(WM_SETFOCUS) x_MSG(WM_KILLFOCUS) x_MSG(WM_ENABLE) x_MSG(WM_SETREDRAW) +x_MSG(WM_SETICON) +x_MSG(WM_GETICON) x_MSG(WM_SETTEXT) x_MSG(WM_GETTEXT) x_MSG(WM_GETTEXTLENGTH) diff --git a/uppsrc/CtrlCore/Win32Top.h b/uppsrc/CtrlCore/Win32Top.h index 5d2cb43da..0a430c3d6 100644 --- a/uppsrc/CtrlCore/Win32Top.h +++ b/uppsrc/CtrlCore/Win32Top.h @@ -7,6 +7,7 @@ private: HICON ico, lico; void DeleteIco(); + void SetIco(); void CenterRect(HWND owner, int center); public: diff --git a/uppsrc/ide/Navigator.cpp b/uppsrc/ide/Navigator.cpp index cbca312fd..b7647f8a8 100644 --- a/uppsrc/ide/Navigator.cpp +++ b/uppsrc/ide/Navigator.cpp @@ -363,6 +363,7 @@ void Navigator::Search() s = Join(Split(s, '.'), "::") + (s.EndsWith(".") ? "::" : ""); int lineno = StrInt(s); nitem.Clear(); + litem.Clear(); Index nests; auto Nest = [&](const AnnotationItem& m, const String& path) { if(m.nspace == m.nest) diff --git a/uppsrc/ide/app.tpp/AndroidBuilder_en-us.tpp b/uppsrc/ide/app.tpp/AndroidBuilder_en-us.tpp index b9d9b8057..63360266e 100644 --- a/uppsrc/ide/app.tpp/AndroidBuilder_en-us.tpp +++ b/uppsrc/ide/app.tpp/AndroidBuilder_en-us.tpp @@ -175,24 +175,36 @@ like this:&] Below is a list with all options grouped in two categories. The first group described options related to Android SDK. The second one is related to Android NDK.&] -[s2; Android SDK settings:&] -[s6;l160;i150;O0; Platform version `- select android platform version&] -[s6;l160;i150;O0; Build tools version `- select android build tools -version&] -[s2; Android NDK settings:&] -[s6;l160;i150;O0;~~~32; BLITZ `- turn on/off BLITZ technology.&] -[s6;l160;i150;O0;~~~32; Target architectures `- specify which architecture -binaries will be built&] -[s6;l160;i150;O0;~~~32; Toolchain `- specify compiler which will +[s2;l160;i150;O0; [* Android SDK settings]&] +[s0;IsFinished() && !IdeIsDebugLock()) IdeEndDebug(); SyncClang(); - bool b = display.GetScreenRect().Contains(GetMousePos()); + Rect r = display.GetScreenRect(); + r.left = max(r.left, r.right - Zx(150)); + bool b = r.Contains(GetMousePos()); if(fileinfo_visible != b) { RefreshFrame(GetFileInfoRect()); fileinfo_visible = b; diff --git a/uppsrc/umk/UppHub.cpp b/uppsrc/umk/UppHub.cpp index e2f0c4d47..4e0b21d6b 100644 --- a/uppsrc/umk/UppHub.cpp +++ b/uppsrc/umk/UppHub.cpp @@ -218,3 +218,30 @@ void UppHubUpdate(const String& main) } dlg.Install(packages, true); } + +void UppHubSetupDirForUmk(const String& hub_dir, const bool auto_hub) +{ + if(!hub_dir.IsEmpty()) { + OverrideHubDir(hub_dir); + return; + } + + if(auto_hub) { + // NOTE: In auto_hub mode we don't want to change default directory or reuse these + // belonging to umk or ide. + DeleteFolderDeep(GetHubDir()); + return; + } + + String cfgdir = GetFileFolder(GetFileFolder(ConfigFile("x"))); + for(const char *q : { "umk", "theide", "ide" }) { + String dir = cfgdir + "/" + q + "/UppHub"; + if(DirectoryExists(dir)) { + for(FindFile ff(dir + "/*"); ff; ff.Next()) + if(ff.IsFolder() && *ff.GetName() != '.') { + OverrideHubDir(dir); + return; + } + } + } +} diff --git a/uppsrc/umk/umake.cpp b/uppsrc/umk/umake.cpp index 898ef1493..a290765a6 100644 --- a/uppsrc/umk/umake.cpp +++ b/uppsrc/umk/umake.cpp @@ -89,21 +89,6 @@ String GenerateVersionNumber() return ""; } -void SetupUmkUppHub() -{ - String cfgdir = GetFileFolder(GetFileFolder(ConfigFile("x"))); - for(const char *q : { "umk", "theide", "ide" }) { - String dir = cfgdir + "/" + q + "/UppHub"; - if(DirectoryExists(dir)) { - for(FindFile ff(dir + "/*"); ff; ff.Next()) - if(ff.IsFolder() && *ff.GetName() != '.') { - OverrideHubDir(dir); - return; - } - } - } -} - CONSOLE_APP_MAIN { SetConfigName("theide"); @@ -136,6 +121,7 @@ CONSOLE_APP_MAIN bool run = false; bool auto_hub = false; bool update_hub = false; + String hub_dir; bool flatpak_build = !GetEnv("FLATPAK_ID").IsEmpty(); String mkf; @@ -144,6 +130,23 @@ CONSOLE_APP_MAIN const Vector& args = CommandLine(); for(int i = 0; i < args.GetCount(); i++) { String a = args[i]; + if(a.StartsWith("--")) { + String ar = a.Right(a.GetCount() - 2); + if(ar == "hub-dir") { + if(i + 1 >= args.GetCount()) { + Puts("UppHub directory not specified"); + SetExitCode(7); + return; + } + + hub_dir = args[++i]; + } else { + Puts(String("Unrecognized parameter \"") + a + "\"."); + SetExitCode(7); + return; + } + } + else if(*a == '-') { for(const char *s = ~a + 1; *s; s++) switch(*s) { @@ -213,10 +216,7 @@ CONSOLE_APP_MAIN param.Add(a); } - if(auto_hub) - DeleteFolderDeep(GetHubDir()); - else - SetupUmkUppHub(); + UppHubSetupDirForUmk(hub_dir, auto_hub); if(param.GetCount() >= 2) { String v = GetUmkFile(param[0] + ".var"); @@ -261,7 +261,7 @@ CONSOLE_APP_MAIN SetExitCode(6); return; } - if (update_hub) + if(update_hub) UppHubUpdate(ide.main); } ide.wspc.Scan(ide.main); diff --git a/uppsrc/umk/umake.h b/uppsrc/umk/umake.h index c9d5f010a..3f9c33554 100644 --- a/uppsrc/umk/umake.h +++ b/uppsrc/umk/umake.h @@ -7,6 +7,7 @@ extern bool SilentMode; bool UppHubAuto(const String& main); void UppHubUpdate(const String& main); +void UppHubSetupDirForUmk(const String& hub_dir, const bool auto_hub); class Console { public: diff --git a/upptst/TestBigIcon/main.cpp b/upptst/TestBigIcon/main.cpp index 3b72fdd06..d64cb229b 100644 --- a/upptst/TestBigIcon/main.cpp +++ b/upptst/TestBigIcon/main.cpp @@ -13,6 +13,12 @@ using namespace Upp; GUI_APP_MAIN { TopWindow win; + win.Title("TEST"); win.LargeIcon(TestImg::Icon()); + DLOG("*********** OPEN MAIN"); + win.OpenMain(); + DLOG("*********** SLEEP 500"); + Sleep(5000); + DLOG("*********** RUN"); win.Run(); }