Bug 427877 - Tk apps fail to start with unknown color name "BACKGROUND" after upgrading to Plasma 5.20
Summary: Tk apps fail to start with unknown color name "BACKGROUND" after upgrading to...
Status: RESOLVED FIXED
Alias: None
Product: systemsettings
Classification: Applications
Component: krdb (show other bugs)
Version: 5.20.0
Platform: Gentoo Packages Linux
: NOR major
Target Milestone: ---
Assignee: kdelibs bugs
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2020-10-17 16:59 UTC by Matěj Laitl
Modified: 2020-11-05 13:14 UTC (History)
3 users (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments
xrdb -query output. Are colour definitions missing? (17.42 KB, text/plain)
2020-10-17 16:59 UTC, Matěj Laitl
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Matěj Laitl 2020-10-17 16:59:54 UTC
Created attachment 132487 [details]
xrdb -query output. Are colour definitions missing?

STEPS TO REPRODUCE
1. Use plasma-desktop 5.20 on Linux
2. Try to start a Tk based gui application, like gitk

OBSERVED RESULT
Fails to start with the following in the console:
```
$ gitk
application-specific initialization failed: unknown color name "BACKGROUND"
Error in startup script: unknown color name "BACKGROUND"
    (database entry for "-background" in widget ".")
    invoked from within
"load /usr/lib64/libtk8.6.so Tk"
    ("package ifneeded Tk 8.6.8" script)
    invoked from within
"package require Tk"
    (file "/usr/bin/gitk" line 10)
```

EXPECTED RESULT
Tk apps start normally. This was the case with Plasma 5.19.

SOFTWARE/OS VERSIONS
Linux/KDE Plasma: Gentoo Linux (X11)
KDE Plasma Version: 5.20.0
KDE Frameworks Version: 5.74.0
Qt Version: 5.15.1

ADDITIONAL INFORMATION

This has the same symptoms as one old issue reported to Red Hat Bugzilla: https://bugzilla.redhat.com/show_bug.cgi?id=1043686
This has been patched by Red Hat somehow, but I was unable to find the exact patch.

The problem seems to stem from krdb trying to update xrdb so that colours of non-KDE apps match ones set in KDE settings as mentioned in https://github.com/KDE/plasma-workspace/blob/master/kcms/krdb/ad/README

I'm adding output of `xrdb -query`.

One work-around mentioned on the Red Had bugzilla was to disable `Apply colors to non-KDE4 applications` in System Settings -> Application Appearance -> Colors -> Options - but I was unable to find this setting in Plasma 5.20.

Another harsher work-around is to reset xrdb with `xrdb -load /dev/null` - but that has unwanted side-effects.

This seems to be happening to multiple people with Plasma 5.20, e.g. https://www.reddit.com/r/kdeneon/comments/jckwxk/help_cant_run_gitk_on_kde_520/

Reading https://stackoverflow.com/questions/25357156/gitk-package-require-tk (which is not directly related to the bug), it seems that krdb should put entries like:
`#define BACKGROUND        #b58900`
into xrdb, but it may not be doing so properly (just guessing)
Comment 2 Matěj Laitl 2020-10-19 13:16:52 UTC
Hi,
I can confirm than after building plasma-workspace patched with https://github.com/KDE/plasma-workspace/commit/f0764d87fe5275a123cdf6dca1ab3d0399c97578?branch=f0764d87fe5275a123cdf6dca1ab3d0399c97578&diff=split and re-logging, gitk now starts just fine. Cool!
Comment 3 Victor Mataré 2020-10-22 00:06:16 UTC
fixed for me after upgrading to 5.20.1.
Comment 4 Christoph Feck 2020-11-05 02:59:25 UTC
Matěj, can you confirm this issue is fixed?
Comment 5 Matěj Laitl 2020-11-05 11:46:10 UTC
(In reply to Christoph Feck from comment #4)
> Matěj, can you confirm this issue is fixed?

Sure, it works like a charm here in Plasma 5.20.2. ;-)
Comment 6 Christoph Feck 2020-11-05 13:14:31 UTC
Thanks for the update; changing status.