mirror of
https://github.com/GraphiteEditor/Graphite.git
synced 2026-09-22 07:48:12 +08:00
Desktop: Limit application to a single instance (#3441)
* only allow single instance * more reliable CEF cache cleanup * some cleanup * fix lock file location * add simple signal handling * fix skew handles on desktop * mac remove unused helpers
This commit is contained in:
@@ -11,7 +11,7 @@ use super::CefContext;
|
||||
use super::singlethreaded::SingleThreadedCefContext;
|
||||
use crate::cef::CefEventHandler;
|
||||
use crate::cef::consts::{RESOURCE_DOMAIN, RESOURCE_SCHEME};
|
||||
use crate::cef::dirs::create_instance_dir;
|
||||
use crate::cef::dirs::{create_instance_dir, delete_instance_dirs};
|
||||
use crate::cef::input::InputState;
|
||||
use crate::cef::internal::{BrowserProcessAppImpl, BrowserProcessClientImpl, RenderProcessAppImpl, SchemeHandlerFactoryImpl};
|
||||
|
||||
@@ -85,6 +85,7 @@ impl<H: CefEventHandler> CefContextBuilder<H> {
|
||||
|
||||
#[cfg(target_os = "macos")]
|
||||
pub(crate) fn initialize(self, event_handler: H, disable_gpu_acceleration: bool) -> Result<impl CefContext, InitError> {
|
||||
delete_instance_dirs();
|
||||
let instance_dir = create_instance_dir();
|
||||
|
||||
let exe = std::env::current_exe().expect("cannot get current exe path");
|
||||
@@ -105,6 +106,7 @@ impl<H: CefEventHandler> CefContextBuilder<H> {
|
||||
|
||||
#[cfg(not(target_os = "macos"))]
|
||||
pub(crate) fn initialize(self, event_handler: H, disable_gpu_acceleration: bool) -> Result<impl CefContext, InitError> {
|
||||
delete_instance_dirs();
|
||||
let instance_dir = create_instance_dir();
|
||||
|
||||
let settings = Settings {
|
||||
|
||||
Reference in New Issue
Block a user