Skip to content

Commit 6b9b149

Browse files
committed
Remove IsAutoHideTaskbarEnabled workaround
1 parent e0ba626 commit 6b9b149

File tree

2 files changed

+0
-38
lines changed

2 files changed

+0
-38
lines changed

src/Files.App/Data/Items/WindowEx.cs

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -54,20 +54,6 @@ public bool IsMaximizable
5454

5555
if (AppWindow.Presenter is OverlappedPresenter overlapped)
5656
overlapped.IsMaximizable = value;
57-
58-
if (value)
59-
{
60-
// WORKAROUND:
61-
// https://github.com/microsoft/microsoft-ui-xaml/issues/8431
62-
// NOTE:
63-
// Indicates to the Shell that the window should not be treated as full-screen
64-
// not to mess up the taskbar when being full-screen mode.
65-
// This property should only be set if the "Automatically hide the taskbar" in Windows 11,
66-
// or "Automatically hide the taskbar in desktop mode" in Windows 10 is enabled.
67-
// Setting this property when the setting is disabled will result in the taskbar overlapping the application.
68-
if (AppLifecycleHelper.IsAutoHideTaskbarEnabled())
69-
Win32PInvoke.SetPropW(WindowHandle, "NonRudeHWND", new IntPtr(1));
70-
}
7157
}
7258
}
7359

src/Files.App/Helpers/Application/AppLifecycleHelper.cs

Lines changed: 0 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -343,30 +343,6 @@ public static void HandleAppUnhandledException(Exception? ex, bool showToastNoti
343343
Process.GetCurrentProcess().Kill();
344344
}
345345

346-
/// <summary>
347-
/// Checks if the taskbar is set to auto-hide.
348-
/// </summary>
349-
public static bool IsAutoHideTaskbarEnabled()
350-
{
351-
try
352-
{
353-
const string registryKey = @"Software\Microsoft\Windows\CurrentVersion\Explorer\StuckRects3";
354-
const string valueName = "Settings";
355-
356-
using var key = Microsoft.Win32.Registry.CurrentUser.OpenSubKey(registryKey);
357-
358-
var value = key?.GetValue(valueName) as byte[];
359-
360-
// The least significant bit of the 9th byte controls the auto-hide setting
361-
return value != null && ((value[8] & 0x01) == 1);
362-
}
363-
catch (SecurityException)
364-
{
365-
// Handle edge case where OpenSubKey results in SecurityException
366-
return false;
367-
}
368-
}
369-
370346
/// <summary>
371347
/// Updates the visibility of the system tray icon
372348
/// </summary>

0 commit comments

Comments
 (0)