johnfactotum / foliate

Read e-books in style
https://johnfactotum.github.io/foliate/
GNU General Public License v3.0
6.16k stars 286 forks source link

Text is invisible and bars are bright white #995

Closed ElnuDev closed 1 year ago

ElnuDev commented 1 year ago

Describe the bug

I've just installed foliate for the first time. The top and bottom bars are bright white until I hover over them, and the text is invisible but selectable. I thought it might be an issue with my custom GTK theme, but I tried launching foliate with Adwaita GTK_THEME=Adwaita:dark foliate and the issue persists.

To Reproduce Steps to reproduce the behavior:

  1. Open foliate

Expected behavior Normally colored bars and visible text.

Screenshots image

Version:

Additional context N/A

johnfactotum commented 1 year ago

What Foliate theme (Primary menu [F10] > Theme) are you using? If you're using the default "Light" theme together with Adwaita Dark, then the footer should have gray text on white, and the page should also be black on white unless the book specifies otherwise.

ElnuDev commented 1 year ago

I was using Light theme but it has the same behavior on all themes, except the bar colors changing to match the theme. The text is not visible on any theme.

Also, I'm not sure if this has anything to do with this, but very often (maybe half of the time?) when I try to change the theme Foliate just... freezes and crashes with a segfault, but I can't figure out how to consistently reproduce it. This is the error:

Here's the output of Foliate from start to the crash:

Could not determine the accessibility bus address

** (process:2): WARNING **: 14:02:18.091: Failed to connect to bus: The given address is empty

** (WebKitWebProcess:2): WARNING **: 14:02:18.107: Can't connect to a11y bus: Error receiving data: Connection reset by peer

(com.github.johnfactotum.Foliate:6652): Gjs-WARNING **: 14:02:18.242: Unhandled promise rejection. To suppress this warning, add an error handler to your promise chain with .catch() or a try-catch block around your await expression. Stack trace of the failed promise:
  main@resource:///com/github/johnfactotum/Foliate/js/main.js:478:24
  run@resource:///org/gnome/gjs/modules/script/package.js:206:19
  @/nix/store/vxg165v76dhrgxjg5si33dap4rm9pagk-foliate-2.6.4/bin/.com.github.johnfactotum.Foliate-wrapped:10:17

(com.github.johnfactotum.Foliate:6652): Gtk-CRITICAL **: 14:02:18.465: gtk_tree_store_get_value: assertion 'VALID_ITER (iter, tree_store)' failed

(com.github.johnfactotum.Foliate:6652): GLib-GObject-CRITICAL **: 14:02:18.465: g_value_type_transformable: assertion 'src_type' failed

(com.github.johnfactotum.Foliate:6652): GLib-GObject-CRITICAL **: 14:02:18.465: g_value_type_transformable: assertion 'src_type' failed

(com.github.johnfactotum.Foliate:6652): Gjs-CRITICAL **: 14:02:18.465: JS ERROR: Error: Don't know how to convert GType (null) to JavaScript object
set epub/<@resource:///com/github/johnfactotum/Foliate/js/contents.js:139:37
_handleAction@resource:///com/github/johnfactotum/Foliate/js/epubView.js:947:22
_init/<@resource:///com/github/johnfactotum/Foliate/js/epubView.js:617:18
main@resource:///com/github/johnfactotum/Foliate/js/main.js:478:24
run@resource:///org/gnome/gjs/modules/script/package.js:206:19
@/nix/store/vxg165v76dhrgxjg5si33dap4rm9pagk-foliate-2.6.4/bin/.com.github.johnfactotum.Foliate-wrapped:10:17

(com.github.johnfactotum.Foliate:6652): Gtk-CRITICAL **: 14:02:36.297: gtk_tree_store_get_value: assertion 'VALID_ITER (iter, tree_store)' failed

(com.github.johnfactotum.Foliate:6652): GLib-GObject-CRITICAL **: 14:02:36.297: g_value_type_transformable: assertion 'src_type' failed

(com.github.johnfactotum.Foliate:6652): GLib-GObject-CRITICAL **: 14:02:36.297: g_value_type_transformable: assertion 'src_type' failed

(com.github.johnfactotum.Foliate:6652): Gjs-CRITICAL **: 14:02:36.297: JS ERROR: Error: Don't know how to convert GType (null) to JavaScript object
set epub/<@resource:///com/github/johnfactotum/Foliate/js/contents.js:139:37
_handleAction@resource:///com/github/johnfactotum/Foliate/js/epubView.js:947:22
_init/<@resource:///com/github/johnfactotum/Foliate/js/epubView.js:617:18
main@resource:///com/github/johnfactotum/Foliate/js/main.js:478:24
run@resource:///org/gnome/gjs/modules/script/package.js:206:19
@/nix/store/vxg165v76dhrgxjg5si33dap4rm9pagk-foliate-2.6.4/bin/.com.github.johnfactotum.Foliate-wrapped:10:17

(com.github.johnfactotum.Foliate:6652): Gtk-CRITICAL **: 14:02:51.021: gtk_tree_store_get_value: assertion 'VALID_ITER (iter, tree_store)' failed

(com.github.johnfactotum.Foliate:6652): GLib-GObject-CRITICAL **: 14:02:51.021: g_value_type_transformable: assertion 'src_t
ype' failed

(com.github.johnfactotum.Foliate:6652): GLib-GObject-CRITICAL **: 14:02:51.021: g_value_type_transformable: assertion 'src_type' failed

(com.github.johnfactotum.Foliate:6652): Gjs-CRITICAL **: 14:02:51.021: JS ERROR: Error: Don't know how to convert GType (null) to JavaScript object
set epub/<@resource:///com/github/johnfactotum/Foliate/js/contents.js:139:37
_handleAction@resource:///com/github/johnfactotum/Foliate/js/epubView.js:947:22
_init/<@resource:///com/github/johnfactotum/Foliate/js/epubView.js:617:18
main@resource:///com/github/johnfactotum/Foliate/js/main.js:478:24
run@resource:///org/gnome/gjs/modules/script/package.js:206:19
@/nix/store/vxg165v76dhrgxjg5si33dap4rm9pagk-foliate-2.6.4/bin/.com.github.johnfactotum.Foliate-wrapped:10:17

(com.github.johnfactotum.Foliate:6652): Gtk-CRITICAL **: 14:02:51.024: gtk_tree_store_get_value: assertion 'VALID_ITER (iter, tree_store)' failed

(com.github.johnfactotum.Foliate:6652): GLib-GObject-CRITICAL **: 14:02:51.024: g_value_type_transformable: assertion 'src_type' failed

(com.github.johnfactotum.Foliate:6652): GLib-GObject-CRITICAL **: 14:02:51.024: g_value_type_transformable: assertion 'src_type' failed

(com.github.johnfactotum.Foliate:6652): Gjs-CRITICAL **: 14:02:51.024: JS ERROR: Error: Don't
 know how to convert GType (null) to JavaScript object
set epub/<@resource:///com/github/johnfactotum/Foliate/js/contents.js:139:37
_handleAction@resource:///com/github/johnfactotum/Foliate/js/epubView.js:947:22
_init/<@resource:///com/github/johnfactotum/Foliate/js/epubView.js:617:18
main@resource:///com/github/johnfactotum/Foliate/js/main.js:478:24
run@resource:///org/gnome/gjs/modules/script/package.js:206:19
@/nix/store/vxg165v76dhrgxjg5si33dap4rm9pagk-foliate-2.6.4/bin/.com.github.johnfactotum.Foliate-wrapped:10:17

** (process:2): WARNING **: 14:02:51.096: Failed to connect to bus: The given address is empty

** (WebKitWebProcess:2): WARNING **: 14:02:51.162: Can't connect to a11y bus: Error receiving data: Connection reset by peer

(com.github.johnfactotum.Foliate:6652): Gjs-WARNING **: 14:02:51.352: Unhandled promise rejection. To suppress this warning, add an error handler to your promise chain with .catch() or a try-catch block around your await expression. Stack trace of the failed promise:
  main@resource:///com/github/johnfactotum/Foliate/js/main.js:478:24
  run@resource:///org/gnome/gjs/modules/script/package.js:206:19
  @/nix/store/vxg165v76dhrgxjg5si33dap4rm9pagk-foliate-2.6.4/bin/.com.github.johnfactotum.Foliate-wrapped:10:17
Segmentation fault (core dumped)
johnfactotum commented 1 year ago

Do you have any custom styles in gtk.css? If you're using Adwaita, with no gtk.css or GTK modules, and the default settings in Foliate, namely,

Then at the very least, there should be some white margins on the sides (matching the color of the not-hovered header and footer bars). Due to the way CSS columns work, half of the outer margin is actually not styleable by the book (which is technically a bug that has been addressed in the gtk4 branch), and it should have the same background color as the header and footer regions no matter what.

ElnuDev commented 1 year ago

I don't have any custom styles besides my custom theme, so nothing special is being loaded if I launch Foliate with GTK_THEME=Adwaita:dark foliate. I have everything on defaults. It just seems like the page is invisible.

johnfactotum commented 1 year ago

Huh. Well, in that case I don't have any idea. Sounds like an issue with the webview itself.

TruongTrongThanh commented 1 year ago

@ElnuDev Are you using the proprietary NVIDIA driver? I had the same problem like you. It appears to be a webkitgtk bug with the Nvidia driver. . When I ran with WEBKIT_DISABLE_COMPOSITING_MODE=1 it works again.

ElnuDev commented 1 year ago

Yup, I'm using the proprietary NVIDIA driver. WEBKIT_DISABLE_COMPOSITING_MODE=1 fixed the issue! Thanks so much.