From f07afc992b20983d122f31d5fd3dddd7e55e6dbb Mon Sep 17 00:00:00 2001 From: "Dylan M. Taylor" Date: Wed, 28 Oct 2026 18:06:20 +0000 Subject: [PATCH] Scope platform-specific imports --- apps/vectorcraft/src/app.rs | 2 ++ apps/vectorcraft/src/clipboard.rs | 4 +++- apps/vectorcraft/src/host_services.rs | 8 +++++++- apps/vectorcraft/src/titlebar.rs | 4 +++- 4 files changed, 15 insertions(+), 3 deletions(-) diff --git a/apps/vectorcraft/src/app.rs b/apps/vectorcraft/src/app.rs index a27de0a04..d7432ff96 100644 --- a/apps/vectorcraft/src/app.rs +++ b/apps/vectorcraft/src/app.rs @@ -1,4 +1,6 @@ use super::prefs::save_prefs; +#[cfg(all(windows, not(target_vendor = "win7")))] +use super::windows_stylus; use super::{App, VectorcraftApp, file_access, window}; /// The parts of [`App::raw_input_hook`] that every window needs, for the OS windows of floating diff --git a/apps/vectorcraft/src/clipboard.rs b/apps/vectorcraft/src/clipboard.rs index ef3ad5cbc..0b228f62c 100644 --- a/apps/vectorcraft/src/clipboard.rs +++ b/apps/vectorcraft/src/clipboard.rs @@ -164,7 +164,9 @@ mod win { use clipboard_win::{formats, options::NoClear, raw}; - use super::*; + use super::{ + BITMAP, Cursor, Flavour, PNG, SVG, SystemClipboard, TEXT, copied_file, decode_png, dib_image, png_flavour, text_of, windows_formats, + }; /// The device-independent bitmaps, the one that carries alpha first. Each is there whenever the /// other or a `CF_BITMAP` is: the system converts between them. diff --git a/apps/vectorcraft/src/host_services.rs b/apps/vectorcraft/src/host_services.rs index 0f7ede8f6..054dec69f 100644 --- a/apps/vectorcraft/src/host_services.rs +++ b/apps/vectorcraft/src/host_services.rs @@ -1,4 +1,10 @@ -use super::{ClipboardProbeFactory, FilePick, PickRequest, Services, clipboard, cursor_theme, fileio, portal_save, printing, tablet}; +#[cfg(any(target_os = "linux", target_os = "freebsd", target_os = "dragonfly", target_os = "netbsd", target_os = "openbsd"))] +use super::portal_save; +#[cfg(target_os = "linux")] +use super::tablet; +#[cfg(all(windows, not(target_vendor = "win7")))] +use super::windows_stylus; +use super::{ClipboardProbeFactory, FilePick, PickRequest, Services, clipboard, cursor_theme, fileio, printing}; /// The window file dialogs belong to. pub(crate) type Parent = Option>; diff --git a/apps/vectorcraft/src/titlebar.rs b/apps/vectorcraft/src/titlebar.rs index 5cf900f70..6ebac2bea 100644 --- a/apps/vectorcraft/src/titlebar.rs +++ b/apps/vectorcraft/src/titlebar.rs @@ -1,4 +1,6 @@ -use super::{window, xwayland}; +use super::window; +#[cfg(target_os = "linux")] +use super::xwayland; /// The window, Dock, taskbar and app-switcher icon (`assets/app-icon/`, see its README). macOS gets /// the version with Apple's transparent margin; elsewhere the full-bleed tile. The app ID matches