Skip to content

Commit 6629a2e

Browse files
committed
Removed auto hide taskbar workaround
1 parent e32677a commit 6629a2e

File tree

2 files changed

+0
-39
lines changed

2 files changed

+0
-39
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 & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@
1212
using Sentry;
1313
using Sentry.Protocol;
1414
using System.IO;
15-
using System.Security;
1615
using System.Text;
1716
using Windows.ApplicationModel;
1817
using Windows.Storage;
@@ -347,30 +346,6 @@ public static void HandleAppUnhandledException(Exception? ex, bool showToastNoti
347346
Process.GetCurrentProcess().Kill();
348347
}
349348

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

0 commit comments

Comments
 (0)