[EXPLORER] Save taskbar position and locked state after reboot (#5393)

- Save locked state of the taskbar when toggled using its context menu.
- Save position of the taskbar after dragging it around the desktop.
- Invoke TRAYCMD_LOCK_TASKBAR command when (un)locking the taskbar
  by the context menu, instead of duplicating this functionality.

CORE-11621 CORE-16997
This commit is contained in:
Carl J. Bialorucki 2023-07-04 07:16:24 -06:00 committed by GitHub
parent bfb973e0b3
commit 7fafeb6390
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -843,10 +843,7 @@ public:
break;
case ID_LOCKTASKBAR:
if (SHRestricted(REST_CLASSICSHELL) == 0)
{
Lock(!g_TaskbarSettings.bLock);
}
HandleCommand(TRAYCMD_LOCK_TASKBAR);
break;
case ID_SHELL_CMD_OPEN_TASKMGR:
@ -1016,6 +1013,7 @@ public:
if (SHRestricted(REST_CLASSICSHELL) == 0)
{
Lock(!g_TaskbarSettings.bLock);
g_TaskbarSettings.Save();
}
break;
case TRAYCMD_HELP_AND_SUPPORT:
@ -1609,6 +1607,8 @@ GetPrimaryScreenRect:
m_Monitor = m_DraggingMonitor;
m_Position = m_DraggingPosition;
g_TaskbarSettings.sr.Position = m_Position;
g_TaskbarSettings.Save();
IsDragging = FALSE;
m_TrayRects[m_Position] = rcTray;