Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
45 changes: 38 additions & 7 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 1 addition & 5 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -15,16 +15,12 @@ version.workspace = true
edition.workspace = true
license.workspace = true

[[bin]]
name = "windisplaymanager_rs"
path = "src/main.rs"

[profile.release]
strip = true
lto = "thin"

[build-dependencies]
winres = "0.1"
winresource = "0.1"

[dependencies]
data.workspace = true
Expand Down
31 changes: 22 additions & 9 deletions build.rs
Original file line number Diff line number Diff line change
@@ -1,11 +1,24 @@
#[cfg(windows)]
fn main() {
let mut res = winres::WindowsResource::new();
res.set_icon("icon.ico");
res.compile().unwrap();
}
const ICON: &str = "resources/icons/icon.ico";
const MANIFEST: &str = "resources/app.manifest";

fn main() -> std::io::Result<()> {
println!("cargo:rerun-if-changed=build.rs");
println!("cargo:rerun-if-changed={ICON}");
println!("cargo:rerun-if-changed={MANIFEST}");

if std::env::var("CARGO_CFG_TARGET_OS").as_deref() != Ok("windows") {
return Ok(());
}

#[cfg(not(windows))]
fn main() {
// No-op for non-Windows platforms
let mut res = winresource::WindowsResource::new();
// data/src/tray.rs loads the tray icon from resource ID 1.
res.set_icon_with_id(ICON, "1");
res.set("ProductName", "WinDisplayManager");
res.set(
"FileDescription",
"WinDisplayManager - DDC/CI monitor control",
);
res.set("LegalCopyright", "Copyright (c) 2026 cyb0rg56");
res.set_manifest_file(MANIFEST);
res.compile()
}
2 changes: 1 addition & 1 deletion packaging/msix/generate-assets.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
#>
[CmdletBinding()]
param(
[string]$IconPath = (Join-Path $PSScriptRoot '..\..\icon.ico'),
[string]$IconPath = (Join-Path $PSScriptRoot '..\..\resources\icons\icon.ico'),
[string]$OutDir = (Join-Path $PSScriptRoot 'Assets')
)

Expand Down
24 changes: 24 additions & 0 deletions resources/app.manifest
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<assembly xmlns="urn:schemas-microsoft-com:asm.v1" manifestVersion="1.0">
<assemblyIdentity type="win32" name="WinDisplayManager" version="1.0.0.0" />
<trustInfo xmlns="urn:schemas-microsoft-com:asm.v3">
<security>
<requestedPrivileges>
<requestedExecutionLevel level="asInvoker" uiAccess="false" />
</requestedPrivileges>
</security>
</trustInfo>
<compatibility xmlns="urn:schemas-microsoft-com:compatibility.v1">
<application>
<!-- Windows 10 and 11 -->
<supportedOS Id="{8e0f7a12-bfb3-4fe8-b9a5-48fd50a15a9a}" />
</application>
</compatibility>
<application xmlns="urn:schemas-microsoft-com:asm.v3">
<windowsSettings>
<dpiAware xmlns="http://schemas.microsoft.com/SMI/2005/WindowsSettings">true/pm</dpiAware>
<dpiAwareness xmlns="http://schemas.microsoft.com/SMI/2016/WindowsSettings">PerMonitorV2</dpiAwareness>
<activeCodePage xmlns="http://schemas.microsoft.com/SMI/2019/WindowsSettings">UTF-8</activeCodePage>
</windowsSettings>
</application>
</assembly>
File renamed without changes.
1 change: 1 addition & 0 deletions ui/src/app.rs
Original file line number Diff line number Diff line change
Expand Up @@ -274,6 +274,7 @@ impl cosmic::Application for AppModel {
} else {
// Window was closed — open a new one
let (new_id, open_task) = window::open(window::Settings {
size: cosmic::iced::Size::new(1920.0, 1080.0),
min_size: Some(cosmic::iced::Size::new(600.0, 400.0)),
decorations: false,
..window::Settings::default()
Expand Down
1 change: 1 addition & 0 deletions ui/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ pub fn run(minimized: bool) -> cosmic::iced::Result {
.antialiasing(false)
// Don't exit when the window is closed — keep running in the tray
.exit_on_close(false)
.size(cosmic::iced::Size::new(1920.0, 1080.0))
.size_limits(
cosmic::iced::Limits::NONE
.min_width(600.0)
Expand Down
Loading