LinuxQuestions.org
Visit Jeremy's Blog.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 07-13-2015, 08:55 AM   #1
ron7000
Member
 
Registered: Nov 2007
Location: CT
Posts: 248

Rep: Reputation: 26
help with X11 TrueColor PseudoColor


i am working with some old C code.
i think it's failing because of a linux OS security feature preventing X11 from connecting, but i don't know and i don't know where to go from this point. My OS is SLES 11.3.


edit: haha i just found the functions connecttoserver and setupvisual, it was in the same file.
i thought they were functions provided by xlib.

nevermind

you can delete this thread, i had a moment... of not reading the rest of code within the file.

Last edited by ron7000; 07-13-2015 at 04:21 PM.
 
Old 07-13-2015, 12:43 PM   #2
MensaWater
LQ Guru
 
Registered: May 2005
Location: Atlanta Georgia USA
Distribution: Redhat (RHEL), CentOS, Fedora, CoreOS, Debian, FreeBSD, HP-UX, Solaris, SCO
Posts: 7,831
Blog Entries: 15

Rep: Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669
Glad you figured it out.

Rather than asking to close the thread you should put the file you found these in then mark this as "Solved". That way anyone who runs into same issue in future will more quickly find this Solved thread rather than having to wade through all the ones that ask questions that never show as resolved.
 
Old 07-13-2015, 04:16 PM   #3
ron7000
Member
 
Registered: Nov 2007
Location: CT
Posts: 248

Original Poster
Rep: Reputation: 26
my problem was poor coding on the part of previous author.
they were using X11 libraries and had an if statement based around

if DefaultVisual(display, screen)->class == PseudoColor

well that call to DefaultVisual class returns a value of TrueColor on my system.
those values can be found in /usr/include/X11/X.h and here's what mine say in SLES 11.3 x86-64:
Code:
/* Display classes  used in opening the connection
 * Note that the statically allocated ones are even numbered and the
 * dynamically changeable ones are odd numbered */

#define StaticGray              0
#define GrayScale               1
#define StaticColor             2
#define PseudoColor             3
#define TrueColor               4
#define DirectColor             5
tags: PseudoColor TrueColor DirectColor StaticColor GrayScale StaticGray

i was worried it was a security thing in SLES, particularly under security center and hardening about disabling or enabling a remote access to the X server. it was not. once i waded through the code which was multiple files and one file was very large, i found out the source of the problem. all i had to do was change PseudoColor to TrueColor in my if statement and that fixed everything.
i was also smart enough to put some error checking in for future reference when it bombs.

Last edited by ron7000; 07-13-2015 at 04:21 PM.
 
1 members found this post helpful.
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] /usr/bin/X11/X11/....... 10 X11 subsets & counting walter74 Linux - General 2 06-07-2015 12:36 AM
libgdk_pixbuf-2.0.so.0, libgdk-x11-2.0.so.0, libgtk-x11-2.0.so.0 dependency problem chintu00001 Red Hat 2 07-09-2012 06:22 AM
[SOLVED] X11 issues: fonts, x11-common mike11 Linux - Newbie 2 12-28-2010 09:34 PM
Core 4 - X11-devel complains about X11-libs which are installed Ephracis Fedora 3 09-05-2005 09:32 AM
Roaming X11/Xfree86, X11 proxy zapp Linux - Software 1 09-12-2003 08:06 AM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 05:01 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration