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
10 changes: 10 additions & 0 deletions desktop/src/cef/internal/browser_process_app.rs
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,16 @@ impl<H: CefEventHandler> ImplApp for BrowserProcessAppImpl<H> {

fn on_before_command_line_processing(&self, _process_type: Option<&cef::CefString>, command_line: Option<&mut cef::CommandLine>) {
if let Some(cmd) = command_line {
cmd.append_switch_with_value(Some(&CefString::from("renderer-process-limit")), Some(&CefString::from("1")));
cmd.append_switch_with_value(Some(&CefString::from("disk-cache-size")), Some(&CefString::from("0")));
cmd.append_switch(Some(&CefString::from("incognito")));
cmd.append_switch(Some(&CefString::from("no-first-run")));
cmd.append_switch(Some(&CefString::from("disable-file-system")));
cmd.append_switch(Some(&CefString::from("disable-local-storage")));
cmd.append_switch(Some(&CefString::from("disable-background-networking")));
cmd.append_switch(Some(&CefString::from("disable-audio-input")));
cmd.append_switch(Some(&CefString::from("disable-audio-output")));

#[cfg(not(feature = "accelerated_paint"))]
{
// Disable GPU acceleration when accelerated_paint feature is not enabled
Expand Down
13 changes: 6 additions & 7 deletions desktop/src/window/win.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
use winit::dpi::PhysicalSize;
use winit::event_loop::ActiveEventLoop;
use winit::icon::Icon;
use winit::platform::windows::WinIcon;
use winit::platform::windows::{WinIcon, WindowAttributesWindows};
use winit::window::{Window, WindowAttributes};

use crate::event::AppEventScheduler;
Expand All @@ -11,12 +12,10 @@ pub(super) struct NativeWindowImpl {

impl super::NativeWindow for NativeWindowImpl {
fn configure(attributes: WindowAttributes, _event_loop: &dyn ActiveEventLoop) -> WindowAttributes {
if let Ok(win_icon) = WinIcon::from_resource(1, None) {
let icon = Icon(std::sync::Arc::new(win_icon));
attributes.with_window_icon(Some(icon))
} else {
attributes
}
let icon = WinIcon::from_resource(1, Some(PhysicalSize::new(256, 256))).ok().map(|icon| Icon(std::sync::Arc::new(icon)));
let win_window = WindowAttributesWindows::default().with_taskbar_icon(icon);
let icon = WinIcon::from_resource(1, None).ok().map(|icon| Icon(std::sync::Arc::new(icon)));
attributes.with_window_icon(icon).with_platform_attributes(Box::new(win_window))
}

fn new(window: &dyn Window, _app_event_scheduler: AppEventScheduler) -> Self {
Expand Down