mirror of
https://github.com/GraphiteEditor/Graphite.git
synced 2026-09-30 20:58:11 +08:00
Fix
This commit is contained in:
@@ -2,25 +2,10 @@
|
|||||||
|
|
||||||
let
|
let
|
||||||
version = "149.0.5+g6770623+chromium-149.0.7827.197";
|
version = "149.0.5+g6770623+chromium-149.0.7827.197";
|
||||||
hashes = {
|
|
||||||
aarch64-linux = "sha256-cBAvcvs1rAg5EKJkCt81RZYupCWpUNIC/nLt3PJow7Q=";
|
|
||||||
x86_64-linux = "sha256-OPGMBJmvvLiLdBDniBQwx7LmTGGI59AcesJdILSeqcs=";
|
|
||||||
};
|
|
||||||
|
|
||||||
selectSystem =
|
# Local custom CEF build (tarball) instead of the Spotify CDN download.
|
||||||
attrs:
|
# Absolute path outside the flake source tree, so this needs `nix develop --impure`.
|
||||||
attrs.${pkgs.stdenv.hostPlatform.system}
|
src = /home/timon/tmp/cef-build/dist/cef_149_7827_x86-64_linux_fixed_buffer_usage.tar.xz;
|
||||||
or (throw "Unsupported system ${pkgs.stdenv.hostPlatform.system}");
|
|
||||||
|
|
||||||
src = pkgs.fetchurl {
|
|
||||||
url = "https://cef-builds.spotifycdn.com/cef_binary_${version}_${
|
|
||||||
selectSystem {
|
|
||||||
aarch64-linux = "linuxarm64";
|
|
||||||
x86_64-linux = "linux64";
|
|
||||||
}
|
|
||||||
}_minimal.tar.bz2";
|
|
||||||
hash = selectSystem hashes;
|
|
||||||
};
|
|
||||||
in
|
in
|
||||||
pkgs.cef-binary.overrideAttrs (finalAttrs: {
|
pkgs.cef-binary.overrideAttrs (finalAttrs: {
|
||||||
version = builtins.head (builtins.split "\\+" version);
|
version = builtins.head (builtins.split "\\+" version);
|
||||||
@@ -33,12 +18,14 @@ pkgs.cef-binary.overrideAttrs (finalAttrs: {
|
|||||||
mv ./Resources/* $out/
|
mv ./Resources/* $out/
|
||||||
mv ./include $out/
|
mv ./include $out/
|
||||||
|
|
||||||
cat ./CREDITS.html | ${pkgs.xz}/bin/xz -9 -e -c > $out/CREDITS.html.xz
|
if [ -f ./CREDITS.html ]; then
|
||||||
|
cat ./CREDITS.html | ${pkgs.xz}/bin/xz -9 -e -c > $out/CREDITS.html.xz
|
||||||
|
fi
|
||||||
|
|
||||||
echo '${
|
echo '${
|
||||||
builtins.toJSON {
|
builtins.toJSON {
|
||||||
type = "minimal";
|
type = "minimal";
|
||||||
name = builtins.baseNameOf finalAttrs.src.url;
|
name = "cef_binary_${version}_linux64_minimal.tar.xz";
|
||||||
sha1 = "";
|
sha1 = "";
|
||||||
}
|
}
|
||||||
}' > $out/archive.json
|
}' > $out/archive.json
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
use cef::rc::{Rc, RcImpl};
|
use cef::rc::{Rc, RcImpl};
|
||||||
use cef::sys::{_cef_request_handler_t, cef_base_ref_counted_t};
|
use cef::sys::{_cef_request_handler_t, cef_base_ref_counted_t};
|
||||||
use cef::{AuthCallback, Browser, CefString, Frame, ImplRequest, ImplRequestHandler, Request, ResourceRequestHandler, WrapRequestHandler};
|
use cef::{AuthCallback, Browser, CefString, Frame, ImplRequest, ImplRequestHandler, Request, ResourceRequestHandler, TerminationStatus, WrapRequestHandler};
|
||||||
use std::ffi::c_int;
|
use std::ffi::c_int;
|
||||||
|
|
||||||
use super::resource_request_handler::ResourceRequestHandlerImpl;
|
use super::resource_request_handler::ResourceRequestHandlerImpl;
|
||||||
@@ -55,6 +55,13 @@ impl ImplRequestHandler for RequestHandlerImpl {
|
|||||||
0
|
0
|
||||||
}
|
}
|
||||||
|
|
||||||
|
fn on_render_process_terminated(&self, _browser: Option<&mut Browser>, status: TerminationStatus, error_code: c_int, error_string: Option<&CefString>) {
|
||||||
|
tracing::error!(
|
||||||
|
"CEF render process terminated: status={status:?}, error_code={error_code}, error={}",
|
||||||
|
error_string.map(|error| error.to_string()).unwrap_or_default()
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
fn get_raw(&self) -> *mut _cef_request_handler_t {
|
fn get_raw(&self) -> *mut _cef_request_handler_t {
|
||||||
self.object.cast()
|
self.object.cast()
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -75,7 +75,6 @@ impl TextureCache {
|
|||||||
}
|
}
|
||||||
if Arc::strong_count(texture) == 1 {
|
if Arc::strong_count(texture) == 1 {
|
||||||
free_bytes -= texture.memory_size_estimate();
|
free_bytes -= texture.memory_size_estimate();
|
||||||
texture.destroy();
|
|
||||||
false
|
false
|
||||||
} else {
|
} else {
|
||||||
true
|
true
|
||||||
|
|||||||
Reference in New Issue
Block a user