FancyZones: optimize elevation detection logic (#2103)

This commit is contained in:
Andrey Nekrasov
2020-04-13 18:22:37 +03:00
committed by GitHub
parent 6bb0f18d53
commit 86704efcec
4 changed files with 23 additions and 21 deletions

View File

@@ -867,10 +867,8 @@ void FancyZones::UpdateDragState(HWND window, require_write_lock) noexcept
m_dragEnabled = !(shift | mouse);
}
const bool windowElevated = IsProcessOfWindowElevated(window);
static const bool meElevated = is_process_elevated();
static bool warning_shown = false;
if (windowElevated && !meElevated)
if (!is_process_elevated() && IsProcessOfWindowElevated(window))
{
m_dragEnabled = false;
if (!warning_shown && !is_cant_drag_elevated_warning_disabled())