Skip to content

Commit

Permalink
refix #301, avoid restore taskbar when exit from fullscreen gaming
Browse files Browse the repository at this point in the history
  • Loading branch information
kangyu-california committed Apr 21, 2024
1 parent 6a57689 commit d2c4113
Showing 1 changed file with 10 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,7 @@ private Dictionary<string, Dictionary<IntPtr, List<ApplicationDisplayMetrics>>>
private IntPtr realForeGroundWindow = IntPtr.Zero;
public Dictionary<uint, string> processCmd = new Dictionary<uint, string>();
private HashSet<IntPtr> fullScreenGamingWindows = new HashSet<IntPtr>();
private bool exitFullScreenGaming = false;
private POINT initCursorPos;
private bool freezeCapture = false;
public bool rejectScaleFactorChange = true;
Expand Down Expand Up @@ -460,6 +461,7 @@ public bool Start(bool auto_restore_from_db = false)
restoringFromMem = false;
bool wasRestoringSnapshot = restoringSnapshot;
restoringSnapshot = false;
exitFullScreenGaming = false;
ResetState();

Log.Trace("");
Expand Down Expand Up @@ -1363,7 +1365,11 @@ private void WinEventProc(IntPtr hWinEventHook, User32Events eventType, IntPtr h
noRestoreWindows.Remove(hwnd);
windowProcessName.Remove(hwnd);
debugWindows.Remove(hwnd);
fullScreenGamingWindows.Remove(hwnd);
if (fullScreenGamingWindows.Contains(hwnd))
{
fullScreenGamingWindows.Remove(hwnd);
exitFullScreenGaming = true;
}
windowTitle.Remove(hwnd);
dualPosSwitchWindows.Remove(hwnd);

Expand Down Expand Up @@ -3446,6 +3452,9 @@ ApplicationDisplayMetrics SearchDb(IEnumerable<ApplicationDisplayMetrics> result
if (!fixTaskBar && !restoringFromDB && !restoringSnapshot)
continue;

if (exitFullScreenGaming)
continue;

int taskbarMovable = (int)Registry.GetValue(@"HKEY_CURRENT_USER\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\Advanced", "TaskbarSizeMove", 1);
if (taskbarMovable == 0)
{
Expand Down

0 comments on commit d2c4113

Please sign in to comment.