Only apply subsystem to final binary, not cdylibs (#5002)
This commit is contained in:
1 parent
75d9ece3af
commit
84efc00757
10 files changed
+177
-60
No files matched your search
@@ -67,6 +67,7 @@ pub struct Config {
|
||||
pub(crate) window_close_behavior: WindowCloseBehaviour,
|
||||
pub(crate) custom_event_handler: Option<CustomEventHandler>,
|
||||
pub(crate) disable_file_drop_handler: bool,
|
||||
pub(crate) additional_windows_args: Option<String>,
|
||||
|
||||
#[allow(clippy::type_complexity)]
|
||||
pub(crate) on_window: Option<Box<dyn FnMut(Arc<Window>, &mut VirtualDom) + 'static>>,
|
||||
@@ -118,6 +119,7 @@ impl Config {
|
||||
custom_event_handler: None,
|
||||
disable_file_drop_handler: false,
|
||||
on_window: None,
|
||||
additional_windows_args: None,
|
||||
}
|
||||
}
|
||||
|
||||
@@ -312,6 +314,12 @@ impl Config {
|
||||
self.on_window = Some(Box::new(f));
|
||||
self
|
||||
}
|
||||
|
||||
/// Add additional windows only launch arguments for webview2
|
||||
pub fn with_windows_browser_args(mut self, additional_args: impl ToString) -> Self {
|
||||
self.additional_windows_args = Some(additional_args.to_string());
|
||||
self
|
||||
}
|
||||
}
|
||||
|
||||
impl Default for Config {
|
||||
|
||||
@@ -442,6 +442,14 @@ impl WebviewInstance {
|
||||
None
|
||||
};
|
||||
|
||||
#[cfg(target_os = "windows")]
|
||||
{
|
||||
use wry::WebViewBuilderExtWindows;
|
||||
if let Some(additional_windows_args) = &cfg.additional_windows_args {
|
||||
webview = webview.with_additional_browser_args(additional_windows_args);
|
||||
}
|
||||
}
|
||||
|
||||
#[cfg(any(
|
||||
target_os = "windows",
|
||||
target_os = "macos",
|
||||
|
||||
Reference in new issue
Block a user