-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
79d94be
commit 26acd69
Showing
20 changed files
with
1,309 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
using System.Windows; | ||
|
||
[assembly: ThemeInfo( | ||
ResourceDictionaryLocation.None, //where theme specific resource dictionaries are located | ||
//(used if a resource is not found in the page, | ||
// or application resource dictionaries) | ||
ResourceDictionaryLocation.SourceAssembly //where the generic resource dictionary is located | ||
//(used if a resource is not found in the page, | ||
// app, or any theme specific resource dictionaries) | ||
)] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
<Project Sdk="Microsoft.NET.Sdk"> | ||
|
||
<PropertyGroup> | ||
<OutputType>WinExe</OutputType> | ||
<TargetFramework>net6.0-windows10.0.22621.0</TargetFramework> | ||
<Nullable>enable</Nullable> | ||
<UseWPF>true</UseWPF> | ||
<UseWindowsForms>true</UseWindowsForms> | ||
<ApplicationManifest>app.manifest</ApplicationManifest> | ||
<ApplicationHighDpiMode>PerMonitorV2</ApplicationHighDpiMode> | ||
</PropertyGroup> | ||
|
||
<ItemGroup> | ||
<None Remove="img\Icon1.ico" /> | ||
</ItemGroup> | ||
|
||
<ItemGroup> | ||
<Page Remove="src\App.xaml" /> | ||
</ItemGroup> | ||
|
||
<ItemGroup> | ||
<ApplicationDefinition Include="src\App.xaml" /> | ||
</ItemGroup> | ||
|
||
<ItemGroup> | ||
<PackageReference Include="Hardcodet.NotifyIcon.Wpf" Version="1.1.0" /> | ||
</ItemGroup> | ||
|
||
<ItemGroup> | ||
<ProjectReference Include="..\..\VirtualDesktop\src\VirtualDesktop.WPF\VirtualDesktop.WPF.csproj" /> | ||
<ProjectReference Include="..\..\VirtualDesktop\src\VirtualDesktop\VirtualDesktop.csproj" /> | ||
</ItemGroup> | ||
|
||
<ItemGroup> | ||
<Resource Include="img\Icon1.ico" /> | ||
</ItemGroup> | ||
|
||
</Project> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<Project ToolsVersion="Current" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> | ||
<PropertyGroup /> | ||
<ItemGroup /> | ||
</Project> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
|
||
Microsoft Visual Studio Solution File, Format Version 12.00 | ||
# Visual Studio Version 17 | ||
VisualStudioVersion = 17.6.33815.320 | ||
MinimumVisualStudioVersion = 10.0.40219.1 | ||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "WindowManager", "WindowManager.csproj", "{BA3222C3-CB93-47E4-903E-0F8D6B42A51B}" | ||
EndProject | ||
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "VirtualDesktop", "..\..\VirtualDesktop\src\VirtualDesktop\VirtualDesktop.csproj", "{901BD408-894E-4D9E-B6DB-1518E42E8B2D}" | ||
EndProject | ||
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "VirtualDesktop.WPF", "..\..\VirtualDesktop\src\VirtualDesktop.WPF\VirtualDesktop.WPF.csproj", "{93A90C32-CFA3-42ED-A45E-861E0BD35285}" | ||
EndProject | ||
Global | ||
GlobalSection(SolutionConfigurationPlatforms) = preSolution | ||
Debug|Any CPU = Debug|Any CPU | ||
Release|Any CPU = Release|Any CPU | ||
EndGlobalSection | ||
GlobalSection(ProjectConfigurationPlatforms) = postSolution | ||
{BA3222C3-CB93-47E4-903E-0F8D6B42A51B}.Debug|Any CPU.ActiveCfg = Debug|Any CPU | ||
{BA3222C3-CB93-47E4-903E-0F8D6B42A51B}.Debug|Any CPU.Build.0 = Debug|Any CPU | ||
{BA3222C3-CB93-47E4-903E-0F8D6B42A51B}.Release|Any CPU.ActiveCfg = Release|Any CPU | ||
{BA3222C3-CB93-47E4-903E-0F8D6B42A51B}.Release|Any CPU.Build.0 = Release|Any CPU | ||
{901BD408-894E-4D9E-B6DB-1518E42E8B2D}.Debug|Any CPU.ActiveCfg = Debug|Any CPU | ||
{901BD408-894E-4D9E-B6DB-1518E42E8B2D}.Debug|Any CPU.Build.0 = Debug|Any CPU | ||
{901BD408-894E-4D9E-B6DB-1518E42E8B2D}.Release|Any CPU.ActiveCfg = Release|Any CPU | ||
{901BD408-894E-4D9E-B6DB-1518E42E8B2D}.Release|Any CPU.Build.0 = Release|Any CPU | ||
{93A90C32-CFA3-42ED-A45E-861E0BD35285}.Debug|Any CPU.ActiveCfg = Debug|Any CPU | ||
{93A90C32-CFA3-42ED-A45E-861E0BD35285}.Debug|Any CPU.Build.0 = Debug|Any CPU | ||
{93A90C32-CFA3-42ED-A45E-861E0BD35285}.Release|Any CPU.ActiveCfg = Release|Any CPU | ||
{93A90C32-CFA3-42ED-A45E-861E0BD35285}.Release|Any CPU.Build.0 = Release|Any CPU | ||
EndGlobalSection | ||
GlobalSection(SolutionProperties) = preSolution | ||
HideSolutionNode = FALSE | ||
EndGlobalSection | ||
GlobalSection(ExtensibilityGlobals) = postSolution | ||
SolutionGuid = {B72B5848-B147-47F2-A973-BB36F4E60317} | ||
EndGlobalSection | ||
EndGlobal |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,61 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<assembly manifestVersion="1.0" xmlns="urn:schemas-microsoft-com:asm.v1"> | ||
<assemblyIdentity version="1.0.0.0" name="MyApplication.app"/> | ||
<trustInfo xmlns="urn:schemas-microsoft-com:asm.v2"> | ||
<security> | ||
<requestedPrivileges xmlns="urn:schemas-microsoft-com:asm.v3"> | ||
<!-- UAC Manifest Options | ||
If you want to change the Windows User Account Control level replace the | ||
requestedExecutionLevel node with one of the following. | ||
<requestedExecutionLevel level="asInvoker" uiAccess="false" /> | ||
<requestedExecutionLevel level="requireAdministrator" uiAccess="false" /> | ||
<requestedExecutionLevel level="highestAvailable" uiAccess="false" /> | ||
Specifying requestedExecutionLevel element will disable file and registry virtualization. | ||
Remove this element if your application requires this virtualization for backwards | ||
compatibility. | ||
--> | ||
<requestedExecutionLevel level="requireAdministrator" uiAccess="false" /> | ||
</requestedPrivileges> | ||
</security> | ||
</trustInfo> | ||
|
||
<compatibility xmlns="urn:schemas-microsoft-com:compatibility.v1"> | ||
<application> | ||
<!-- Windows 10 --> | ||
<supportedOS Id="{8e0f7a12-bfb3-4fe8-b9a5-48fd50a15a9a}" /> | ||
</application> | ||
</compatibility> | ||
|
||
|
||
<!-- Indicates that the application is DPI-aware and will not be automatically scaled by Windows at higher | ||
DPIs. Windows Presentation Foundation (WPF) applications are automatically DPI-aware and do not need | ||
to opt in. Windows Forms applications targeting .NET Framework 4.6 that opt into this setting, should | ||
also set the 'EnableWindowsFormsHighDpiAutoResizing' setting to 'true' in their app.config. | ||
Makes the application long-path aware. See https://docs.microsoft.com/windows/win32/fileio/maximum-file-path-limitation --> | ||
|
||
<application xmlns="urn:schemas-microsoft-com:asm.v3"> | ||
<windowsSettings> | ||
<dpiAware xmlns="http://schemas.microsoft.com/SMI/2005/WindowsSettings">true</dpiAware> | ||
</windowsSettings> | ||
</application> | ||
|
||
<!-- Enable themes for Windows common controls and dialogs (Windows XP and later) --> | ||
<!-- | ||
<dependency> | ||
<dependentAssembly> | ||
<assemblyIdentity | ||
type="win32" | ||
name="Microsoft.Windows.Common-Controls" | ||
version="6.0.0.0" | ||
processorArchitecture="*" | ||
publicKeyToken="6595b64144ccf1df" | ||
language="*" | ||
/> | ||
</dependentAssembly> | ||
</dependency> | ||
--> | ||
|
||
</assembly> |
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
<Application x:Class="WindowManager.App" | ||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" | ||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" | ||
xmlns:local="clr-namespace:WindowManager" | ||
StartupUri="src/layout/MainWindow.xaml"> | ||
<Application.Resources> | ||
|
||
</Application.Resources> | ||
</Application> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
using System.Windows; | ||
using System.Windows.Interop; | ||
using System.Windows.Navigation; | ||
|
||
namespace WindowManager | ||
{ | ||
/// <summary> | ||
/// Interaction logic for App.xaml | ||
/// </summary> | ||
public partial class App : Application | ||
{ | ||
|
||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,131 @@ | ||
using System; | ||
using System.Collections.Generic; | ||
using System.Linq; | ||
using System.Runtime.InteropServices; | ||
using System.Text; | ||
using System.Threading.Tasks; | ||
using System.Windows.Forms; | ||
using System.Windows.Input; | ||
|
||
namespace WindowManager | ||
{ | ||
internal class Constants | ||
{ | ||
public static readonly List<Key> WindowFunctionKeys = new() | ||
{ | ||
Key.Q, // Kill Window | ||
Key.A // Arrange Windows on Monitor | ||
}; | ||
|
||
public static readonly Key KillWindowKey = WindowFunctionKeys.ElementAt(0); | ||
public static readonly Key ArrangeWindowsKey = WindowFunctionKeys.ElementAt(1); | ||
|
||
|
||
public static readonly List<Key> WorkspaceKeys = new() | ||
{ | ||
Key.D1, | ||
Key.D2, | ||
Key.D3, | ||
Key.D4, | ||
Key.D5 | ||
}; | ||
|
||
public static readonly List<Key> MotionKeys = new() | ||
{ | ||
Key.H, | ||
Key.N, | ||
Key.E, | ||
Key.I | ||
}; | ||
|
||
public enum Direction | ||
{ | ||
Left, | ||
Down, | ||
Up, | ||
Right | ||
}; | ||
|
||
public static readonly Dictionary<Key, Direction> MotionKeyDirection = new() | ||
{ | ||
{ MotionKeys.ElementAt(0), Direction.Left }, | ||
{ MotionKeys.ElementAt(1), Direction.Down }, | ||
{ MotionKeys.ElementAt(2), Direction.Up }, | ||
{ MotionKeys.ElementAt(3), Direction.Right } | ||
}; | ||
|
||
public static readonly List<Key> ModifierKeys = new() | ||
{ | ||
Key.LWin, | ||
Key.RWin, | ||
Key.LeftShift, | ||
Key.RightShift, | ||
Key.LeftCtrl, | ||
Key.RightCtrl, | ||
Key.LeftAlt, | ||
Key.RightAlt | ||
}; | ||
|
||
public static readonly List<Key> AllKeys = WindowFunctionKeys.Concat(WorkspaceKeys).Concat(MotionKeys).ToList(); | ||
|
||
|
||
public enum SplitMode | ||
{ | ||
Horizontal, | ||
Vertical | ||
} | ||
|
||
[StructLayout(LayoutKind.Sequential)] | ||
public struct WindowPos | ||
{ | ||
public int Left; // x start | ||
public int Top; // y start | ||
public int Right; // x end | ||
public int Bottom; // y end | ||
} | ||
|
||
public enum DwmWindowAttribute : uint | ||
{ | ||
NCRenderingEnabled = 1, | ||
NCRenderingPolicy, | ||
TransitionsForceDisabled, | ||
AllowNCPaint, | ||
CaptionButtonBounds, | ||
NonClientRtlLayout, | ||
ForceIconicRepresentation, | ||
Flip3DPolicy, | ||
ExtendedFrameBounds, | ||
HasIconicBitmap, | ||
DisallowPeek, | ||
ExcludedFromPeek, | ||
Cloak, | ||
Cloaked, | ||
FreezeRepresentation, | ||
PassiveUpdateMode, | ||
UseHostBackdropBrush, | ||
UseImmersiveDarkMode = 20, | ||
WindowCornerPreference = 33, | ||
BorderColor, | ||
CaptionColor, | ||
TextColor, | ||
VisibleFrameBorderThickness, | ||
SystemBackdropType, | ||
Last | ||
} | ||
|
||
public enum WindowStyles : UInt64 | ||
{ | ||
WS_VISIBLE = 0x10000000L, | ||
WS_CAPTION = 0x00C00000L, | ||
WS_MAXIMIZEBOX = 0x00010000L | ||
} | ||
|
||
public static readonly List<String> WindowBlacklist = new() | ||
{ | ||
"NVIDIA GeForce Overlay", | ||
"Windows Input Experience", | ||
"Settings", | ||
"Setup" | ||
}; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
using System.Collections.Generic; | ||
using System.Windows.Documents; | ||
using System.Windows.Input; | ||
|
||
namespace WindowManager.src.data | ||
{ | ||
internal class KeyCombo | ||
{ | ||
public HashSet<Key>? Modifiers { get; set; } | ||
public Key? Key { get; set; } | ||
|
||
public KeyCombo() | ||
{ | ||
this.Modifiers = null; | ||
this.Key = null; | ||
} | ||
|
||
public KeyCombo(HashSet<Key> modifiers, Key key) | ||
{ | ||
this.Modifiers = modifiers; | ||
this.Key = key; | ||
} | ||
|
||
public void AddModifier(Key modifier) | ||
{ | ||
Modifiers ??= new(); | ||
Modifiers.Add(modifier); | ||
} | ||
|
||
public void RemoveModifier(Key modifier) | ||
{ | ||
if (Modifiers == null) return; | ||
Modifiers.Remove(modifier); | ||
} | ||
|
||
public override string? ToString() | ||
{ | ||
string mods = ""; | ||
|
||
if (Modifiers != null) | ||
{ | ||
List<Key> modKeys = new(Modifiers); | ||
modKeys.ForEach(mod => mods += mod.ToString() + " + "); | ||
} | ||
var key = Key.ToString(); | ||
return mods + key; | ||
} | ||
} | ||
} |
Oops, something went wrong.