diamondburned / cchat-gtk

Gtk frontend for cchat.
GNU General Public License v3.0
37 stars 1 forks source link

Theming is broken and Renders Text Invisible #5

Closed tekktonic closed 4 years ago

tekktonic commented 4 years ago

On app startup:

Aug 31 16:59:19: Error: CSS fail at goroutine 1 [running, locked to thread]:
runtime/debug.Stack(0x40004e6008, 0x123fbe7, 0x264)
    /usr/lib/go-1.14/src/runtime/debug/stack.go:24 +0x88
github.com/diamondburned/cchat-gtk/internal/ui/primitives.PrepareCSS(0x123fbe7, 0x264, 0x400012cd30)
    /home/danny/go/src/github.com/diamondburned/cchat-gtk/internal/ui/primitives/primitives.go:265 +0x68
github.com/diamondburned/cchat-gtk/internal/ui/primitives.PrepareClassCSS(0x11e16e9, 0xb, 0x123fbe7, 0x264, 0x40004e4000)
    /home/danny/go/src/github.com/diamondburned/cchat-gtk/internal/ui/primitives/primitives.go:253 +0x30
github.com/diamondburned/cchat-gtk/internal/ui/service/session.init()
    /home/danny/go/src/github.com/diamondburned/cchat-gtk/internal/ui/service/session/session.go:76 +0xe0
: <data>:21:7Expected ')' in color definition

Afterwards stdout gets flooded with messages on like

(cchat-gtk:8669): Gtk-WARNING **: 16:59:20.319: Failed to set text '<markup><span insert_hyphens="false"></span></markup>' from markup due to error parsing markup: Attribute 'insert_hyphens' is not allowed on the <span> tag on line 1 char 46

and

(cchat-gtk:8669): Gtk-WARNING **: 16:59:38.507: Failed to set text '<markup><span insert_hyphens="false">xxxxxxx</span></markup>' from markup due to error parsing markup: Attribute 'insert_hyphens' is not allowed on the <span> tag on line 1 char 46

Happens on Debian Stable (libhandy installed from unstable if that matters) aarch64 using X.

tekktonic commented 4 years ago

Forgot to add that I've tried this on both dark and light themes, same behavior.

diamondburned commented 4 years ago

You should probably install Pango, GDK and GTK from unstable too. The error below only happens on an outdated Pango (or GTK, not sure) version.

Attribute 'insert_hyphens' is not allowed on the <span> tag on line 1 char 46
diamondburned commented 4 years ago

It is worth mentioning that this is a known bug.

As far as I'm aware, gotk3 doesn't give a good method for detecting versions. I don't even know which version added insert_hyphens; I can only guess it's from 1.14 based on the documentation of a similar method.

tekktonic commented 4 years ago

For those who can't or won't upgrade, here's a patch that reverts its use. Unfortunately gtk isn't in backports. Hopefully whoever stumbles upon this from search results can also look up how to apply a patch (git patch -am after renaming to remove the .txt)

0001-Remove-insert_hyphens-properties-to-work-on-older-ve.patch.txt