mirror of
https://github.com/kangyu-california/PersistentWindows.git
synced 2025-05-12 13:35:39 +02:00
new feature: ctrl click desktop window to bring foreground window to previous background z-order
This commit is contained in:
parent
bc25a0ea01
commit
21e664b4c0
1 changed files with 9 additions and 6 deletions
|
@ -598,7 +598,7 @@ namespace PersistentWindows.Common
|
||||||
else if (ctrl_key_pressed && !alt_key_pressed)
|
else if (ctrl_key_pressed && !alt_key_pressed)
|
||||||
{
|
{
|
||||||
//restore to previous background zorder with current size/pos
|
//restore to previous background zorder with current size/pos
|
||||||
SwitchForeBackground(hwnd, updateBackgroundPos: true, secondBackGround:shift_key_pressed);
|
SwitchForeBackground(hwnd, strict_dps_check: false, updateBackgroundPos: true, secondBackGround:shift_key_pressed);
|
||||||
}
|
}
|
||||||
else if (!ctrl_key_pressed && alt_key_pressed && !shift_key_pressed)
|
else if (!ctrl_key_pressed && alt_key_pressed && !shift_key_pressed)
|
||||||
{
|
{
|
||||||
|
@ -2451,15 +2451,18 @@ namespace PersistentWindows.Common
|
||||||
Log.Event("Bring foreground window {0} to bottom", GetWindowTitle(hwnd));
|
Log.Event("Bring foreground window {0} to bottom", GetWindowTitle(hwnd));
|
||||||
}
|
}
|
||||||
|
|
||||||
public void SwitchForeBackground(IntPtr hwnd, bool toForeground=false, bool updateBackgroundPos=false, bool secondBackGround = false)
|
public void SwitchForeBackground(IntPtr hwnd, bool strict_dps_check = true, bool toForeground=false, bool updateBackgroundPos=false, bool secondBackGround = false)
|
||||||
{
|
{
|
||||||
if (hwnd == IntPtr.Zero || IsTaskBar(hwnd))
|
if (hwnd == IntPtr.Zero || IsTaskBar(hwnd))
|
||||||
return;
|
return;
|
||||||
|
|
||||||
if (!enableDualPosSwitch)
|
if (strict_dps_check)
|
||||||
return;
|
{
|
||||||
if (!dualPosSwitchWindows.Contains(hwnd))
|
if (!enableDualPosSwitch)
|
||||||
return;
|
return;
|
||||||
|
if (!dualPosSwitchWindows.Contains(hwnd))
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
if (!monitorApplications.ContainsKey(curDisplayKey) || !monitorApplications[curDisplayKey].ContainsKey(hwnd))
|
if (!monitorApplications.ContainsKey(curDisplayKey) || !monitorApplications[curDisplayKey].ContainsKey(hwnd))
|
||||||
return;
|
return;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue