| [ Return to Bugs & Features | Roadmap 1.3 | SVN ⇄ GIT ]
STR #2270
Application: | FLTK Library |
Status: | 1 - Closed w/Resolution |
Priority: | 4 - High, e.g. key functionality not working |
Scope: | 2 - Specific to an operating system |
Subsystem: | X11 |
Summary: | Fl::get_system_colors() failing on Linux distros |
Version: | 1.3-current |
Created By: | markcw |
Assigned To: | AlbrechtS |
Fix Version: | 1.3.0 |
Update Notification: | |
Trouble Report Files:
No files
Trouble Report Comments:
|
#1 | markcw 16:36 Oct 09, 2009 |
| Hi, this was mentioned before here* but it was probably posted in the wrong place so I'm reposting it to the bugs list.
http://www.fltk.org/newsgroups.php?s6593+gfltk.bugs+v6603+T0 *
> Fl::get_system_colors() doesn't appear able to retrieve the correct > window manager theme colors on Ubuntu 9.04, resorting instead to the > standard FLTK battle-ship grey and blue. The exact same compiled > binaries are able to retrieve colors on Ubuntu 8.10 set-ups. > Has anyone else noticed this behaviour (FLTK 1.3)?
I get the same lack of system colors in Ubuntu 9.04 plus Mandriva 2009 and Fedora 11 but it still works in openSUSE 11 and Ubuntu before 9 (all GTK versions). It's like these distros have changed the location of the database file. | |
|
#2 | markcw 00:52 Nov 22, 2009 |
| Ok, so it seems the problem is the file $HOME/.Xdefaults is read by FLTK and this file is gone in ubuntu 9.04 hence why it breaks.
If I create a new file and fill it with this. *background: #0055FF *foreground: #FF5500
Followed by this, to update the database. xrdb -merge .Xdefaults
I can "fix" it. Using a file named .Xresources also works.
I think this "bug" may be due to a change made in the urxvt package, rather than from ubuntu. So not really FLTK's fault then. | |
|
#3 | markcw 21:44 Nov 22, 2009 |
| Slight correction, the file isn't gone in ubuntu 9.04 (64bit) as it seems to be a custom file, it's gone in the X resources database though.
On top of this there is a bug in Jaunty where .Xdefaults is no longer read on login.
https://bugs.launchpad.net/ubuntu/+source/xinit/+bug/320886
I checked openSUSE 11 (32bit) and it also doesn't have a /home/.Xdefaults file but when I type "$ xrdb -query" the background/foreground colors are there (but not there in ubuntu).
The only solution I could find in ubuntu was to manually enter "$ xrdb -merge /home/.Xdefaults" on every login. I'm not sure if this has been fixed in Karmic.
Also, here's a good article on X resources.
http://www.linuxjournal.com/article/1154 | |
|
#4 | SebHoll 04:28 Nov 23, 2009 |
| Maybe FLTK should be using the XtVaGetValues() API instead, with XmNBackground and XmNForeground constants?
That way we don't have to rely on XRDB. | |
|
#5 | markcw 10:49 Nov 23, 2009 |
| Maybe but this affects any app that uses xrdb like eMacs for example, so I think it's the distro's job to fix this.
Also, I found the selection color keyname today so just for the record I'm using this in my Jaunty .Xdefaults now.
*background: #EFEBE7 *foreground: #101010 *selectBackground: #FFA443 | |
|
#6 | markcw 19:42 Nov 23, 2009 |
| BTW it's not anything to do with urxvt (just a wild stab in the dark there).
I've managed to autostart xrdb at login in ubuntu now. First I created a script in the /home/username folder. $ gedit initxrdb.sh
Then added the text. #!/bin/sh xrdb -merge /home/.Xdefaults
Saved it and gave it execute permissions. $ sudo chmod +x initxrdb.sh
Then to get it to autostart I opened System > Preferences > Startup Applications. Clicked the Add button, set the Name as initxrdb (it can be anything) and the Command as ./initxrdb.sh then clicked Add and then Close. | |
|
#7 | matt 01:43 Apr 05, 2010 |
| Can anybody please fix this? Thanks. | |
|
#8 | AlbrechtS 00:45 Nov 12, 2010 |
| The correct solution is simple:
mv ~/.Xdefaults ~/.Xresources
then restart your Xsession. Tested and verified on Ubuntu 9.04 with a .Xresources file similar to the one posted above (as .Xdefaults).
man Xsession shows:
"$HOME/.Xresources contains X resources specific to the invoking user’s environment. The settings are loaded with xrdb -merge. Note that $HOME/.Xdefaults is a relic from X Version 10 (and X11R1) days, before app-defaults files were implemented. It has been deprecated for over ten years at the time of this writing. .Xresources should be used instead."
This has been posted to the link mentioned above on 2010-04-02. Here is a direct link to this specific message:
https://bugs.launchpad.net/ubuntu/+source/xinit/+bug/320886/comments/13
To the OP: please verify that this solves your problem, too. Don't forget to remove your script for testing!
This STR will be closed in a few days or after confirmation. | |
|
#9 | matt 13:20 Nov 16, 2010 |
| Thanks Albrecht, great catch. | |
[ Return to Bugs & Features ]
|
| |