From 70a7f5be1951926d3261f6ac51790f87f2370cc1 Mon Sep 17 00:00:00 2001 From: Huang Xin Date: Sun, 7 Sep 2025 16:38:27 +0800 Subject: [PATCH] fix: use transparent background for rounded window on Linux, closes #1982 (#1991) --- apps/readest-app/src-tauri/src/lib.rs | 2 +- apps/readest-app/src/app/library/page.tsx | 4 ++-- apps/readest-app/src/app/reader/components/Reader.tsx | 2 +- apps/readest-app/src/components/Providers.tsx | 3 +++ 4 files changed, 7 insertions(+), 4 deletions(-) diff --git a/apps/readest-app/src-tauri/src/lib.rs b/apps/readest-app/src-tauri/src/lib.rs index 17935fcd..3b66e0b8 100644 --- a/apps/readest-app/src-tauri/src/lib.rs +++ b/apps/readest-app/src-tauri/src/lib.rs @@ -268,7 +268,7 @@ pub fn run() { } #[cfg(target_os = "linux")] { - builder = builder.transparent(true); + builder = builder.transparent(true).background_color(tauri::window::Color(0, 0, 0, 0)); } builder diff --git a/apps/readest-app/src/app/library/page.tsx b/apps/readest-app/src/app/library/page.tsx index 7e05d8fa..06eb592c 100644 --- a/apps/readest-app/src/app/library/page.tsx +++ b/apps/readest-app/src/app/library/page.tsx @@ -619,7 +619,7 @@ const LibraryPageContent = ({ searchParams }: { searchParams: ReadonlyURLSearchP }; if (!appService || !insets || checkOpenWithBooks || checkLastOpenBooks) { - return
; + return
; } const showBookshelf = libraryLoaded || libraryBooks.length > 0; @@ -730,7 +730,7 @@ const LibraryPageContent = ({ searchParams }: { searchParams: ReadonlyURLSearchP const LibraryPage = () => { return ( - }> + }> ); diff --git a/apps/readest-app/src/app/reader/components/Reader.tsx b/apps/readest-app/src/app/reader/components/Reader.tsx index 0f632b18..65dfb80a 100644 --- a/apps/readest-app/src/app/reader/components/Reader.tsx +++ b/apps/readest-app/src/app/reader/components/Reader.tsx @@ -155,7 +155,7 @@ const Reader: React.FC<{ ids?: string }> = ({ ids }) => {
) : ( -
+
); }; diff --git a/apps/readest-app/src/components/Providers.tsx b/apps/readest-app/src/components/Providers.tsx index 0438cdf3..c66fe05a 100644 --- a/apps/readest-app/src/components/Providers.tsx +++ b/apps/readest-app/src/components/Providers.tsx @@ -21,6 +21,9 @@ const Providers = ({ children }: { children: React.ReactNode }) => { } }, [appService]); + // Make sure appService is available in all children components + if (!appService) return; + return (