From db7f15541f452f20296cce6c8b06a06e49c3671e Mon Sep 17 00:00:00 2001 From: Arjun Balgovind <32061677+arjunbalgovind@users.noreply.github.com> Date: Fri, 17 Jan 2020 17:42:17 -0800 Subject: [PATCH] Sync dev/imageResizer with master (#1105) * tweaking language * adjusting elevated permission verbiage to match Windows * npm audit fix to update stuff * slight bump for fabric ui * Remove unwanted files (#1037) Add temp build files to gitignore * Ensure previous search and replace texts are evaluated and updated in the UI at startup (#1043) Ensure stored settings get evaluated after initial enumeration There was a bug where the list view was not getting updated with the results of the search and replace on launch when we are using a stored search or replace text from a previous session. * adding fancy zone opacity setting, enhancement #631 (#1008) * adding fancy zone opacity setting, enhancement #631 * applying zone opacity setting to all zones during zone selection * changing opacity setting to percentage * runner: show message box when restarting with different elevation fails (#1061) Also make the message box appear on top of the settings window. * Fix misaligned display of zones in layout priview and grid editor (#1010) Fix misaligned display of zones in layout preview and grid editor * MSIX: Extract MSIX building functionality from msix_reinstall.ps1 to a separate script (#1068) * MSIX: label PowerToys as Preview (#1090) * MSIX: Code sign msixbundle (#1093) * Update to MSIX README.md (#1095) * Update README.md few adjustments * Update README.md * Update README.md * adding in privacy statement, removing About in dialog (#1087) * adding in privacy statement, removing About in dialog * added Preview * Revert "Fix misaligned display of zones in layout priview and grid editor (#1010)" (#1097) This reverts commit d03690cffd6503ae6d5d1b359cca5fc89c4bad38. * Fix reversed order of zones in layout (#1071) * Shifted three functions to common (#1101) Co-authored-by: Clint Rutkas Co-authored-by: Enrico Giordani Co-authored-by: Chris Davis Co-authored-by: Yosef Durr Co-authored-by: Bartosz Sosnowski Co-authored-by: vldmr11080 <57061786+vldmr11080@users.noreply.github.com> Co-authored-by: yuyoyuppe --- .gitignore | 4 + installer/MSIX/appxmanifest.xml | 2 +- installer/MSIX/build_msix.ps1 | 1 + installer/MSIX/msix_reinstall.ps1 | 7 +- installer/README.md | 17 +- src/common/common.cpp | 27 +++ src/common/common.h | 3 + src/common/common.vcxproj | 4 + src/common/common.vcxproj.filters | 12 ++ src/common/icon_helpers.cpp | 90 ++++++++ src/common/icon_helpers.h | 5 + src/common/window_helpers.cpp | 30 +++ src/common/window_helpers.h | 4 + src/modules/fancyzones/lib/FancyZones.cpp | 7 +- src/modules/fancyzones/lib/FancyZones.h | 1 + src/modules/fancyzones/lib/Settings.cpp | 8 + src/modules/fancyzones/lib/Settings.h | 1 + src/modules/fancyzones/lib/ZoneSet.cpp | 2 +- src/modules/fancyzones/lib/ZoneWindow.cpp | 6 +- src/modules/fancyzones/lib/fancyzones.rc | Bin 5390 -> 5520 bytes src/modules/fancyzones/lib/resource.h | 1 + src/modules/fancyzones/lib/util.h | 6 + .../tests/UnitTests/ZoneWindow.Spec.cpp | 5 + .../powerrename/dll/PowerRenameExt.cpp | 1 + src/modules/powerrename/lib/Helpers.cpp | 115 ----------- src/modules/powerrename/lib/Helpers.h | 3 - .../powerrename/lib/PowerRenameItem.cpp | 2 +- .../powerrename/lib/PowerRenameManager.cpp | 1 + .../testapp/PowerRenameTest.vcxproj | 5 + src/modules/powerrename/ui/PowerRenameUI.cpp | 34 +-- .../unittests/PowerRenameLibUnitTests.vcxproj | 5 + src/runner/main.cpp | 12 +- src/runner/restart_elevated.cpp | 8 + src/runner/restart_elevated.h | 1 + src/runner/runner.rc | Bin 2930 -> 2908 bytes src/settings-web/package-lock.json | 193 +++++++++++------- src/settings-web/package.json | 4 +- .../src/components/GeneralSettings.tsx | 38 ++-- src/settings/settings-html/dist/bundle.js | 10 +- src/settings/settings-html/index-dark.html | 4 +- src/settings/settings-html/index.html | 4 +- 41 files changed, 420 insertions(+), 263 deletions(-) create mode 100644 installer/MSIX/build_msix.ps1 create mode 100644 src/common/icon_helpers.cpp create mode 100644 src/common/icon_helpers.h create mode 100644 src/common/window_helpers.cpp create mode 100644 src/common/window_helpers.h diff --git a/.gitignore b/.gitignore index 1e3f70137ce..491785d4a48 100644 --- a/.gitignore +++ b/.gitignore @@ -330,3 +330,7 @@ ASALocalRun/ # MFractors (Xamarin productivity tool) working folder .mfractor/ + +# Temp build files +src/settings/settings-html/200.html +src/settings/settings-html/404.html diff --git a/installer/MSIX/appxmanifest.xml b/installer/MSIX/appxmanifest.xml index e87670e8cb2..ac0e46a816e 100644 --- a/installer/MSIX/appxmanifest.xml +++ b/installer/MSIX/appxmanifest.xml @@ -26,7 +26,7 @@ - + diff --git a/installer/MSIX/build_msix.ps1 b/installer/MSIX/build_msix.ps1 new file mode 100644 index 00000000000..6762d0286a0 --- /dev/null +++ b/installer/MSIX/build_msix.ps1 @@ -0,0 +1 @@ +makeappx build /v /overwrite /f PackagingLayout.xml /id "PowerToys-x64" /op bin\ diff --git a/installer/MSIX/msix_reinstall.ps1 b/installer/MSIX/msix_reinstall.ps1 index 68a4f21576f..9bd38cef9fb 100644 --- a/installer/MSIX/msix_reinstall.ps1 +++ b/installer/MSIX/msix_reinstall.ps1 @@ -1,6 +1,11 @@ taskkill /f /im explorer.exe + Get-AppxPackage -Name 'PowerToys' | select -ExpandProperty "PackageFullName" | Remove-AppxPackage -makeappx build /v /overwrite /f PackagingLayout.xml /id "PowerToys-x64" /op bin\ + +.\build_msix.ps1 signtool sign /debug /a /fd SHA256 /f PowerToys_TemporaryKey.pfx /p 12345 bin\PowerToys-x64.msix +signtool sign /debug /a /fd SHA256 /f PowerToys_TemporaryKey.pfx /p 12345 bin\PowerToys.msixbundle + Add-AppxPackage .\bin\PowerToys-x64.msix + start $Env:windir\explorer.exe \ No newline at end of file diff --git a/installer/README.md b/installer/README.md index e5821d6dc95..527b736d39a 100644 --- a/installer/README.md +++ b/installer/README.md @@ -7,14 +7,21 @@ * The resulting installer will be built to `PowerToysSetup\bin\Release\PowerToysSetup.msi`. ## Building and installing self-signed PowerToys MSIX package -For the first-time installation, you should generate a self-signed certificate and add it to the [TRCA store](https://docs.microsoft.com/en-us/windows-hardware/drivers/install/trusted-root-certification-authorities-certificate-store). That could be done by simply running ` -generate_self_sign_cert.ps1` from a powershell admin. After that: +For the first-time installation, you'll need to generate a self-signed certificate. The script below will generate and add a cert to your [TRCA store](https://docs.microsoft.com/en-us/windows-hardware/drivers/install/trusted-root-certification-authorities-certificate-store). +1. Open `Developer PowerShell for VS` as an Admin +2. Navigate to your repo's `installer\MSIX` +3. Run `.\generate_self_sign_cert.ps1` -* Make sure you've built the `Release` configuration of `powertoys.sln` -* Launch `msix_reinstall.ps1` from the devenv powershell +## To Build +1. Make sure you've built the `Release` configuration of `powertoys.sln` +2. Open `Developer PowerShell for VS` +3. Navigate to your repo's `installer\MSIX` +4. Run `.\msix_reinstall.ps1` from the devenv powershell +### What msix_reinstall.ps1 does `msix_reinstall.ps1` removes the current PowerToys installation, restarts explorer.exe (to update PowerRename shell extension), builds `PowerToys-x64.msix` package, signs it with a PowerToys_TemporaryKey.pfx, and finally installs it. -## Removing all .msi/.msix PowerToys installations + +#### Removing all .msi/.msix PowerToys installations ```ps $name='PowerToys' Get-AppxPackage -Name $name | select -ExpandProperty "PackageFullName" | Remove-AppxPackage diff --git a/src/common/common.cpp b/src/common/common.cpp index 84ada8d1080..73b3cef1896 100644 --- a/src/common/common.cpp +++ b/src/common/common.cpp @@ -310,6 +310,33 @@ bool run_non_elevated(const std::wstring& file, const std::wstring& params) { return succedded; } +bool run_same_elevation(const std::wstring& file, const std::wstring& params) { + auto executable_args = file; + if (!params.empty()) { + executable_args += L" " + params; + } + STARTUPINFO si = { 0 }; + PROCESS_INFORMATION pi = { 0 }; + auto succedded = CreateProcessW(file.c_str(), + const_cast(executable_args.c_str()), + nullptr, + nullptr, + FALSE, + 0, + nullptr, + nullptr, + &si, + &pi); + if (pi.hProcess) { + CloseHandle(pi.hProcess); + } + if (pi.hThread) { + CloseHandle(pi.hThread); + } + return succedded; +} + + std::wstring get_process_path(HWND window) noexcept { const static std::wstring app_frame_host = L"ApplicationFrameHost.exe"; DWORD pid{}; diff --git a/src/common/common.h b/src/common/common.h index d9e1dc19764..81525f9361c 100644 --- a/src/common/common.h +++ b/src/common/common.h @@ -58,6 +58,9 @@ bool run_elevated(const std::wstring& file, const std::wstring& params); // Run command as non-elevated user, returns true if succeeded bool run_non_elevated(const std::wstring& file, const std::wstring& params); +// Run command with the same elevation, returns true if succedded +bool run_same_elevation(const std::wstring& file, const std::wstring& params); + // Get the executable path or module name for modern apps std::wstring get_process_path(DWORD pid) noexcept; // Get the executable path or module name for modern apps diff --git a/src/common/common.vcxproj b/src/common/common.vcxproj index a8e8eeff9bc..d3a7d5ae083 100644 --- a/src/common/common.vcxproj +++ b/src/common/common.vcxproj @@ -97,6 +97,8 @@ + + @@ -130,10 +132,12 @@ + + diff --git a/src/common/common.vcxproj.filters b/src/common/common.vcxproj.filters index 41b1e417109..197085eedf0 100644 --- a/src/common/common.vcxproj.filters +++ b/src/common/common.vcxproj.filters @@ -81,6 +81,12 @@ Header Files + + Header Files + + + Header Files + @@ -132,5 +138,11 @@ Source Files + + Source Files + + + Source Files + \ No newline at end of file diff --git a/src/common/icon_helpers.cpp b/src/common/icon_helpers.cpp new file mode 100644 index 00000000000..ce4e69d9bc0 --- /dev/null +++ b/src/common/icon_helpers.cpp @@ -0,0 +1,90 @@ +#include "icon_helpers.h" +#include "pch.h" + +HRESULT GetIconIndexFromPath(_In_ PCWSTR path, _Out_ int* index) +{ + *index = 0; + + HRESULT hr = E_FAIL; + + SHFILEINFO shFileInfo = { 0 }; + + if (!PathIsRelative(path)) + { + DWORD attrib = GetFileAttributes(path); + HIMAGELIST himl = (HIMAGELIST)SHGetFileInfo(path, attrib, &shFileInfo, sizeof(shFileInfo), (SHGFI_SYSICONINDEX | SHGFI_SMALLICON | SHGFI_USEFILEATTRIBUTES)); + if (himl) + { + *index = shFileInfo.iIcon; + // We shouldn't free the HIMAGELIST. + hr = S_OK; + } + } + + return hr; +} + +HBITMAP CreateBitmapFromIcon(_In_ HICON hIcon, _In_opt_ UINT width, _In_opt_ UINT height) +{ + HBITMAP hBitmapResult = NULL; + + // Create compatible DC + HDC hDC = CreateCompatibleDC(NULL); + if (hDC != NULL) + { + // Get bitmap rectangle size + RECT rc = { 0 }; + rc.left = 0; + rc.right = (width != 0) ? width : GetSystemMetrics(SM_CXSMICON); + rc.top = 0; + rc.bottom = (height != 0) ? height : GetSystemMetrics(SM_CYSMICON); + + // Create bitmap compatible with DC + BITMAPINFO BitmapInfo; + ZeroMemory(&BitmapInfo, sizeof(BITMAPINFO)); + + BitmapInfo.bmiHeader.biSize = sizeof(BITMAPINFOHEADER); + BitmapInfo.bmiHeader.biWidth = rc.right; + BitmapInfo.bmiHeader.biHeight = rc.bottom; + BitmapInfo.bmiHeader.biPlanes = 1; + BitmapInfo.bmiHeader.biBitCount = 32; + BitmapInfo.bmiHeader.biCompression = BI_RGB; + + HDC hDCBitmap = GetDC(NULL); + + HBITMAP hBitmap = CreateDIBSection(hDCBitmap, &BitmapInfo, DIB_RGB_COLORS, NULL, NULL, 0); + + ReleaseDC(NULL, hDCBitmap); + + if (hBitmap != NULL) + { + // Select bitmap into DC + HBITMAP hBitmapOld = (HBITMAP)SelectObject(hDC, hBitmap); + if (hBitmapOld != NULL) + { + // Draw icon into DC + if (DrawIconEx(hDC, 0, 0, hIcon, rc.right, rc.bottom, 0, NULL, DI_NORMAL)) + { + // Restore original bitmap in DC + hBitmapResult = (HBITMAP)SelectObject(hDC, hBitmapOld); + hBitmapOld = NULL; + hBitmap = NULL; + } + + if (hBitmapOld != NULL) + { + SelectObject(hDC, hBitmapOld); + } + } + + if (hBitmap != NULL) + { + DeleteObject(hBitmap); + } + } + + DeleteDC(hDC); + } + + return hBitmapResult; +} \ No newline at end of file diff --git a/src/common/icon_helpers.h b/src/common/icon_helpers.h new file mode 100644 index 00000000000..46b85cbc245 --- /dev/null +++ b/src/common/icon_helpers.h @@ -0,0 +1,5 @@ +#pragma once +#include "common.h" + +HRESULT GetIconIndexFromPath(_In_ PCWSTR path, _Out_ int* index); +HBITMAP CreateBitmapFromIcon(_In_ HICON hIcon, _In_opt_ UINT width = 0, _In_opt_ UINT height = 0); \ No newline at end of file diff --git a/src/common/window_helpers.cpp b/src/common/window_helpers.cpp new file mode 100644 index 00000000000..678ebe82e14 --- /dev/null +++ b/src/common/window_helpers.cpp @@ -0,0 +1,30 @@ +#include "window_helpers.h" +#include "pch.h" + +HWND CreateMsgWindow(_In_ HINSTANCE hInst, _In_ WNDPROC pfnWndProc, _In_ void* p) +{ + WNDCLASS wc = { 0 }; + + PCWSTR wndClassName = L"MsgWindow"; + + wc.lpfnWndProc = DefWindowProc; + wc.cbWndExtra = sizeof(void*); + wc.hInstance = hInst; + wc.hbrBackground = (HBRUSH)(COLOR_BTNFACE + 1); + wc.lpszClassName = wndClassName; + + RegisterClass(&wc); + + HWND hwnd = CreateWindowEx( + 0, wndClassName, nullptr, 0, 0, 0, 0, 0, HWND_MESSAGE, 0, hInst, nullptr); + if (hwnd) + { + SetWindowLongPtr(hwnd, 0, (LONG_PTR)p); + if (pfnWndProc) + { + SetWindowLongPtr(hwnd, GWLP_WNDPROC, (LONG_PTR)pfnWndProc); + } + } + + return hwnd; +} \ No newline at end of file diff --git a/src/common/window_helpers.h b/src/common/window_helpers.h new file mode 100644 index 00000000000..67167f116c1 --- /dev/null +++ b/src/common/window_helpers.h @@ -0,0 +1,4 @@ +#pragma once +#include "common.h" + +HWND CreateMsgWindow(_In_ HINSTANCE hInst, _In_ WNDPROC pfnWndProc, _In_ void* p); \ No newline at end of file diff --git a/src/modules/fancyzones/lib/FancyZones.cpp b/src/modules/fancyzones/lib/FancyZones.cpp index 311c4aaaf84..27a945298f5 100644 --- a/src/modules/fancyzones/lib/FancyZones.cpp +++ b/src/modules/fancyzones/lib/FancyZones.cpp @@ -68,6 +68,10 @@ struct FancyZones : public winrt::implementsGetSettings().zoneHighlightOpacity; + } LRESULT WndProc(HWND, UINT, WPARAM, LPARAM) noexcept; void OnDisplayChange(DisplayChangeType changeType) noexcept; @@ -321,7 +325,6 @@ void FancyZones::ToggleEditor() noexcept monitor = MonitorFromWindow(foregroundWindow, MONITOR_DEFAULTTOPRIMARY); } - if (!monitor) { return; @@ -352,7 +355,7 @@ void FancyZones::ToggleEditor() noexcept const auto taskbar_x_offset = MulDiv(mi.rcWork.left - mi.rcMonitor.left, DPIAware::DEFAULT_DPI, dpi_x); const auto taskbar_y_offset = MulDiv(mi.rcWork.top - mi.rcMonitor.top, DPIAware::DEFAULT_DPI, dpi_y); - + // Do not scale window params by the dpi, that will be done in the editor - see LayoutModel.Apply const auto x = mi.rcMonitor.left + taskbar_x_offset; const auto y = mi.rcMonitor.top + taskbar_y_offset; diff --git a/src/modules/fancyzones/lib/FancyZones.h b/src/modules/fancyzones/lib/FancyZones.h index 1581204e3a5..035b2e83a3e 100644 --- a/src/modules/fancyzones/lib/FancyZones.h +++ b/src/modules/fancyzones/lib/FancyZones.h @@ -36,6 +36,7 @@ interface __declspec(uuid("{5C8D99D6-34B2-4F4A-A8E5-7483F6869775}")) IZoneWindow IFACEMETHOD_(void, MoveWindowsOnActiveZoneSetChange)() = 0; IFACEMETHOD_(COLORREF, GetZoneHighlightColor)() = 0; IFACEMETHOD_(GUID, GetCurrentMonitorZoneSetId)(HMONITOR monitor) = 0; + IFACEMETHOD_(int, GetZoneHighlightOpacity)() = 0; }; winrt::com_ptr MakeFancyZones(HINSTANCE hinstance, IFancyZonesSettings* settings) noexcept; diff --git a/src/modules/fancyzones/lib/Settings.cpp b/src/modules/fancyzones/lib/Settings.cpp index b15ada70fc7..09ded242de1 100644 --- a/src/modules/fancyzones/lib/Settings.cpp +++ b/src/modules/fancyzones/lib/Settings.cpp @@ -49,6 +49,7 @@ struct FancyZonesSettings : winrt::implements excludedAppsArray; diff --git a/src/modules/fancyzones/lib/ZoneSet.cpp b/src/modules/fancyzones/lib/ZoneSet.cpp index 30489d596ff..6b4b90ec597 100644 --- a/src/modules/fancyzones/lib/ZoneSet.cpp +++ b/src/modules/fancyzones/lib/ZoneSet.cpp @@ -49,7 +49,7 @@ IFACEMETHODIMP_(winrt::com_ptr) ZoneSet::ZoneFromPoint(POINT pt) noexcept winrt::com_ptr smallestKnownZone = nullptr; // To reduce redundant calculations, we will store the last known zones area. int smallestKnownZoneArea = INT32_MAX; - for (auto iter = m_zones.begin(); iter != m_zones.end(); iter++) + for (auto iter = m_zones.rbegin(); iter != m_zones.rend(); iter++) { if (winrt::com_ptr zone = iter->try_as()) { diff --git a/src/modules/fancyzones/lib/ZoneWindow.cpp b/src/modules/fancyzones/lib/ZoneWindow.cpp index 89768025b1b..7bf747c7648 100644 --- a/src/modules/fancyzones/lib/ZoneWindow.cpp +++ b/src/modules/fancyzones/lib/ZoneWindow.cpp @@ -546,14 +546,14 @@ void ZoneWindow::DrawActiveZoneSet(wil::unique_hdc& hdc, RECT const& clientRect) // { fillAlpha, fill, borderAlpha, border, thickness } ColorSetting const colorHints { 225, RGB(81, 92, 107), 255, RGB(104, 118, 138), -2 }; - ColorSetting colorViewer { 225, 0, 255, RGB(40, 50, 60), -2 }; - ColorSetting colorHighlight { 225, 0, 255, 0, -2 }; + ColorSetting colorViewer { OpacitySettingToAlpha(m_host->GetZoneHighlightOpacity()), 0, 255, RGB(40, 50, 60), -2 }; + ColorSetting colorHighlight { OpacitySettingToAlpha(m_host->GetZoneHighlightOpacity()), 0, 255, 0, -2 }; ColorSetting const colorFlash { 200, RGB(81, 92, 107), 200, RGB(104, 118, 138), -2 }; auto zones = m_activeZoneSet->GetZones(); const size_t maxColorIndex = min(size(zones) - 1, size(colors) - 1); size_t colorIndex = maxColorIndex; - for (auto iter = zones.rbegin(); iter != zones.rend(); iter++) + for (auto iter = zones.begin(); iter != zones.end(); iter++) { winrt::com_ptr zone = iter->try_as(); if (!zone) diff --git a/src/modules/fancyzones/lib/fancyzones.rc b/src/modules/fancyzones/lib/fancyzones.rc index a48e87df1495ef825cb097a1df2e69df1e56c4f7..f021414f3a526f04c34217ea2442ea8a35e9a783 100644 GIT binary patch delta 64 zcmeCvnxMTwk8ko0COPI{hWN>X9K!tZ4E_uO42}%W44w=j43U#{Ih2L{844H@8IlFK-v9sr delta 12 TcmbQB-KVudk8kq^z6Wdo9`FRW diff --git a/src/modules/fancyzones/lib/resource.h b/src/modules/fancyzones/lib/resource.h index 5a11a3da333..158b68a3e04 100644 --- a/src/modules/fancyzones/lib/resource.h +++ b/src/modules/fancyzones/lib/resource.h @@ -13,3 +13,4 @@ #define IDS_SETTING_LAUNCH_EDITOR_DESCRIPTION 113 #define IDS_SETTING_LAUNCH_EDITOR_HOTKEY_LABEL 114 #define IDS_SETTING_EXCLCUDED_APPS_DESCRIPTION 115 +#define IDS_SETTINGS_HIGHLIGHT_OPACITY 116 diff --git a/src/modules/fancyzones/lib/util.h b/src/modules/fancyzones/lib/util.h index dd6e0605c39..9f59f21121d 100644 --- a/src/modules/fancyzones/lib/util.h +++ b/src/modules/fancyzones/lib/util.h @@ -133,3 +133,9 @@ inline void ParseDeviceId(PCWSTR deviceId, PWSTR parsedId, size_t size) StringCchCopy(parsedId, size, L"FallbackDevice"); } } + +inline int OpacitySettingToAlpha(int opacity) +{ + // convert percentage to a 0-255 alpha value + return opacity * 2.55; +} diff --git a/src/modules/fancyzones/tests/UnitTests/ZoneWindow.Spec.cpp b/src/modules/fancyzones/tests/UnitTests/ZoneWindow.Spec.cpp index 0319e24d370..82dac19251f 100644 --- a/src/modules/fancyzones/tests/UnitTests/ZoneWindow.Spec.cpp +++ b/src/modules/fancyzones/tests/UnitTests/ZoneWindow.Spec.cpp @@ -22,6 +22,11 @@ namespace FancyZonesUnitTests { return m_guid; } + IFACEMETHODIMP_(int) + GetZoneHighlightOpacity() noexcept + { + return 100; + } GUID m_guid; }; diff --git a/src/modules/powerrename/dll/PowerRenameExt.cpp b/src/modules/powerrename/dll/PowerRenameExt.cpp index a2d98c19dbc..d7d4f05eaf8 100644 --- a/src/modules/powerrename/dll/PowerRenameExt.cpp +++ b/src/modules/powerrename/dll/PowerRenameExt.cpp @@ -5,6 +5,7 @@ #include #include #include +#include #include #include "resource.h" diff --git a/src/modules/powerrename/lib/Helpers.cpp b/src/modules/powerrename/lib/Helpers.cpp index f91b0bc6d57..0fc92577a57 100644 --- a/src/modules/powerrename/lib/Helpers.cpp +++ b/src/modules/powerrename/lib/Helpers.cpp @@ -2,94 +2,6 @@ #include "Helpers.h" #include -HRESULT GetIconIndexFromPath(_In_ PCWSTR path, _Out_ int* index) -{ - *index = 0; - - HRESULT hr = E_FAIL; - - SHFILEINFO shFileInfo = { 0 }; - - if (!PathIsRelative(path)) - { - DWORD attrib = GetFileAttributes(path); - HIMAGELIST himl = (HIMAGELIST)SHGetFileInfo(path, attrib, &shFileInfo, sizeof(shFileInfo), (SHGFI_SYSICONINDEX | SHGFI_SMALLICON | SHGFI_USEFILEATTRIBUTES)); - if (himl) - { - *index = shFileInfo.iIcon; - // We shouldn't free the HIMAGELIST. - hr = S_OK; - } - } - - return hr; -} - -HBITMAP CreateBitmapFromIcon(_In_ HICON hIcon, _In_opt_ UINT width, _In_opt_ UINT height) -{ - HBITMAP hBitmapResult = NULL; - - // Create compatible DC - HDC hDC = CreateCompatibleDC(NULL); - if (hDC != NULL) - { - // Get bitmap rectangle size - RECT rc = { 0 }; - rc.left = 0; - rc.right = (width != 0) ? width : GetSystemMetrics(SM_CXSMICON); - rc.top = 0; - rc.bottom = (height != 0) ? height : GetSystemMetrics(SM_CYSMICON); - - // Create bitmap compatible with DC - BITMAPINFO BitmapInfo; - ZeroMemory(&BitmapInfo, sizeof(BITMAPINFO)); - - BitmapInfo.bmiHeader.biSize = sizeof(BITMAPINFOHEADER); - BitmapInfo.bmiHeader.biWidth = rc.right; - BitmapInfo.bmiHeader.biHeight = rc.bottom; - BitmapInfo.bmiHeader.biPlanes = 1; - BitmapInfo.bmiHeader.biBitCount = 32; - BitmapInfo.bmiHeader.biCompression = BI_RGB; - - HDC hDCBitmap = GetDC(NULL); - - HBITMAP hBitmap = CreateDIBSection(hDCBitmap, &BitmapInfo, DIB_RGB_COLORS, NULL, NULL, 0); - - ReleaseDC(NULL, hDCBitmap); - - if (hBitmap != NULL) - { - // Select bitmap into DC - HBITMAP hBitmapOld = (HBITMAP)SelectObject(hDC, hBitmap); - if (hBitmapOld != NULL) - { - // Draw icon into DC - if (DrawIconEx(hDC, 0, 0, hIcon, rc.right, rc.bottom, 0, NULL, DI_NORMAL)) - { - // Restore original bitmap in DC - hBitmapResult = (HBITMAP)SelectObject(hDC, hBitmapOld); - hBitmapOld = NULL; - hBitmap = NULL; - } - - if (hBitmapOld != NULL) - { - SelectObject(hDC, hBitmapOld); - } - } - - if (hBitmap != NULL) - { - DeleteObject(hBitmap); - } - } - - DeleteDC(hDC); - } - - return hBitmapResult; -} - HRESULT _ParseEnumItems(_In_ IEnumShellItems* pesi, _In_ IPowerRenameManager* psrm, _In_ int depth = 0) { HRESULT hr = E_INVALIDARG; @@ -167,33 +79,6 @@ HRESULT EnumerateDataObject(_In_ IUnknown* dataSource, _In_ IPowerRenameManager* return hr; } -HWND CreateMsgWindow(_In_ HINSTANCE hInst, _In_ WNDPROC pfnWndProc, _In_ void* p) -{ - WNDCLASS wc = { 0 }; - PWSTR wndClassName = L"MsgWindow"; - - wc.lpfnWndProc = DefWindowProc; - wc.cbWndExtra = sizeof(void*); - wc.hInstance = hInst; - wc.hbrBackground = (HBRUSH)(COLOR_BTNFACE + 1); - wc.lpszClassName = wndClassName; - - RegisterClass(&wc); - - HWND hwnd = CreateWindowEx( - 0, wndClassName, nullptr, 0, 0, 0, 0, 0, HWND_MESSAGE, 0, hInst, nullptr); - if (hwnd) - { - SetWindowLongPtr(hwnd, 0, (LONG_PTR)p); - if (pfnWndProc) - { - SetWindowLongPtr(hwnd, GWLP_WNDPROC, (LONG_PTR)pfnWndProc); - } - } - - return hwnd; -} - BOOL GetEnumeratedFileName(__out_ecount(cchMax) PWSTR pszUniqueName, UINT cchMax, __in PCWSTR pszTemplate, __in_opt PCWSTR pszDir, unsigned long ulMinLong, __inout unsigned long* pulNumUsed) { PWSTR pszName = nullptr; diff --git a/src/modules/powerrename/lib/Helpers.h b/src/modules/powerrename/lib/Helpers.h index f917c4c9bfe..446954d2ff2 100644 --- a/src/modules/powerrename/lib/Helpers.h +++ b/src/modules/powerrename/lib/Helpers.h @@ -4,9 +4,6 @@ #include HRESULT EnumerateDataObject(_In_ IUnknown* pdo, _In_ IPowerRenameManager* psrm); -HRESULT GetIconIndexFromPath(_In_ PCWSTR path, _Out_ int* index); -HBITMAP CreateBitmapFromIcon(_In_ HICON hIcon, _In_opt_ UINT width = 0, _In_opt_ UINT height = 0); -HWND CreateMsgWindow(_In_ HINSTANCE hInst, _In_ WNDPROC pfnWndProc, _In_ void* p); BOOL GetEnumeratedFileName( __out_ecount(cchMax) PWSTR pszUniqueName, UINT cchMax, diff --git a/src/modules/powerrename/lib/PowerRenameItem.cpp b/src/modules/powerrename/lib/PowerRenameItem.cpp index c7207c34171..83aded4c2b9 100644 --- a/src/modules/powerrename/lib/PowerRenameItem.cpp +++ b/src/modules/powerrename/lib/PowerRenameItem.cpp @@ -1,6 +1,6 @@ #include "stdafx.h" #include "PowerRenameItem.h" -#include "helpers.h" +#include "icon_helpers.h" int CPowerRenameItem::s_id = 0; diff --git a/src/modules/powerrename/lib/PowerRenameManager.cpp b/src/modules/powerrename/lib/PowerRenameManager.cpp index 6a0d387ae0c..046ff3e18a0 100644 --- a/src/modules/powerrename/lib/PowerRenameManager.cpp +++ b/src/modules/powerrename/lib/PowerRenameManager.cpp @@ -4,6 +4,7 @@ #include #include #include "helpers.h" +#include "window_helpers.h" #include #include "trace.h" diff --git a/src/modules/powerrename/testapp/PowerRenameTest.vcxproj b/src/modules/powerrename/testapp/PowerRenameTest.vcxproj index 1a9bd6b9904..1e06bf571dd 100644 --- a/src/modules/powerrename/testapp/PowerRenameTest.vcxproj +++ b/src/modules/powerrename/testapp/PowerRenameTest.vcxproj @@ -185,6 +185,11 @@ + + + {74485049-c722-400f-abe5-86ac52d929b3} + + diff --git a/src/modules/powerrename/ui/PowerRenameUI.cpp b/src/modules/powerrename/ui/PowerRenameUI.cpp index 66c89681bfe..4534a3cfe88 100644 --- a/src/modules/powerrename/ui/PowerRenameUI.cpp +++ b/src/modules/powerrename/ui/PowerRenameUI.cpp @@ -585,45 +585,21 @@ INT_PTR CPowerRenameUI::_DlgProc(UINT uMsg, WPARAM wParam, LPARAM lParam) void CPowerRenameUI::_OnInitDlg() { - // Initialize from stored settings - _ReadSettings(); - m_hwndLV = GetDlgItem(m_hwnd, IDC_LIST_PREVIEW); m_listview.Init(m_hwndLV); - // Initialize checkboxes from flags - if (m_spsrm) - { - // Check if we should read flags from settings - // or the defaults from the manager. - DWORD flags = 0; - if (CSettings::GetPersistState()) - { - flags = CSettings::GetFlags(); - wchar_t buffer[MAX_INPUT_STRING_LEN]; - buffer[0] = L'\0'; - CSettings::GetSearchText(buffer, ARRAYSIZE(buffer)); - SetDlgItemText(m_hwnd, IDC_EDIT_SEARCHFOR, buffer); - - buffer[0] = L'\0'; - CSettings::GetReplaceText(buffer, ARRAYSIZE(buffer)); - SetDlgItemText(m_hwnd, IDC_EDIT_REPLACEWITH, buffer); - } - else - { - m_spsrm->get_flags(&flags); - } - - _SetCheckboxesFromFlags(flags); - } - if (m_dataSource) { // Populate the manager from the data object _EnumerateItems(m_dataSource); } + // Initialize from stored settings. Do this now in case we have + // restored a previous search or replace text that needs to be + // evaluated against the items we just enumerated. + _ReadSettings(); + // Load the main icon LoadIconWithScaleDown(g_hInst, MAKEINTRESOURCE(IDI_RENAME), 32, 32, &m_iconMain); diff --git a/src/modules/powerrename/unittests/PowerRenameLibUnitTests.vcxproj b/src/modules/powerrename/unittests/PowerRenameLibUnitTests.vcxproj index 009ceecd4e1..ac4f85b540a 100644 --- a/src/modules/powerrename/unittests/PowerRenameLibUnitTests.vcxproj +++ b/src/modules/powerrename/unittests/PowerRenameLibUnitTests.vcxproj @@ -192,6 +192,11 @@ + + + {74485049-c722-400f-abe5-86ac52d929b3} + + diff --git a/src/runner/main.cpp b/src/runner/main.cpp index b800b5cb26c..0321f1927e0 100644 --- a/src/runner/main.cpp +++ b/src/runner/main.cpp @@ -80,7 +80,7 @@ int runner() catch (std::runtime_error& err) { std::string err_what = err.what(); - MessageBoxW(NULL, std::wstring(err_what.begin(), err_what.end()).c_str(), L"Error", MB_OK | MB_ICONERROR); + MessageBoxW(nullptr, std::wstring(err_what.begin(), err_what.end()).c_str(), GET_RESOURCE_STRING(IDS_ERROR).c_str(), MB_OK | MB_ICONERROR | MB_SETFOREGROUND); result = -1; } Trace::UnregisterProvider(); @@ -92,8 +92,8 @@ int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine WCHAR username[UNLEN + 1]; DWORD username_length = UNLEN + 1; GetUserNameW(username, &username_length); - auto runner_mutex = CreateMutexW(NULL, TRUE, (std::wstring(L"Local\\PowerToyRunMutex") + username).c_str()); - if (runner_mutex == NULL || GetLastError() == ERROR_ALREADY_EXISTS) + auto runner_mutex = CreateMutexW(nullptr, TRUE, (std::wstring(L"Local\\PowerToyRunMutex") + username).c_str()); + if (runner_mutex == nullptr || GetLastError() == ERROR_ALREADY_EXISTS) { // The app is already running return 0; @@ -124,7 +124,7 @@ int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine catch (std::runtime_error& err) { std::string err_what = err.what(); - MessageBoxW(NULL, std::wstring(err_what.begin(), err_what.end()).c_str(), GET_RESOURCE_STRING(IDS_ERROR).c_str(), MB_OK | MB_ICONERROR); + MessageBoxW(nullptr, std::wstring(err_what.begin(), err_what.end()).c_str(), GET_RESOURCE_STRING(IDS_ERROR).c_str(), MB_OK | MB_ICONERROR); result = -1; } ReleaseMutex(runner_mutex); @@ -135,7 +135,9 @@ int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine { auto text = is_process_elevated() ? GET_RESOURCE_STRING(IDS_COULDNOT_RESTART_NONELEVATED) : GET_RESOURCE_STRING(IDS_COULDNOT_RESTART_ELEVATED); - MessageBoxW(NULL, text.c_str(), GET_RESOURCE_STRING(IDS_ERROR).c_str(), MB_OK | MB_ICONERROR); + MessageBoxW(nullptr, text.c_str(), GET_RESOURCE_STRING(IDS_ERROR).c_str(), MB_OK | MB_ICONERROR | MB_SETFOREGROUND); + + restart_same_elevation(); result = -1; } } diff --git a/src/runner/restart_elevated.cpp b/src/runner/restart_elevated.cpp index 0f05aa86a01..410c9884e04 100644 --- a/src/runner/restart_elevated.cpp +++ b/src/runner/restart_elevated.cpp @@ -41,3 +41,11 @@ bool restart_if_scheduled() return false; } } + +bool restart_same_elevation() +{ + constexpr DWORD exe_path_size = 0xFFFF; + auto exe_path = std::make_unique(exe_path_size); + GetModuleFileNameW(nullptr, exe_path.get(), exe_path_size); + return run_same_elevation(exe_path.get(), {}); +} diff --git a/src/runner/restart_elevated.h b/src/runner/restart_elevated.h index 8a84f7abe0b..22cc7f30613 100644 --- a/src/runner/restart_elevated.h +++ b/src/runner/restart_elevated.h @@ -3,3 +3,4 @@ void schedule_restart_as_elevated(); void schedule_restart_as_non_elevated(); bool is_restart_scheduled(); bool restart_if_scheduled(); +bool restart_same_elevation(); diff --git a/src/runner/runner.rc b/src/runner/runner.rc index 239c9f72c6ad32ff9f192a2cf65ee9a592257ce5..f776ab26fe11b9f69edfa3113daca8d02dc0ef9c 100644 GIT binary patch delta 81 zcmew)c1LVO2IFJ}CJjynhEj%NhE#^4$$J^&fg(DRi3}+WxeS>Mc|csuP{L5ekO(C6 gfhw|@lqVnJ5ZT|!h8!R+V@PBu0n#Z93Je7dML@Y^Ag`FA jc=Alfc(9)DjJooK)Y>vBZ!Td9V4SSQBDDDya}zrN#V{Qm diff --git a/src/settings-web/package-lock.json b/src/settings-web/package-lock.json index 37f457cd2b4..744b97e65e2 100644 --- a/src/settings-web/package-lock.json +++ b/src/settings-web/package-lock.json @@ -1139,9 +1139,9 @@ } }, "@microsoft/load-themed-styles": { - "version": "1.10.12", - "resolved": "https://registry.npmjs.org/@microsoft/load-themed-styles/-/load-themed-styles-1.10.12.tgz", - "integrity": "sha512-1qdD1Cff3DZHk8dn5SIupiIyDdB1nHWn/Ig/0tosJatD0ly4WlaSQwBDKeu+Ta2CAw7BxFf1U9K19yOrDT+Nog==" + "version": "1.10.26", + "resolved": "https://registry.npmjs.org/@microsoft/load-themed-styles/-/load-themed-styles-1.10.26.tgz", + "integrity": "sha512-N//pFTBL/iCSrMuDoLvBLpgGjlk+MgKX2kyFI3bJVb+LRozeyWCOZVRcR8aMKiYHdqwy5isu2Frp8drvWx7RbA==" }, "@microsoft/package-deps-hash": { "version": "2.2.159", @@ -1411,33 +1411,25 @@ "dev": true }, "@uifabric/azure-themes": { - "version": "7.0.9", - "resolved": "https://registry.npmjs.org/@uifabric/azure-themes/-/azure-themes-7.0.9.tgz", - "integrity": "sha512-pTZO8lyvCjPhc3WTDln5bSGqbvQpb+iL9NTwGlOgNSOKWNbPzxh6IvQdGVmFCUiwYl8psaQbCGdCH5+tsEofFQ==", + "version": "7.0.10", + "resolved": "https://registry.npmjs.org/@uifabric/azure-themes/-/azure-themes-7.0.10.tgz", + "integrity": "sha512-ZKGxiz2ZjL3exOrF3bROlt8veoujn44jK/bJlto/i/WOrK07OMB4Am9hgsXTah1099aGxljgBJ/79D6eY9NEOA==", "requires": { - "@uifabric/merge-styles": "^7.5.1", + "@uifabric/merge-styles": "^7.8.0", "@uifabric/set-version": "^7.0.2", - "office-ui-fabric-react": "^7.31.3", - "tslib": "^1.7.1" - } - }, - "@uifabric/example-data": { - "version": "7.0.1", - "resolved": "https://registry.npmjs.org/@uifabric/example-data/-/example-data-7.0.1.tgz", - "integrity": "sha512-HWw2lAbF5Fn1NhmxxEpzgWrprEsQ7+Ut71zpAHdCJoVCVeesHl03gY/obBIz8ogrufW0RIlkrNSredy6uRzYDQ==", - "requires": { + "office-ui-fabric-react": "^7.59.0", "tslib": "^1.7.1" } }, "@uifabric/foundation": { - "version": "7.4.4", - "resolved": "https://registry.npmjs.org/@uifabric/foundation/-/foundation-7.4.4.tgz", - "integrity": "sha512-I4zrJXq2B00+LIzxcCDyi3+lx/sm0DzDdSFvQQp3DS9eiL8TzcjZTneRr32TQuVlA0Q7nFQClIXjglEo8+quFA==", + "version": "7.5.0", + "resolved": "https://registry.npmjs.org/@uifabric/foundation/-/foundation-7.5.0.tgz", + "integrity": "sha512-eymMyV3e+MFCkcfC1AFIAzVP/h6/QvDcYb1l6K3IaG1QG47ZwijJJXseEvNDjimfUiJhez9H7cSsRZPIIJ5MaQ==", "requires": { - "@uifabric/merge-styles": "^7.7.0", + "@uifabric/merge-styles": "^7.8.0", "@uifabric/set-version": "^7.0.2", "@uifabric/styling": "^7.7.2", - "@uifabric/utilities": "^7.4.0", + "@uifabric/utilities": "^7.5.0", "tslib": "^1.7.1" } }, @@ -1452,9 +1444,9 @@ } }, "@uifabric/merge-styles": { - "version": "7.7.0", - "resolved": "https://registry.npmjs.org/@uifabric/merge-styles/-/merge-styles-7.7.0.tgz", - "integrity": "sha512-VMLSHKNp4dFDOZTdXeXhNvkrdmxjTwP4MaUf6yLeMkD1qf36/uFAN4nQ7jVAr6RC5cVMklmxN6FtNj+6+bHGfA==", + "version": "7.8.1", + "resolved": "https://registry.npmjs.org/@uifabric/merge-styles/-/merge-styles-7.8.1.tgz", + "integrity": "sha512-DJBXNsYfrYQ3wCjOE197JqXTkqwfPlGJhQkhYMBwO76ovKBQyJxT8m6NL8og5F9blnIBdCJPrvRUz/21/WlUGg==", "requires": { "@uifabric/set-version": "^7.0.2", "tslib": "^1.7.1" @@ -1479,23 +1471,23 @@ } }, "@uifabric/styling": { - "version": "7.7.2", - "resolved": "https://registry.npmjs.org/@uifabric/styling/-/styling-7.7.2.tgz", - "integrity": "sha512-5xQbz5r4+XeWjb1omHara/1Hdk+dsNSUkZAw6sp/tnv/cGFea4+hMuSmSaTG6T78Osiy59UG+qw7Ax/spfr2EQ==", + "version": "7.8.0", + "resolved": "https://registry.npmjs.org/@uifabric/styling/-/styling-7.8.0.tgz", + "integrity": "sha512-mRNQUvfasOWW0/RJARA5mPHmPMORJXrNDoOpjoTNt+J6uj1/sA8km0l/AQtZ6b36bqo6kkaQgB9+msRobmdpiQ==", "requires": { "@microsoft/load-themed-styles": "^1.7.13", - "@uifabric/merge-styles": "^7.7.0", + "@uifabric/merge-styles": "^7.8.1", "@uifabric/set-version": "^7.0.2", - "@uifabric/utilities": "^7.2.0", + "@uifabric/utilities": "^7.8.0", "tslib": "^1.7.1" } }, "@uifabric/utilities": { - "version": "7.5.0", - "resolved": "https://registry.npmjs.org/@uifabric/utilities/-/utilities-7.5.0.tgz", - "integrity": "sha512-h9XwZVaKyLN3Ss4G+bXFWsmCzExID/SKbO64XPjsCIhuxVYsTg6/hDrvyU4TCEx06/ehXfdHRmyjCYL1PNdDMg==", + "version": "7.8.0", + "resolved": "https://registry.npmjs.org/@uifabric/utilities/-/utilities-7.8.0.tgz", + "integrity": "sha512-ow3v9arBhe5C8GvklIuqD3PZMSNnY04HC7JoQVW301Q/gH+BGVECLTBzrFm/m66GCetMksDOMnkoBQSk0poPOQ==", "requires": { - "@uifabric/merge-styles": "^7.7.0", + "@uifabric/merge-styles": "^7.8.1", "@uifabric/set-version": "^7.0.2", "prop-types": "^15.5.10", "tslib": "^1.7.1" @@ -3039,9 +3031,9 @@ } }, "commander": { - "version": "2.20.0", - "resolved": "https://registry.npmjs.org/commander/-/commander-2.20.0.tgz", - "integrity": "sha512-7j2y+40w61zy6YC2iRNpUe/NwhNyoXrYpHMrSunaMG64nRnaf96zO/KMQR4OyN/UnE5KLyEBnKHd4aG3rskjpQ==", + "version": "2.20.3", + "resolved": "https://registry.npmjs.org/commander/-/commander-2.20.3.tgz", + "integrity": "sha512-GpVkmM8vF2vQUkj2LvZmD35JxeJOLCwJ9cUkugyk2nuhbv3+mJvpLYYt+0+USMxE+oj+ey/lJEnhZw75x/OMcQ==", "dev": true }, "commondir": { @@ -5536,9 +5528,9 @@ "dev": true }, "handlebars": { - "version": "4.4.2", - "resolved": "https://registry.npmjs.org/handlebars/-/handlebars-4.4.2.tgz", - "integrity": "sha512-cIv17+GhL8pHHnRJzGu2wwcthL5sb8uDKBHvZ2Dtu5s1YNt0ljbzKbamnc+gr69y7bzwQiBdr5+hOpRd5pnOdg==", + "version": "4.5.3", + "resolved": "https://registry.npmjs.org/handlebars/-/handlebars-4.5.3.tgz", + "integrity": "sha512-3yPecJoJHK/4c6aZhSvxOyG4vJKDshV36VHp0iVCDVh7o9w2vwi3NSnL2MMPj3YdduqaBcu7cGbggJQM0br9xA==", "dev": true, "requires": { "neo-async": "^2.6.0", @@ -5943,12 +5935,12 @@ "dev": true }, "https-proxy-agent": { - "version": "2.2.1", - "resolved": "https://registry.npmjs.org/https-proxy-agent/-/https-proxy-agent-2.2.1.tgz", - "integrity": "sha512-HPCTS1LW51bcyMYbxUIOO4HEOlQ1/1qRaFWcyxvwaqUS9TY88aoEuHUY33kuAh1YhVVaDQhLZsnPd+XNARWZlQ==", + "version": "2.2.4", + "resolved": "https://registry.npmjs.org/https-proxy-agent/-/https-proxy-agent-2.2.4.tgz", + "integrity": "sha512-OmvfoQ53WLjtA9HeYP9RNrWMJzzAz1JGaSFr1nijg0PVR1JaD/xbJq1mdEIIlxGpXp9eSe/O2LgU9DJmTPd0Eg==", "dev": true, "requires": { - "agent-base": "^4.1.0", + "agent-base": "^4.3.0", "debug": "^3.1.0" } }, @@ -6061,6 +6053,12 @@ "integrity": "sha1-8w9xbI4r00bHtn0985FVZqfAVgc=", "dev": true }, + "infer-owner": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/infer-owner/-/infer-owner-1.0.4.tgz", + "integrity": "sha512-IClj+Xz94+d7irH5qRyfJonOdfTzuDaifE6ZPWfx0N0+/ATZCbuTPq2prFl526urkQd90WyUKIh1DfBQ2hMz9A==", + "dev": true + }, "inflight": { "version": "1.0.6", "resolved": "https://registry.npmjs.org/inflight/-/inflight-1.0.6.tgz", @@ -8478,19 +8476,18 @@ "dev": true }, "office-ui-fabric-react": { - "version": "7.51.0", - "resolved": "https://registry.npmjs.org/office-ui-fabric-react/-/office-ui-fabric-react-7.51.0.tgz", - "integrity": "sha512-tvcx80RbJhn7C2HsDrLjw6B20AFEH7LF/iHBC4pcElHEBVDepaoQuRuIuaJqL/S9gZJt/92nVJijWynCvwsUug==", + "version": "7.76.2", + "resolved": "https://registry.npmjs.org/office-ui-fabric-react/-/office-ui-fabric-react-7.76.2.tgz", + "integrity": "sha512-rWQrkv1o4jOdYhNk3GsLDxJw8mo1+6HspGNILiodRj7RfJx/OmSyVM4KT2gGJ5k2PZGNCdp7f7kp1JuICd31Mg==", "requires": { "@microsoft/load-themed-styles": "^1.7.13", - "@uifabric/example-data": "^7.0.1", - "@uifabric/foundation": "^7.4.4", + "@uifabric/foundation": "^7.5.0", "@uifabric/icons": "^7.3.0", - "@uifabric/merge-styles": "^7.7.0", + "@uifabric/merge-styles": "^7.8.1", "@uifabric/react-hooks": "^7.0.1", "@uifabric/set-version": "^7.0.2", - "@uifabric/styling": "^7.7.2", - "@uifabric/utilities": "^7.5.0", + "@uifabric/styling": "^7.8.0", + "@uifabric/utilities": "^7.8.0", "prop-types": "^15.5.10", "tslib": "^1.7.1" } @@ -10337,9 +10334,9 @@ } }, "serialize-javascript": { - "version": "1.7.0", - "resolved": "https://registry.npmjs.org/serialize-javascript/-/serialize-javascript-1.7.0.tgz", - "integrity": "sha512-ke8UG8ulpFOxO8f8gRYabHQe/ZntKlcig2Mp+8+URDP1D8vJZ0KUt7LYo07q25Z/+JVSgpr/cui9PIp5H6/+nA==", + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/serialize-javascript/-/serialize-javascript-2.1.2.tgz", + "integrity": "sha512-rs9OggEUF0V4jUSecXazOYsLfu7OGK2qIn3c7IPBiffz32XniEp/TX9Xmc9LQfK2nQ2QKHvZ2oygKUGU0lG4jQ==", "dev": true }, "serve-index": { @@ -11187,32 +11184,75 @@ } }, "terser": { - "version": "4.0.2", - "resolved": "https://registry.npmjs.org/terser/-/terser-4.0.2.tgz", - "integrity": "sha512-IWLuJqTvx97KP3uTYkFVn93cXO+EtlzJu8TdJylq+H0VBDlPMIfQA9MBS5Vc5t3xTEUG1q0hIfHMpAP2R+gWTw==", + "version": "4.4.3", + "resolved": "https://registry.npmjs.org/terser/-/terser-4.4.3.tgz", + "integrity": "sha512-0ikKraVtRDKGzHrzkCv5rUNDzqlhmhowOBqC0XqUHFpW+vJ45+20/IFBcebwKfiS2Z9fJin6Eo+F1zLZsxi8RA==", "dev": true, "requires": { - "commander": "^2.19.0", + "commander": "^2.20.0", "source-map": "~0.6.1", - "source-map-support": "~0.5.10" + "source-map-support": "~0.5.12" } }, "terser-webpack-plugin": { - "version": "1.3.0", - "resolved": "https://registry.npmjs.org/terser-webpack-plugin/-/terser-webpack-plugin-1.3.0.tgz", - "integrity": "sha512-W2YWmxPjjkUcOWa4pBEv4OP4er1aeQJlSo2UhtCFQCuRXEHjOFscO8VyWHj9JLlA0RzQb8Y2/Ta78XZvT54uGg==", + "version": "1.4.3", + "resolved": "https://registry.npmjs.org/terser-webpack-plugin/-/terser-webpack-plugin-1.4.3.tgz", + "integrity": "sha512-QMxecFz/gHQwteWwSo5nTc6UaICqN1bMedC5sMtUc7y3Ha3Q8y6ZO0iCR8pq4RJC8Hjf0FEPEHZqcMB/+DFCrA==", "dev": true, "requires": { - "cacache": "^11.3.2", - "find-cache-dir": "^2.0.0", + "cacache": "^12.0.2", + "find-cache-dir": "^2.1.0", "is-wsl": "^1.1.0", - "loader-utils": "^1.2.3", "schema-utils": "^1.0.0", - "serialize-javascript": "^1.7.0", + "serialize-javascript": "^2.1.2", "source-map": "^0.6.1", - "terser": "^4.0.0", - "webpack-sources": "^1.3.0", + "terser": "^4.1.2", + "webpack-sources": "^1.4.0", "worker-farm": "^1.7.0" + }, + "dependencies": { + "cacache": { + "version": "12.0.3", + "resolved": "https://registry.npmjs.org/cacache/-/cacache-12.0.3.tgz", + "integrity": "sha512-kqdmfXEGFepesTuROHMs3MpFLWrPkSSpRqOw80RCflZXy/khxaArvFrQ7uJxSUduzAufc6G0g1VUCOZXxWavPw==", + "dev": true, + "requires": { + "bluebird": "^3.5.5", + "chownr": "^1.1.1", + "figgy-pudding": "^3.5.1", + "glob": "^7.1.4", + "graceful-fs": "^4.1.15", + "infer-owner": "^1.0.3", + "lru-cache": "^5.1.1", + "mississippi": "^3.0.0", + "mkdirp": "^0.5.1", + "move-concurrently": "^1.0.1", + "promise-inflight": "^1.0.1", + "rimraf": "^2.6.3", + "ssri": "^6.0.1", + "unique-filename": "^1.1.1", + "y18n": "^4.0.0" + } + }, + "rimraf": { + "version": "2.7.1", + "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-2.7.1.tgz", + "integrity": "sha512-uWjbaKIK3T1OSVptzX7Nl6PvQ3qAGtKEtVRjRuazjfL3Bx5eI409VZSqgND+4UNnmzLVdPj9FqFJNPqBZFve4w==", + "dev": true, + "requires": { + "glob": "^7.1.3" + } + }, + "webpack-sources": { + "version": "1.4.3", + "resolved": "https://registry.npmjs.org/webpack-sources/-/webpack-sources-1.4.3.tgz", + "integrity": "sha512-lgTS3Xhv1lCOKo7SA5TjKXMjpSM4sBjNV5+q2bqesbSPs5FjGmU6jjtBSkX9b4qW87vDIsCIlUPOEhbZrMdjeQ==", + "dev": true, + "requires": { + "source-list-map": "^2.0.0", + "source-map": "~0.6.1" + } + } } }, "test-exclude": { @@ -11513,14 +11553,23 @@ "dev": true }, "uglify-js": { - "version": "3.6.0", - "resolved": "https://registry.npmjs.org/uglify-js/-/uglify-js-3.6.0.tgz", - "integrity": "sha512-W+jrUHJr3DXKhrsS7NUVxn3zqMOFn0hL/Ei6v0anCIMoKC93TjcflTagwIHLW7SfMFfiQuktQyFVCFHGUE0+yg==", + "version": "3.7.3", + "resolved": "https://registry.npmjs.org/uglify-js/-/uglify-js-3.7.3.tgz", + "integrity": "sha512-7tINm46/3puUA4hCkKYo4Xdts+JDaVC9ZPRcG8Xw9R4nhO/gZgUM3TENq8IF4Vatk8qCig4MzP/c8G4u2BkVQg==", "dev": true, "optional": true, "requires": { - "commander": "~2.20.0", + "commander": "~2.20.3", "source-map": "~0.6.1" + }, + "dependencies": { + "commander": { + "version": "2.20.3", + "resolved": "https://registry.npmjs.org/commander/-/commander-2.20.3.tgz", + "integrity": "sha512-GpVkmM8vF2vQUkj2LvZmD35JxeJOLCwJ9cUkugyk2nuhbv3+mJvpLYYt+0+USMxE+oj+ey/lJEnhZw75x/OMcQ==", + "dev": true, + "optional": true + } } }, "undertaker": { diff --git a/src/settings-web/package.json b/src/settings-web/package.json index c13a2d8da28..e9d09b65948 100644 --- a/src/settings-web/package.json +++ b/src/settings-web/package.json @@ -29,8 +29,8 @@ }, "dependencies": { "@svgr/webpack": "^4.3.3", - "@uifabric/azure-themes": "^7.0.9", - "office-ui-fabric-react": "^7.51.0", + "@uifabric/azure-themes": "^7.0.10", + "office-ui-fabric-react": "^7.76.2", "react": "~16.8.0", "react-dom": "~16.8.0" }, diff --git a/src/settings-web/src/components/GeneralSettings.tsx b/src/settings-web/src/components/GeneralSettings.tsx index bb65717eb71..59141ef5192 100644 --- a/src/settings-web/src/components/GeneralSettings.tsx +++ b/src/settings-web/src/components/GeneralSettings.tsx @@ -122,12 +122,12 @@ export class GeneralSettings extends React.Component { General {this.startup_reference=input;}} /> {this.elevated_reference=input;}} /> @@ -135,11 +135,11 @@ export class GeneralSettings extends React.Component { setting={{ display_name: '', value: this.state.settings.general.is_elevated ? - 'PowerToys is currently running with elevated privileges. You can restart it to run non-elevated only for this session, without changing the default setting.' : - 'PowerToys is currently running without elevated privileges. You can restart it to run elevated only for this session, without changing the default setting.', + 'Running as administrator. Do you wish to run as user instead?' : + 'Running as user. Do you wish to run as administrator instead?', button_text: this.state.settings.general.is_elevated ? - 'Restart without elevated privileges' : - 'Restart with elevated privileges' + 'Restart as user' : + 'Restart as administrator' }} action_name={'restart_elevation'} action_callback={(action_name: any, value:any) => { @@ -225,16 +225,26 @@ export class GeneralSettings extends React.Component { ref={(input) => {this.theme_reference=input;}} /> - - About PowerToys (Preview) + + Check for updates + Check for updates + }} + >Privacy statement {/* An empty span to always give 30px padding in Edge. */} diff --git a/src/settings/settings-html/dist/bundle.js b/src/settings/settings-html/dist/bundle.js index e711e1130ce..7255947a4a9 100644 --- a/src/settings/settings-html/dist/bundle.js +++ b/src/settings/settings-html/dist/bundle.js @@ -1,9 +1,9 @@ -!function(e){var t={};function n(o){if(t[o])return t[o].exports;var r=t[o]={i:o,l:!1,exports:{}};return e[o].call(r.exports,r,r.exports,n),r.l=!0,r.exports}n.m=e,n.c=t,n.d=function(e,t,o){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:o})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var o=Object.create(null);if(n.r(o),Object.defineProperty(o,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var r in e)n.d(o,r,function(t){return e[t]}.bind(null,r));return o},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="",n(n.s=34)}([function(e,t,n){"use strict";e.exports=n(25)},,,,,,,function(e,t,n){"use strict";!function e(){if("undefined"!=typeof __REACT_DEVTOOLS_GLOBAL_HOOK__&&"function"==typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE)try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(e)}catch(e){console.error(e)}}(),e.exports=n(26)},,,,,function(e,t,n){"use strict";var o={},r=void 0;try{r=window}catch(e){}function i(e,t){if(void 0!==r){var n=r.__packages__=r.__packages__||{};if(!n[e]||!o[e])o[e]=t,(n[e]=n[e]||[]).push(t)}}n.d(t,"a",function(){return i}),i("@uifabric/set-version","6.0.0")},,,,function(e,t,n){"use strict"; +!function(e){var t={};function n(o){if(t[o])return t[o].exports;var r=t[o]={i:o,l:!1,exports:{}};return e[o].call(r.exports,r,r.exports,n),r.l=!0,r.exports}n.m=e,n.c=t,n.d=function(e,t,o){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:o})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var o=Object.create(null);if(n.r(o),Object.defineProperty(o,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var r in e)n.d(o,r,function(t){return e[t]}.bind(null,r));return o},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="",n(n.s=34)}([function(e,t,n){"use strict";e.exports=n(25)},,,,,,,function(e,t,n){"use strict";!function e(){if("undefined"!=typeof __REACT_DEVTOOLS_GLOBAL_HOOK__&&"function"==typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE){0;try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(e)}catch(e){console.error(e)}}}(),e.exports=n(26)},,,,,function(e,t,n){"use strict";var o={},r=void 0;try{r=window}catch(e){}function i(e,t){if(void 0!==r){var n=r.__packages__=r.__packages__||{};if(!n[e]||!o[e])o[e]=t,(n[e]=n[e]||[]).push(t)}}n.d(t,"a",(function(){return i})),i("@uifabric/set-version","6.0.0")},,,,function(e,t,n){"use strict"; /* object-assign (c) Sindre Sorhus @license MIT -*/var o=Object.getOwnPropertySymbols,r=Object.prototype.hasOwnProperty,i=Object.prototype.propertyIsEnumerable;function a(e){if(null==e)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(e)}e.exports=function(){try{if(!Object.assign)return!1;var e=new String("abc");if(e[5]="de","5"===Object.getOwnPropertyNames(e)[0])return!1;for(var t={},n=0;n<10;n++)t["_"+String.fromCharCode(n)]=n;if("0123456789"!==Object.getOwnPropertyNames(t).map(function(e){return t[e]}).join(""))return!1;var o={};return"abcdefghijklmnopqrst".split("").forEach(function(e){o[e]=e}),"abcdefghijklmnopqrst"===Object.keys(Object.assign({},o)).join("")}catch(e){return!1}}()?Object.assign:function(e,t){for(var n,s,l=a(e),u=1;u0&&c(t)})}function c(e,t){i.loadStyles?i.loadStyles(f(e).styleString,e):function(e){if("undefined"==typeof document)return;var t=document.getElementsByTagName("head")[0],n=document.createElement("style"),o=f(e),a=o.styleString,s=o.themable;n.setAttribute("data-load-themed-styles","true"),n.type="text/css",r&&n.setAttribute("nonce",r);n.appendChild(document.createTextNode(a)),i.perf.count++,t.appendChild(n);var l=document.createEvent("HTMLEvents");l.initEvent("styleinsert",!0,!1),l.args={newStyle:n},document.dispatchEvent(l);var u={styleElement:n,themableStyle:e};s?i.registeredThemableStyles.push(u):i.registeredStyles.push(u)}(e)}function d(e){void 0===e&&(e=3),3!==e&&2!==e||(p(i.registeredStyles),i.registeredStyles=[]),3!==e&&1!==e||(p(i.registeredThemableStyles),i.registeredThemableStyles=[])}function p(e){e.forEach(function(e){var t=e&&e.styleElement;t&&t.parentElement&&t.parentElement.removeChild(t)})}function f(e){var t=i.theme,n=!1;return{styleString:(e||[]).map(function(e){var o=e.theme;if(o){n=!0;var r=t?t[o]:void 0,i=e.defaultValue||"inherit";return!t||r||!console||o in t||"undefined"==typeof DEBUG||!DEBUG||console.warn('Theming value not provided for "'+o+'". Falling back to "'+i+'".'),r||i}return e.rawString}).join(""),themable:n}}function h(e){var t=[];if(e){for(var n=0,o=void 0;o=a.exec(e);){var r=o.index;r>n&&t.push({rawString:e.substring(n,r)}),t.push({theme:o[1],defaultValue:o[2]}),n=a.lastIndex}t.push({rawString:e.substring(n)})}return t}t.loadStyles=function(e,t){void 0===t&&(t=!1),l(function(){var n=Array.isArray(e)?e:h(e),o=i.runState,r=o.mode,a=o.buffer,s=o.flushTimer;t||1===r?(a.push(n),s||(i.runState.flushTimer=setTimeout(function(){i.runState.flushTimer=0,u()},0))):c(n)})},t.configureLoadStyles=function(e){i.loadStyles=e},t.configureRunMode=function(e){i.runState.mode=e},t.flush=u,t.loadTheme=function(e){i.theme=e,function(){if(i.theme){for(var e=[],t=0,n=i.registeredThemableStyles;t0&&(d(1),c([].concat.apply([],e)))}}()},t.clearStyles=d,t.detokenize=function(e){return e&&(e=f(h(e)).styleString),e},t.splitStyles=h}).call(this,n(17))},,,,,,,function(e,t,n){"use strict"; +*/var o=Object.getOwnPropertySymbols,r=Object.prototype.hasOwnProperty,i=Object.prototype.propertyIsEnumerable;function a(e){if(null==e)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(e)}e.exports=function(){try{if(!Object.assign)return!1;var e=new String("abc");if(e[5]="de","5"===Object.getOwnPropertyNames(e)[0])return!1;for(var t={},n=0;n<10;n++)t["_"+String.fromCharCode(n)]=n;if("0123456789"!==Object.getOwnPropertyNames(t).map((function(e){return t[e]})).join(""))return!1;var o={};return"abcdefghijklmnopqrst".split("").forEach((function(e){o[e]=e})),"abcdefghijklmnopqrst"===Object.keys(Object.assign({},o)).join("")}catch(e){return!1}}()?Object.assign:function(e,t){for(var n,s,l=a(e),u=1;u0&&(!function(e){void 0===e&&(e=3);3!==e&&2!==e||(u(a.registeredStyles),a.registeredStyles=[]);3!==e&&1!==e||(u(a.registeredThemableStyles),a.registeredThemableStyles=[])}(1),s([].concat.apply([],e)))}}()}function u(e){e.forEach((function(e){var t=e&&e.styleElement;t&&t.parentElement&&t.parentElement.removeChild(t)}))}function c(e){var t=a.theme,n=!1;return{styleString:(e||[]).map((function(e){var o=e.theme;if(o){n=!0;var r=t?t[o]:void 0,i=e.defaultValue||"inherit";return!t||r||!console||o in t||"undefined"==typeof DEBUG||!DEBUG||console.warn('Theming value not provided for "'+o+'". Falling back to "'+i+'".'),r||i}return e.rawString})).join(""),themable:n}}}).call(this,n(17))},,,,,,,function(e,t,n){"use strict"; /** @license React v16.8.6 * react.production.min.js * @@ -11,7 +11,7 @@ object-assign * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. - */var o=n(16),r="function"==typeof Symbol&&Symbol.for,i=r?Symbol.for("react.element"):60103,a=r?Symbol.for("react.portal"):60106,s=r?Symbol.for("react.fragment"):60107,l=r?Symbol.for("react.strict_mode"):60108,u=r?Symbol.for("react.profiler"):60114,c=r?Symbol.for("react.provider"):60109,d=r?Symbol.for("react.context"):60110,p=r?Symbol.for("react.concurrent_mode"):60111,f=r?Symbol.for("react.forward_ref"):60112,h=r?Symbol.for("react.suspense"):60113,m=r?Symbol.for("react.memo"):60115,g=r?Symbol.for("react.lazy"):60116,v="function"==typeof Symbol&&Symbol.iterator;function y(e){for(var t=arguments.length-1,n="https://reactjs.org/docs/error-decoder.html?invariant="+e,o=0;oN.length&&N.push(e)}function F(e,t,n){return null==e?0:function e(t,n,o,r){var s=typeof t;"undefined"!==s&&"boolean"!==s||(t=null);var l=!1;if(null===t)l=!0;else switch(s){case"string":case"number":l=!0;break;case"object":switch(t.$$typeof){case i:case a:l=!0}}if(l)return o(r,t,""===n?"."+O(t,0):n),1;if(l=0,n=""===n?".":n+":",Array.isArray(t))for(var u=0;uN.length&&N.push(e)}function F(e,t,n){return null==e?0:function e(t,n,o,r){var s=typeof t;"undefined"!==s&&"boolean"!==s||(t=null);var l=!1;if(null===t)l=!0;else switch(s){case"string":case"number":l=!0;break;case"object":switch(t.$$typeof){case i:case a:l=!0}}if(l)return o(r,t,""===n?"."+O(t,0):n),1;if(l=0,n=""===n?".":n+":",Array.isArray(t))for(var u=0;uthis.eventPool.length&&this.eventPool.push(e)}function de(e){e.eventPool=[],e.getPooled=ue,e.release=ce}r(le.prototype,{preventDefault:function(){this.defaultPrevented=!0;var e=this.nativeEvent;e&&(e.preventDefault?e.preventDefault():"unknown"!=typeof e.returnValue&&(e.returnValue=!1),this.isDefaultPrevented=ae)},stopPropagation:function(){var e=this.nativeEvent;e&&(e.stopPropagation?e.stopPropagation():"unknown"!=typeof e.cancelBubble&&(e.cancelBubble=!0),this.isPropagationStopped=ae)},persist:function(){this.isPersistent=ae},isPersistent:se,destructor:function(){var e,t=this.constructor.Interface;for(e in t)this[e]=null;this.nativeEvent=this._targetInst=this.dispatchConfig=null,this.isPropagationStopped=this.isDefaultPrevented=se,this._dispatchInstances=this._dispatchListeners=null}}),le.Interface={type:null,target:null,currentTarget:function(){return null},eventPhase:null,bubbles:null,cancelable:null,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:null,isTrusted:null},le.extend=function(e){function t(){}function n(){return o.apply(this,arguments)}var o=this;t.prototype=o.prototype;var i=new t;return r(i,n.prototype),n.prototype=i,n.prototype.constructor=n,n.Interface=r({},o.Interface,e),n.extend=o.extend,de(n),n},de(le);var pe=le.extend({data:null}),fe=le.extend({data:null}),he=[9,13,27,32],me=V&&"CompositionEvent"in window,ge=null;V&&"documentMode"in document&&(ge=document.documentMode);var ve=V&&"TextEvent"in window&&!ge,ye=V&&(!me||ge&&8=ge),be=String.fromCharCode(32),_e={beforeInput:{phasedRegistrationNames:{bubbled:"onBeforeInput",captured:"onBeforeInputCapture"},dependencies:["compositionend","keypress","textInput","paste"]},compositionEnd:{phasedRegistrationNames:{bubbled:"onCompositionEnd",captured:"onCompositionEndCapture"},dependencies:"blur compositionend keydown keypress keyup mousedown".split(" ")},compositionStart:{phasedRegistrationNames:{bubbled:"onCompositionStart",captured:"onCompositionStartCapture"},dependencies:"blur compositionstart keydown keypress keyup mousedown".split(" ")},compositionUpdate:{phasedRegistrationNames:{bubbled:"onCompositionUpdate",captured:"onCompositionUpdateCapture"},dependencies:"blur compositionupdate keydown keypress keyup mousedown".split(" ")}},ke=!1;function xe(e,t){switch(e){case"keyup":return-1!==he.indexOf(t.keyCode);case"keydown":return 229!==t.keyCode;case"keypress":case"mousedown":case"blur":return!0;default:return!1}}function Ce(e){return"object"==typeof(e=e.detail)&&"data"in e?e.data:null}var we=!1;var Se={eventTypes:_e,extractEvents:function(e,t,n,o){var r=void 0,i=void 0;if(me)e:{switch(e){case"compositionstart":r=_e.compositionStart;break e;case"compositionend":r=_e.compositionEnd;break e;case"compositionupdate":r=_e.compositionUpdate;break e}r=void 0}else we?xe(e,n)&&(r=_e.compositionEnd):"keydown"===e&&229===n.keyCode&&(r=_e.compositionStart);return r?(ye&&"ko"!==n.locale&&(we||r!==_e.compositionStart?r===_e.compositionEnd&&we&&(i=ie()):(oe="value"in(ne=o)?ne.value:ne.textContent,we=!0)),r=pe.getPooled(r,t,n,o),i?r.data=i:null!==(i=Ce(n))&&(r.data=i),j(r),i=r):i=null,(e=ve?function(e,t){switch(e){case"compositionend":return Ce(t);case"keypress":return 32!==t.which?null:(ke=!0,be);case"textInput":return(e=t.data)===be&&ke?null:e;default:return null}}(e,n):function(e,t){if(we)return"compositionend"===e||!me&&xe(e,t)?(e=ie(),re=oe=ne=null,we=!1,e):null;switch(e){case"paste":return null;case"keypress":if(!(t.ctrlKey||t.altKey||t.metaKey)||t.ctrlKey&&t.altKey){if(t.char&&1