mirror of
https://github.com/2dust/v2rayN.git
synced 2026-04-14 19:45:45 +00:00
Compare commits
2 commits
d8ca5f9800
...
acf93fa8dd
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
acf93fa8dd | ||
|
|
523dfb7acf |
3 changed files with 10 additions and 3 deletions
|
|
@ -1101,6 +1101,13 @@ public class Utils
|
|||
|
||||
public static bool IsLinux() => OperatingSystem.IsLinux();
|
||||
|
||||
public static bool IsWayland() =>
|
||||
OperatingSystem.IsLinux()
|
||||
&& (
|
||||
Environment.GetEnvironmentVariable("WAYLAND_DISPLAY").IsNotEmpty()
|
||||
|| string.Equals(Environment.GetEnvironmentVariable("XDG_SESSION_TYPE"), "wayland", StringComparison.OrdinalIgnoreCase)
|
||||
);
|
||||
|
||||
public static bool IsMacOS() => OperatingSystem.IsMacOS();
|
||||
|
||||
public static bool IsNonWindows() => !OperatingSystem.IsWindows();
|
||||
|
|
|
|||
|
|
@ -8,7 +8,7 @@ public class WindowBase<TViewModel> : ReactiveWindow<TViewModel> where TViewMode
|
|||
|
||||
public WindowBase()
|
||||
{
|
||||
if (Utils.IsLinux())
|
||||
if (Utils.IsWayland())
|
||||
{
|
||||
SystemDecorations = SystemDecorations.BorderOnly;
|
||||
}
|
||||
|
|
@ -65,7 +65,7 @@ public class WindowBase<TViewModel> : ReactiveWindow<TViewModel> where TViewMode
|
|||
|
||||
private void ConfigureLinuxTitleBar()
|
||||
{
|
||||
if (!Utils.IsLinux())
|
||||
if (!Utils.IsWayland())
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -18,7 +18,7 @@ internal class UI
|
|||
WindowStartupLocation = WindowStartupLocation.CenterOwner,
|
||||
CanResize = false,
|
||||
Topmost = false,
|
||||
SystemDecorations = Utils.IsLinux() ? SystemDecorations.BorderOnly : SystemDecorations.Full
|
||||
SystemDecorations = Utils.IsWayland() ? SystemDecorations.BorderOnly : SystemDecorations.Full
|
||||
};
|
||||
var box = MessageBoxManager.GetMessageBoxStandard(messageBoxParams);
|
||||
return await box.ShowWindowDialogAsync(owner);
|
||||
|
|
|
|||
Loading…
Reference in a new issue