?
Solved

X11 color problem

Posted on 2005-04-14
12
Medium Priority
?
394 Views
Last Modified: 2008-02-01
Hello experts,

Red Hat 8, program written in c.

I have a nagging problem. I work on a program which runs using a plain X11 environment. Everything works fine. Now I have to do some bugfixes in an older released version (I'll talk about the new version and old version (where the problem is) from here on.). So what do I do, I check out all of my code, do a clean build and run the program. Now I notice that the program can not initialize its colors. In fact, XAllocNamedColor returns 1 on every color (and rgb.cfg is in place), working with XAllocColor also gives 1 as return value. Consequentely all the colors look terrible (since black gives some kind of pink now).

Also strange is: when the old version starts, it puts a logo on screen with xv, ans also the logo looks bad now. It is less bright as it supposed to be (8-bit colors perhaps ?). Nothing is wrong with my x-server since the newest version of the program works fine, and when the old version with the lousy colors is running, I can still put an x-clock on screen manually with a white background for instance. But, I do have the feeling that the old version does something with the x-server because,when it is running, and I put manually the logo on the screen with xv, it also look bad.

Anyone has a clue ? because I'm really stuck on this.

thnx,
themuppeteer
0
Comment
Question by:themuppeteer
  • 5
  • 5
11 Comments
 
LVL 2

Author Comment

by:themuppeteer
ID: 13779694
some new info:
apperantly a return value different of zero is ok for xallaocnamedcolor. I misunderstood the man. I printed out the colors and they seem ok for r,g,b values. But still the colors look terrible.
0
 
LVL 51

Expert Comment

by:ahoffmann
ID: 13788475
what you describe is the "private color map" problem of the X server and/or its applications
xdpyinfo may give you some informations
sorry, my X-programming is way to long gone, but ther is a function or a parameter somewhere in your x-calls where you can request a private color map for your application
0
 
LVL 2

Author Comment

by:themuppeteer
ID: 13788570
But if I do that, my application will still have bad colors, but the other applications will have good colors right? Thats not what I want, I want all applications to have good colors.
I use XDefaultColorMap to get my colormap..

Anyway, some new info...

Since the application was released before, working fine, we figured that  we should be able to build the same code again on our build system. So we did. And everything worked fine. Strange because we are talking about the same code! Then we copied the code with scp from the build machine to my machine and compiled and everything worked fine also. So apperantly if I check out the code it goes wrong, and if the build machine checks out the code it goes fine. I have no idea whats going on, but I'm working on the 'working' code now, since there is a deadline...as usual..
So the problem isn't solved but we have a 'workaround'.

I'm gonna let this question open for a while, if someone finds an explanation I'd be happy to give the points.

br,
themuppeteer
0
Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 51

Expert Comment

by:ahoffmann
ID: 13790785
>  But if I do that, my application will still have bad colors, but the other applications will have good colors right?
no
the application with the focus will have "good colours", all other application will have "bad colours" but only if they use a completely different colormap
there is no filickering if 2 or more applications use the same colormap, even if defined as "private colormap".
That's 30 or so year old X, not anything modern :-))

If it was working before, your X server probably changed, check its configuration, for example with xdpyinfo
0
 
LVL 2

Author Comment

by:themuppeteer
ID: 13790917
thanks for the answer ahoffman,

Wel it was working before, and if I start the latest version of the program, I have good colors. Thats why I think it has nothing to do with the X-server. xdpyinfo gives only correct info as far as I understand it. We already used that command over here.
What is so strange is :

versioning system --> my machine (compile)--> bad colors
versioning system --> build system (compile) -->my machine --> good colors
versioning system --> build system --> my machine (compile) -->good colors

it simply doesn't make sense.

Just curious, Is it 'good practice' to create your own colormap ?


0
 
LVL 51

Expert Comment

by:ahoffmann
ID: 13791006
sounds like your systems has different include files for X
0
 
LVL 2

Author Comment

by:themuppeteer
ID: 13791114
if so , how comes simply checking out  on the build system and scp'ing the code and building on my machine gives good colors ?
versioning system --> build system --scp-> my machine (compile) -->good colors
0
 
LVL 51

Expert Comment

by:ahoffmann
ID: 13793588
which versioning system do you use? SCCS, RCS, CVS, ...
did you just checkout the sources or Makefile etc. also?
have no idea so far, just in case ...
0
 
LVL 2

Author Comment

by:themuppeteer
ID: 13804303
We use MKS.
I also check out the Makefile.
I guess the only possible explanation could be that the code is checked out differently on the build system then on my machine. Which should be impossible no ?
0
 
LVL 51

Expert Comment

by:ahoffmann
ID: 14043137
agreed
0
 

Accepted Solution

by:
modulo earned 0 total points
ID: 14070781
PAQed with points refunded (465)

modulo
Community Support Moderator
0

Featured Post

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Have you ever been frustrated by having to click seven times in order to retrieve a small bit of information from the web, always the same seven clicks, scrolling down and down until you reach your target? When you know the benefits of the command l…
The purpose of this article is to demonstrate how we can upgrade Python from version 2.7.6 to Python 2.7.10 on the Linux Mint operating system. I am using an Oracle Virtual Box where I have installed Linux Mint operating system version 17.2. Once yo…
This video shows how to quickly and easily deploy an email signature for all users in Office 365 and prevent it from being added to replies and forwards. (the resulting signature is applied on the server level in Exchange Online) The email signat…
Is your OST file inaccessible, Need to transfer OST file from one computer to another? Want to convert OST file to PST? If the answer to any of the above question is yes, then look no further. With the help of Stellar OST to PST Converter, you can e…
Suggested Courses

840 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question