mirror of
https://github.com/kangyu-california/PersistentWindows.git
synced 2025-05-10 12:35:37 +02:00
avoid trigger batch restore in restore single window mode
This commit is contained in:
parent
e7b141e095
commit
1fd82f35c8
1 changed files with 4 additions and 1 deletions
|
@ -106,6 +106,7 @@ namespace PersistentWindows.Common
|
|||
private Timer restoreTimer;
|
||||
private Timer restoreFinishedTimer;
|
||||
public bool restoringFromMem = false; // automatic restore from memory or snapshot
|
||||
private bool restoreSingleWindow = false;
|
||||
public bool restoringFromDB = false; // manual restore from DB
|
||||
public bool autoInitialRestoreFromDB = false;
|
||||
public bool restoringSnapshot = false; // implies restoringFromMem
|
||||
|
@ -2113,7 +2114,7 @@ namespace PersistentWindows.Common
|
|||
|
||||
if (eventType == User32Events.EVENT_OBJECT_LOCATIONCHANGE)
|
||||
{
|
||||
if ((remoteSession || restoreTimes >= MinRestoreTimes) && !restoringSnapshot)
|
||||
if (((remoteSession && !restoreSingleWindow) || restoreTimes >= MinRestoreTimes) && !restoringSnapshot)
|
||||
{
|
||||
// restore is not finished as long as window location keeps changing
|
||||
CancelRestoreFinishedTimer();
|
||||
|
@ -3214,8 +3215,10 @@ namespace PersistentWindows.Common
|
|||
if (!restoringFromDB && IsResizableWindow(hwnd))
|
||||
{
|
||||
Log.Trace($"restore {windowTitle[hwnd]} to last captured position");
|
||||
restoreSingleWindow = true;
|
||||
restoringFromMem = true;
|
||||
RestoreApplicationsOnCurrentDisplays(curDisplayKey, hwnd, prevDisplayMetrics.CaptureTime);
|
||||
restoreSingleWindow = false;
|
||||
restoringFromMem = false;
|
||||
userMove = true;
|
||||
StartCaptureTimer(UserMoveLatency / 2);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue