fix(window): keep Linux window opaque so it can't turn invisible (#3682) (#4904)

On Linux the window was created fully transparent to draw rounded corners
(#1982), but on WebKitGTK a transparent window composites as transparent
whenever its web process is too busy to repaint damaged regions (for example
during a library backup). Interacting with the app then makes it appear to
turn invisible, showing the desktop through the window.

Make the window opaque everywhere: the main window in lib.rs and the
reader/extra windows in nav.ts. Drop the rounded-window treatment
(hasRoundedWindow=false) so no rounded 1px border floats on the now square
opaque window, and give the Linux loading placeholders a solid background.
An opaque window retains its last painted frame instead of going invisible;
the tradeoff is square corners on Linux.

Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
Huang Xin
2026-07-03 04:41:26 +09:00
committed by GitHub
parent 84c5a9dae6
commit 4b2c5f93ab
7 changed files with 172 additions and 8 deletions
+6 -2
View File
@@ -18,7 +18,9 @@ const createReaderWindow = (appService: AppService, url: string) => {
resizable: true,
title: appService.isMacOSApp ? '' : 'Readest',
decorations: !!appService.isMacOSApp,
transparent: !appService.isMacOSApp,
// Linux stays opaque: a transparent WebKitGTK window turns invisible when
// its web process is busy (#3682). macOS uses native decorations instead.
transparent: !appService.isMacOSApp && !appService.isLinuxApp,
shadow: appService.isMacOSApp ? undefined : true,
titleBarStyle: appService.isMacOSApp ? 'overlay' : undefined,
// Enum ScrollBarStyle is exported as type by tauri, so it cannot be used directly.
@@ -74,7 +76,9 @@ export const ensureMainLibraryWindow = async (appService: AppService) => {
resizable: true,
title: appService.isMacOSApp ? '' : 'Readest',
decorations: !!appService.isMacOSApp,
transparent: !appService.isMacOSApp,
// Linux stays opaque: a transparent WebKitGTK window turns invisible when
// its web process is busy (#3682). macOS uses native decorations instead.
transparent: !appService.isMacOSApp && !appService.isLinuxApp,
shadow: appService.isMacOSApp ? undefined : true,
titleBarStyle: appService.isMacOSApp ? 'overlay' : undefined,
scrollBarStyle: (appService.osPlatform === 'windows'