mirror of
https://github.com/kangyu-california/PersistentWindows.git
synced 2025-05-11 13:05:38 +02:00
use ctrl-move or ctrl-resize to activate dual position switch feature
This commit is contained in:
parent
82fa1833d5
commit
26714e7e82
2 changed files with 13 additions and 6 deletions
|
@ -108,7 +108,9 @@ namespace PersistentWindows.Common
|
|||
public int haltRestore = 3000; //milliseconds to wait to finish current halted restore and restart next one
|
||||
private HashSet<IntPtr> restoredWindows = new HashSet<IntPtr>();
|
||||
private HashSet<IntPtr> topmostWindowsFixed = new HashSet<IntPtr>();
|
||||
public bool enableSmartForeBackground = false;
|
||||
|
||||
public bool enableDualPosSwitch = true;
|
||||
private HashSet<IntPtr> dualPosSwitchWindows = new HashSet<IntPtr>();
|
||||
|
||||
private Dictionary<string, string> realProcessFileName = new Dictionary<string, string>()
|
||||
{
|
||||
|
@ -1221,6 +1223,7 @@ namespace PersistentWindows.Common
|
|||
debugWindows.Remove(hwnd);
|
||||
fullScreenGamingWindows.Remove(hwnd);
|
||||
windowTitle.Remove(hwnd);
|
||||
dualPosSwitchWindows.Remove(hwnd);
|
||||
|
||||
foreach (var key in monitorApplications.Keys)
|
||||
{
|
||||
|
@ -1479,6 +1482,11 @@ namespace PersistentWindows.Common
|
|||
break;
|
||||
|
||||
case User32Events.EVENT_SYSTEM_MOVESIZESTART:
|
||||
if (ctrl_key_pressed)
|
||||
dualPosSwitchWindows.Add(hwnd);
|
||||
else
|
||||
dualPosSwitchWindows.Remove(hwnd);
|
||||
|
||||
curMovingWnd = hwnd;
|
||||
break;
|
||||
|
||||
|
@ -1814,7 +1822,9 @@ namespace PersistentWindows.Common
|
|||
if (hwnd == IntPtr.Zero || IsTaskBar(hwnd))
|
||||
return;
|
||||
|
||||
if (!enableSmartForeBackground)
|
||||
if (!enableDualPosSwitch)
|
||||
return;
|
||||
if (!dualPosSwitchWindows.Contains(hwnd))
|
||||
return;
|
||||
|
||||
if (!monitorApplications.ContainsKey(curDisplayKey) || !monitorApplications[curDisplayKey].ContainsKey(hwnd))
|
||||
|
|
|
@ -165,10 +165,7 @@ namespace PersistentWindows.SystrayShell
|
|||
fix_unminimized_window = false;
|
||||
break;
|
||||
case "-foreground_background_dual_position=0":
|
||||
pwp.enableSmartForeBackground = false;
|
||||
break;
|
||||
case "-foreground_background_dual_position=1":
|
||||
pwp.enableSmartForeBackground = true;
|
||||
pwp.enableDualPosSwitch = false;
|
||||
break;
|
||||
case "-prompt_session_restore":
|
||||
prompt_session_restore = true;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue