Compare commits

..

1 commit
main ... stable

Author SHA1 Message Date
Jaime Bernardo 010428e134 [ci][PTRun]Fix signing for new plugins folders (#14646) 2021-11-25 18:40:27 +00:00
14 changed files with 71 additions and 80 deletions

View file

@ -1,6 +1,6 @@
# Microsoft PowerToys
![Hero image for Microsoft PowerToys](doc/images/overview/PT_hero_image.png)
<img src="./doc/images/overview/PT%20hero%20image.png"/>
[How to use PowerToys][usingPowerToys-docs-link] | [Downloads & Release notes][github-release-link] | [Contributing to PowerToys](#contributing) | [What's Happening](#whats-happening) | [Roadmap](#powertoys-roadmap)

View file

@ -15,7 +15,7 @@ TODO
#### [`ZoneSet.cpp`](/src/modules/fancyzones/lib/ZoneSet.cpp)
TODO
#### [`WorkArea.cpp`](/src/modules/fancyzones/lib/WorkArea.cpp)
#### [`ZoneWindow.cpp`](/src/modules/fancyzones/lib/ZoneWindow.cpp)
TODO
## FancyZones Editor

View file

Before

Width:  |  Height:  |  Size: 447 KiB

After

Width:  |  Height:  |  Size: 447 KiB

View file

@ -2,17 +2,17 @@
---
1. `Zone` - Class which is basically wrapper around rectangle structure, representing one zone inside applied zone layout. ZoneSet is holding array of these which represent zone layout.
2. `ZoneSet` - Class implementing actual zone layout applied. What this means is that ZoneSet is responsible for actual calculation of rectangle coordinates (whether is grid or canvas layout) and moving window through them. WorkArea holds ZoneSet structure which represents currently active zone set.
3. `WorkArea` - Class representing work area, which is defined by monitor and current virtual desktop. For an example, if You have two monitors connected and two virtual desktops, You have 4 work areas available, and each of them can have separate zone layout. WorkArea is describing single work area. As mentioned before it holds active ZoneSet.
2. `ZoneSet` - Class implementing actual zone layout applied. What this means is that ZoneSet is responsible for actual calculation of rectangle coordinates (whether is grid or canvas layout) and moving window through them. ZoneWindow holds ZoneSet structure which represents currently active zone set.
3. `ZoneWindow` - Class representing work area, which is defined by monitor and current virtual desktop. For an example, if You have two monitors connected and two virtual desktops, You have 4 work areas available, and each of them can have separate zone layout. ZoneWindow is describing single work area. As mentioned before it holds active ZoneSet.
4. `FancyZones` - Top level entity and entry point for all user actions (which goes through actual module interface). Some of the main responsibilities of FancyZones class:
1. Starting FancyZones Editor (C#) with appropriate command line arguments on user request.
2. Keeping track of WorkArea per monitor (currently active work area on each connected monitor).
2. Keeping track of ZoneWindow per monitor (currently active work area on each connected monitor).
3. Keeping track of active virtual desktops. This is performed in separate thread by polling VirtualDesktopIDs registry key and parsing its content.
4. Detecting every change in work environment, such as creating / destroying / switching between virtual desktops, closing FancyZones Editor, changing display settings and handling those changes.
### Proposal for modifications of handling described in 4.4:
Currently after each of the mentioned changes in work environment we are calling EnumDisplayMonitors windows API, and passing callback function to it. EnumDisplayMonitors works asynchronous and triggers that callback for each work area available (as mentioned in previous example, for two monitors and two virtual desktops, we have this callback triggered four times). As mentioned previously, we have WorkArea class as our representation of this work area. And what we do, every time this callback is triggered we destroy previous WorkArea object for that work area and create new one, even though that it is most likely that nothing has changed (e.g. just switching back and forth between virtual desktops). This constant creation and deletion of WorkArea has caused some problems in the past and it's not ideal for some other fixes we would like to make in the multi-monitor/multi-desktop scenario.
Currently after each of the mentioned changes in work environment we are calling EnumDisplayMonitors windows API, and passing callback function to it. EnumDisplayMonitors works asynchronous and triggers that callback for each work area available (as mentioned in previous example, for two monitors and two virtual desktops, we have this callback triggered four times). As mentioned previously, we have ZoneWindow class as our representation of this work area. And what we do, every time this callback is triggered we destroy previous ZoneWindow object for that work area and create new one, even though that it is most likely that nothing has changed (e.g. just switching back and forth between virtual desktops). This constant creation and deletion of ZoneWindow has caused some problems in the past and it's not ideal for some other fixes we would like to make in the multi-monitor/multi-desktop scenario.
As mentioned in 4.3 we already have tracker of virtual desktops implemented. Idea is to use this functionality and to extend it bit more, so we can track if work area (WorkArea) is new one, or already processed and skip creating new WorkArea objects and deleting old ones every time, even if nothing changed in it. We will keep map, where virtual desktop id is the key, and values are already processed monitors (virtual desktop exists across all monitors). Once we receive callback from EnumDisplayMonitors, indicating work area (defined by virtual desktop id and monitor) we can check if its new or not, and act accordingly (create new WorkArea for it or not). Deleting virtual desktop (which is also registered in 4.3), will trigger updates in this map, and also updates in our JSON storage.
As mentioned in 4.3 we already have tracker of virtual desktops implemented. Idea is to use this functionality and to extend it bit more, so we can track if work area (ZoneWindow) is new one, or already processed and skip creating new ZoneWindow objects and deleting old ones every time, even if nothing changed in it. We will keep map, where virtual desktop id is the key, and values are already processed monitors (virtual desktop exists across all monitors). Once we receive callback from EnumDisplayMonitors, indicating work area (defined by virtual desktop id and monitor) we can check if its new or not, and act accordingly (create new ZoneWindow for it or not). Deleting virtual desktop (which is also registered in 4.3), will trigger updates in this map, and also updates in our JSON storage.

View file

@ -61,7 +61,7 @@
<ClInclude Include="ZoneColors.h" />
<ClInclude Include="ZoneSet.h" />
<ClInclude Include="WorkArea.h" />
<ClInclude Include="ZonesOverlay.h" />
<ClInclude Include="ZoneWindowDrawing.h" />
</ItemGroup>
<ItemGroup>
<ClCompile Include="FancyZones.cpp" />
@ -84,7 +84,7 @@
<ClCompile Include="Zone.cpp" />
<ClCompile Include="ZoneSet.cpp" />
<ClCompile Include="WorkArea.cpp" />
<ClCompile Include="ZonesOverlay.cpp" />
<ClCompile Include="ZoneWindowDrawing.cpp" />
</ItemGroup>
<ItemGroup>
<None Include="fancyzones.base.rc" />

View file

@ -75,7 +75,7 @@
<ClInclude Include="KeyState.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="ZonesOverlay.h">
<ClInclude Include="ZoneWindowDrawing.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="MonitorUtils.h">
@ -140,7 +140,7 @@
<ClCompile Include="FancyZonesDataTypes.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="ZonesOverlay.cpp">
<ClCompile Include="ZoneWindowDrawing.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="OnThreadExecutor.cpp">

View file

@ -101,12 +101,12 @@ void WindowMoveHandler::MoveSizeStart(HWND window, HMONITOR monitor, POINT const
{
for (auto [keyMonitor, workArea] : workAreaMap)
{
// Skip calling ShowZonesOverlay for iter->second (m_draggedWindowWorkArea) since it
// Skip calling ShowZoneWindow for iter->second (m_draggedWindowWorkArea) since it
// was already called in MoveSizeEnter
const bool moveSizeEnterCalled = workArea == m_draggedWindowWorkArea;
if (workArea && !moveSizeEnterCalled)
{
workArea->ShowZonesOverlay();
workArea->ShowZoneWindow();
}
}
}
@ -119,7 +119,7 @@ void WindowMoveHandler::MoveSizeStart(HWND window, HMONITOR monitor, POINT const
{
if (workArea)
{
workArea->HideZonesOverlay();
workArea->HideZoneWindow();
}
}
}
@ -159,7 +159,7 @@ void WindowMoveHandler::MoveSizeUpdate(HMONITOR monitor, POINT const& ptScreen,
{
if (workArea)
{
workArea->HideZonesOverlay();
workArea->HideZoneWindow();
}
}
}
@ -174,7 +174,7 @@ void WindowMoveHandler::MoveSizeUpdate(HMONITOR monitor, POINT const& ptScreen,
m_draggedWindowWorkArea->ClearSelectedZones();
if (!m_settings->GetSettings()->showZonesOnAllMonitors)
{
m_draggedWindowWorkArea->HideZonesOverlay();
m_draggedWindowWorkArea->HideZoneWindow();
}
m_draggedWindowWorkArea = iter->second;
@ -279,7 +279,7 @@ void WindowMoveHandler::MoveSizeEnd(HWND window, POINT const& ptScreen, const st
{
if (workArea)
{
workArea->HideZonesOverlay();
workArea->HideZoneWindow();
}
}
}

View file

@ -6,7 +6,7 @@
#include "FancyZonesData.h"
#include "FancyZonesDataTypes.h"
#include "ZonesOverlay.h"
#include "ZoneWindowDrawing.h"
#include "trace.h"
#include "util.h"
#include "on_thread_executor.h"
@ -21,7 +21,7 @@
// Non-Localizable strings
namespace NonLocalizable
{
const wchar_t ToolWindowClassName[] = L"FancyZones_ZonesOverlay";
const wchar_t ToolWindowClassName[] = L"SuperFancyZones_ZoneWindow";
}
using namespace FancyZonesUtils;
@ -57,13 +57,13 @@ namespace
public:
HWND NewZonesOverlayWindow(Rect position, HINSTANCE hinstance, WorkArea* owner)
HWND NewZoneWindow(Rect position, HINSTANCE hinstance, WorkArea* owner)
{
HWND windowFromPool = ExtractWindow();
if (windowFromPool == NULL)
{
HWND window = CreateWindowExW(WS_EX_TOOLWINDOW, NonLocalizable::ToolWindowClassName, L"", WS_POPUP, position.left(), position.top(), position.width(), position.height(), nullptr, nullptr, hinstance, owner);
Logger::info("Creating new ZonesOverlay window, hWnd = {}", (void*)window);
Logger::info("Creating new zone window, hWnd = {}", (void*)window);
MakeWindowTransparent(window);
// According to ShowWindow docs, we must call it with SW_SHOWNORMAL the first time
@ -73,17 +73,17 @@ namespace
}
else
{
Logger::info("Reusing ZonesOverlay window from pool, hWnd = {}", (void*)windowFromPool);
Logger::info("Reusing zone window from pool, hWnd = {}", (void*)windowFromPool);
SetWindowLongPtrW(windowFromPool, GWLP_USERDATA, reinterpret_cast<LONG_PTR>(owner));
MoveWindow(windowFromPool, position.left(), position.top(), position.width(), position.height(), TRUE);
return windowFromPool;
}
}
void FreeZonesOverlayWindow(HWND window)
void FreeZoneWindow(HWND window)
{
_TRACER_;
Logger::info("Freeing ZonesOverlay window into pool, hWnd = {}", (void*)window);
Logger::info("Freeing zone window, hWnd = {}", (void*)window);
SetWindowLongPtrW(window, GWLP_USERDATA, 0);
ShowWindow(window, SW_HIDE);
@ -133,9 +133,9 @@ public:
IFACEMETHODIMP_(ZoneIndexSet)
GetWindowZoneIndexes(HWND window) const noexcept;
IFACEMETHODIMP_(void)
ShowZonesOverlay() noexcept;
ShowZoneWindow() noexcept;
IFACEMETHODIMP_(void)
HideZonesOverlay() noexcept;
HideZoneWindow() noexcept;
IFACEMETHODIMP_(void)
UpdateActiveZoneSet() noexcept;
IFACEMETHODIMP_(void)
@ -169,7 +169,7 @@ private:
ZoneIndexSet m_highlightZone;
WPARAM m_keyLast{};
size_t m_keyCycle{};
std::unique_ptr<ZonesOverlay> m_zonesOverlay;
std::unique_ptr<ZoneWindowDrawing> m_zoneWindowDrawing;
ZoneColors m_zoneColors;
OverlappingZonesAlgorithm m_overlappingAlgorithm;
};
@ -187,7 +187,7 @@ WorkArea::WorkArea(HINSTANCE hinstance)
WorkArea::~WorkArea()
{
windowPool.FreeZonesOverlayWindow(m_window);
windowPool.FreeZoneWindow(m_window);
}
bool WorkArea::Init(HINSTANCE hinstance, HMONITOR monitor, const FancyZonesDataTypes::DeviceIdData& uniqueId, const FancyZonesDataTypes::DeviceIdData& parentUniqueId, const ZoneColors& zoneColors, OverlappingZonesAlgorithm overlappingAlgorithm)
@ -215,14 +215,14 @@ bool WorkArea::Init(HINSTANCE hinstance, HMONITOR monitor, const FancyZonesDataT
m_uniqueId = uniqueId;
InitializeZoneSets(parentUniqueId);
m_window = windowPool.NewZonesOverlayWindow(workAreaRect, hinstance, this);
m_window = windowPool.NewZoneWindow(workAreaRect, hinstance, this);
if (!m_window)
{
return false;
}
m_zonesOverlay = std::make_unique<ZonesOverlay>(m_window);
m_zoneWindowDrawing = std::make_unique<ZoneWindowDrawing>(m_window);
return true;
}
@ -232,7 +232,7 @@ IFACEMETHODIMP WorkArea::MoveSizeEnter(HWND window) noexcept
m_windowMoveSize = window;
m_highlightZone = {};
m_initialHighlightZone = {};
ShowZonesOverlay();
ShowZoneWindow();
Trace::WorkArea::MoveOrResizeStarted(m_zoneSet);
return S_OK;
}
@ -275,7 +275,7 @@ IFACEMETHODIMP WorkArea::MoveSizeUpdate(POINT const& ptScreen, bool dragEnabled,
if (redraw)
{
m_zonesOverlay->DrawActiveZoneSet(m_zoneSet->GetZones(), m_highlightZone, m_zoneColors);
m_zoneWindowDrawing->DrawActiveZoneSet(m_zoneSet->GetZones(), m_highlightZone, m_zoneColors);
}
return S_OK;
@ -301,7 +301,7 @@ IFACEMETHODIMP WorkArea::MoveSizeEnd(HWND window, POINT const& ptScreen) noexcep
}
Trace::WorkArea::MoveOrResizeEnd(m_zoneSet);
HideZonesOverlay();
HideZoneWindow();
m_windowMoveSize = nullptr;
return S_OK;
}
@ -400,22 +400,22 @@ WorkArea::GetWindowZoneIndexes(HWND window) const noexcept
}
IFACEMETHODIMP_(void)
WorkArea::ShowZonesOverlay() noexcept
WorkArea::ShowZoneWindow() noexcept
{
if (m_window)
{
SetAsTopmostWindow();
m_zonesOverlay->DrawActiveZoneSet(m_zoneSet->GetZones(), m_highlightZone, m_zoneColors);
m_zonesOverlay->Show();
m_zoneWindowDrawing->DrawActiveZoneSet(m_zoneSet->GetZones(), m_highlightZone, m_zoneColors);
m_zoneWindowDrawing->Show();
}
}
IFACEMETHODIMP_(void)
WorkArea::HideZonesOverlay() noexcept
WorkArea::HideZoneWindow() noexcept
{
if (m_window)
{
m_zonesOverlay->Hide();
m_zoneWindowDrawing->Hide();
m_keyLast = 0;
m_windowMoveSize = nullptr;
m_highlightZone = {};
@ -429,7 +429,7 @@ WorkArea::UpdateActiveZoneSet() noexcept
if (m_window)
{
m_highlightZone.clear();
m_zonesOverlay->DrawActiveZoneSet(m_zoneSet->GetZones(), m_highlightZone, m_zoneColors);
m_zoneWindowDrawing->DrawActiveZoneSet(m_zoneSet->GetZones(), m_highlightZone, m_zoneColors);
}
}
@ -448,7 +448,7 @@ WorkArea::ClearSelectedZones() noexcept
if (m_highlightZone.size())
{
m_highlightZone.clear();
m_zonesOverlay->DrawActiveZoneSet(m_zoneSet->GetZones(), m_highlightZone, m_zoneColors);
m_zoneWindowDrawing->DrawActiveZoneSet(m_zoneSet->GetZones(), m_highlightZone, m_zoneColors);
}
}
@ -458,8 +458,8 @@ WorkArea::FlashZones() noexcept
if (m_window)
{
SetAsTopmostWindow();
m_zonesOverlay->DrawActiveZoneSet(m_zoneSet->GetZones(), {}, m_zoneColors);
m_zonesOverlay->Flash();
m_zoneWindowDrawing->DrawActiveZoneSet(m_zoneSet->GetZones(), {}, m_zoneColors);
m_zoneWindowDrawing->Flash();
}
}

View file

@ -108,14 +108,8 @@ interface __declspec(uuid("{7F017528-8110-4FB3-BE41-F472969C2560}")) IWorkArea :
* @returns Zone index of the window
*/
IFACEMETHOD_(ZoneIndexSet, GetWindowZoneIndexes)(HWND window) const = 0;
/**
* Show a drawing of the zones in the work area.
*/
IFACEMETHOD_(void, ShowZonesOverlay)() = 0;
/**
* Hide the drawing of the zones in the work area.
*/
IFACEMETHOD_(void, HideZonesOverlay)() = 0;
IFACEMETHOD_(void, ShowZoneWindow)() = 0;
IFACEMETHOD_(void, HideZoneWindow)() = 0;
/**
* Update currently active zone layout for this work area.
*/

View file

@ -1,5 +1,5 @@
#include "pch.h"
#include "ZonesOverlay.h"
#include "ZoneWindowDrawing.h"
#include <algorithm>
#include <map>
@ -7,6 +7,7 @@
#include <vector>
#include <common/logger/call_tracer.h>
#include <common/logger/logger.h>
namespace
{
@ -19,7 +20,7 @@ namespace NonLocalizable
const wchar_t SegoeUiFont[] = L"Segoe ui";
}
float ZonesOverlay::GetAnimationAlpha()
float ZoneWindowDrawing::GetAnimationAlpha()
{
// Lock is held by the caller
@ -40,7 +41,7 @@ float ZonesOverlay::GetAnimationAlpha()
return std::clamp(millis / FadeInDurationMillis, 0.001f, 1.f);
}
ID2D1Factory* ZonesOverlay::GetD2DFactory()
ID2D1Factory* ZoneWindowDrawing::GetD2DFactory()
{
static auto pD2DFactory = [] {
ID2D1Factory* res = nullptr;
@ -50,7 +51,7 @@ ID2D1Factory* ZonesOverlay::GetD2DFactory()
return pD2DFactory;
}
IDWriteFactory* ZonesOverlay::GetWriteFactory()
IDWriteFactory* ZoneWindowDrawing::GetWriteFactory()
{
static auto pDWriteFactory = [] {
IUnknown* res = nullptr;
@ -60,7 +61,7 @@ IDWriteFactory* ZonesOverlay::GetWriteFactory()
return pDWriteFactory;
}
D2D1_COLOR_F ZonesOverlay::ConvertColor(COLORREF color)
D2D1_COLOR_F ZoneWindowDrawing::ConvertColor(COLORREF color)
{
return D2D1::ColorF(GetRValue(color) / 255.f,
GetGValue(color) / 255.f,
@ -68,12 +69,12 @@ D2D1_COLOR_F ZonesOverlay::ConvertColor(COLORREF color)
1.f);
}
D2D1_RECT_F ZonesOverlay::ConvertRect(RECT rect)
D2D1_RECT_F ZoneWindowDrawing::ConvertRect(RECT rect)
{
return D2D1::RectF((float)rect.left + 0.5f, (float)rect.top + 0.5f, (float)rect.right - 0.5f, (float)rect.bottom - 0.5f);
}
ZonesOverlay::ZonesOverlay(HWND window)
ZoneWindowDrawing::ZoneWindowDrawing(HWND window)
{
HRESULT hr;
m_window = window;
@ -83,7 +84,7 @@ ZonesOverlay::ZonesOverlay(HWND window)
// Obtain the size of the drawing area.
if (!GetClientRect(window, &m_clientRect))
{
Logger::error("couldn't initialize ZonesOverlay: GetClientRect failed");
Logger::error("couldn't initialize ZoneWindowDrawing: GetClientRect failed");
return;
}
@ -102,14 +103,14 @@ ZonesOverlay::ZonesOverlay(HWND window)
if (!SUCCEEDED(hr))
{
Logger::error("couldn't initialize ZonesOverlay: CreateHwndRenderTarget failed with {}", hr);
Logger::error("couldn't initialize ZoneWindowDrawing: CreateHwndRenderTarget failed with {}", hr);
return;
}
m_renderThread = std::thread([this]() { RenderLoop(); });
}
ZonesOverlay::RenderResult ZonesOverlay::Render()
ZoneWindowDrawing::RenderResult ZoneWindowDrawing::Render()
{
std::unique_lock lock(m_mutex);
@ -192,7 +193,7 @@ ZonesOverlay::RenderResult ZonesOverlay::Render()
return RenderResult::Ok;
}
void ZonesOverlay::RenderLoop()
void ZoneWindowDrawing::RenderLoop()
{
while (!m_abortThread)
{
@ -211,7 +212,7 @@ void ZonesOverlay::RenderLoop()
}
}
void ZonesOverlay::Hide()
void ZoneWindowDrawing::Hide()
{
_TRACER_;
bool shouldHideWindow = true;
@ -228,7 +229,7 @@ void ZonesOverlay::Hide()
}
}
void ZonesOverlay::Show()
void ZoneWindowDrawing::Show()
{
_TRACER_;
bool shouldShowWindow = true;
@ -256,7 +257,7 @@ void ZonesOverlay::Show()
m_cv.notify_all();
}
void ZonesOverlay::Flash()
void ZoneWindowDrawing::Flash()
{
_TRACER_;
bool shouldShowWindow = true;
@ -276,9 +277,9 @@ void ZonesOverlay::Flash()
m_cv.notify_all();
}
void ZonesOverlay::DrawActiveZoneSet(const IZoneSet::ZonesMap& zones,
const ZoneIndexSet& highlightZones,
const ZoneColors& colors)
void ZoneWindowDrawing::DrawActiveZoneSet(const IZoneSet::ZonesMap& zones,
const ZoneIndexSet& highlightZones,
const ZoneColors& colors)
{
_TRACER_;
std::unique_lock lock(m_mutex);
@ -344,7 +345,7 @@ void ZonesOverlay::DrawActiveZoneSet(const IZoneSet::ZonesMap& zones,
}
}
ZonesOverlay::~ZonesOverlay()
ZoneWindowDrawing::~ZoneWindowDrawing()
{
{
std::unique_lock lock(m_mutex);

View file

@ -13,7 +13,7 @@
#include "FancyZones.h"
#include "ZoneColors.h"
class ZonesOverlay
class ZoneWindowDrawing
{
struct DrawableRect
{
@ -60,8 +60,8 @@ class ZonesOverlay
public:
~ZonesOverlay();
ZonesOverlay(HWND window);
~ZoneWindowDrawing();
ZoneWindowDrawing(HWND window);
void Hide();
void Show();
void Flash();

View file

@ -1002,9 +1002,6 @@ Made with 💗 by Microsoft and the PowerToys community.</value>
<data name="FileExplorerPreview_AffectsAllUsers.Title" xml:space="preserve">
<value>The settings on this page affect all users on the system</value>
</data>
<data name="FileExplorerPreview_TogglePreviewPane.Text" xml:space="preserve">
<value>Please ensure that Preview Pane is open by toggling the view with Alt + P in File Explorer</value>
</data>
<data name="FileExplorerPreview_RebootRequired.Title" xml:space="preserve">
<value>A reboot may be required for changes to these settings to take effect</value>
</data>

View file

@ -35,7 +35,6 @@
/>
<controls:SettingsGroup x:Uid="FileExplorerPreview_PreviewPane_GroupSettings">
<TextBlock x:Uid="FileExplorerPreview_TogglePreviewPane" Margin="0,0,0,8" Foreground="{ThemeResource TextFillColorSecondaryBrush}" />
<controls:Setting x:Uid="FileExplorerPreview_ToggleSwitch_Preview_SVG" Icon="&#xE91B;">
<controls:Setting.ActionContent>
<ToggleSwitch IsOn="{x:Bind Mode=TwoWay, Path=ViewModel.SVGRenderIsEnabled}"

View file

@ -74,7 +74,7 @@ int GetHighlightedZoneIdx(const std::vector<RECT>& zones, const POINT& cursorPos
return -1;
}
void ShowZonesOverlay()
void ShowZoneWindow()
{
// InvalidateRect will essentially send WM_PAINT to main window.
UINT flags = SWP_NOSIZE | SWP_NOMOVE | SWP_NOACTIVATE;
@ -86,7 +86,7 @@ void ShowZonesOverlay()
} }.detach();
}
void HideZonesOverlay()
void HideZoneWindow()
{
highlighted = std::vector<bool>(ZONE_COUNT, false);
ShowWindow(mainWindow, SW_HIDE);
@ -114,7 +114,7 @@ void RefreshMainWindow()
highlighted = std::vector<bool>(ZONE_COUNT, false);
highlighted[idx] = true;
ShowZonesOverlay();
ShowZoneWindow();
}
}
}
@ -138,11 +138,11 @@ LRESULT CALLBACK LowLevelKeyboardProc(int nCode, WPARAM wParam, LPARAM lParam)
showZoneLayout = !showZoneLayout;
if (showZoneLayout)
{
ShowZonesOverlay();
ShowZoneWindow();
}
else
{
HideZonesOverlay();
HideZoneWindow();
}
return 1;
}