Good source of X11 programming info?

Thread Tools Search this Thread
Top Forums UNIX for Dummies Questions & Answers Good source of X11 programming info?
# 1  
Old 07-17-2007
Good source of X11 programming info?

Is there a good book or something on practical programming in X11? I have the O'Reilly X window system book set. They don't seem to cover the nuances very well (at least for me). So far the only thing I find on the web is the text from these books.

Specifically, I'm looking for optimization techniques and internal differences in the event checking functions. I have an application drawing many bitmaps and want to allow the drawing to be interrupted. I've found that checking for the interrupts can increase display times by 30-50%. Moving the checks to a thread helps, but then I lose button events entirely, and configure events only come when the drawing is complete for some reason. I'll probably end up with moving the draw operations to a thread and just run event checking in the main thread. But I'd still like to really understand why things are happening the way they are.

# 2  
Old 07-17-2007
Originally Posted by willil
I've found that checking for the interrupts can increase display times by 30-50%.
Look for the following:

1. XtAppAddWorkProc/XtAppRemoveWorkProc

2. XtAppNextEvent, XtAppPending, XtAppPeekEvent, XtAppProcessEvent, Xt DispatchEvent, XtAppMainLoop

3. XExposeEvent

I try and avoid threads with Xwindows programming.

One solution is to use XExposeEvents to accumulate invalidated rectangles into a region, then when the count hits zero, schedule a work proc to some some drawing. In the work proc do a small amount of drawing covering only the invalidated region, then remove what you have painted from that region. Then if the region is not empty, schedule another work proc.

Alternatively use one of the XtAppPending family of functions to see if there any any incoming messages, if not then continue with a small amout of drawing. As above, restrict yourself to only parts that have been indicated by an XExposeEvent.
# 3  
Old 07-18-2007
Thanks for the pointers. The architecture isn't set up very good for expose events right now. But I've been thinking about somthing like this. (There can be 100's of millions of polygons to draw. Rearchitecting is coming...) The XtAppPending sounds interesting. I'll start there.
Login or Register to Ask a Question

Previous Thread | Next Thread

9 More Discussions You Might Find Interesting

1. Programming

MOTIF programming and X11 client !

Hi there , i am interesting in MOTIF programming. One question : Is it right that in Motif GUI programming the actions are automaticly transformed and networked to other clients over the internet without network programming necessary ? Are the commands automatic transformed by the X11... (4 Replies)
Discussion started by: Zabo
4 Replies

2. Programming

Low level X11 programming

How to use X11 without Xlib not XCB? How draw window directly on low level? I must use anyway window manager like Motif? I have ridden that X11 has server-client architecture, client send via TCP/IP to port 6000 request for primitives and get replies. Where is detailed description of it? In X11... (0 Replies)
Discussion started by: AndrzejB
0 Replies

3. Shell Programming and Scripting

any good book for shell programming and scripting??

as title suggest i am looking for good book to start learning shell programming.please help me with this. (5 Replies)
Discussion started by: pvk21
5 Replies

4. UNIX for Advanced & Expert Users

Please advise good source of info about swapping

Hi Everyone, I have some misunderstanding about swapping. Is it true that swap a) required always (I mean I cannot set size 0 bytes) and b) some pages are saved on disk in idle time even free memory is enough ? Could you please advise some good reading about it? (10 Replies)
Discussion started by: sant
10 Replies

5. UNIX for Dummies Questions & Answers

Newbie needs help with Xlib / X11 programming,dunno who to ask,but you :(

Hi,I'm new here and to Unix also. I'm totall newbie. Here is what I have to do: -Basics of programming user interface with Xlib library -Xlib -Client/Server model of X-Windows system -Example of "Hello world" with button which changes text ,so that when u click displays another... (4 Replies)
Discussion started by: megane16v
4 Replies

6. Shell Programming and Scripting

Good site for Shell Programming

Hi unixers, :) I found some Good sites for learning Shell Programming. I Hope they will be useful to all of You. similarly ,if u find any very good sites for shell programming pls post them, so that they will... (6 Replies)
Discussion started by: ravi raj kumar
6 Replies

7. UNIX for Advanced & Expert Users

source reader info

Hi friends, I urgently need to know if there is any tool called source reader in C or Unix or Linux...... If so ..plz let me know the details.I am running out of time..... (0 Replies)
Discussion started by: vijaya2006
0 Replies

8. AIX

Good source of AIX Specific Scripting?

Hi everyone, I need to write some AIX scripts (ksh?), kind of fast so I'm looking for somewhere to get a crash course in it. Are there any AIX Specific Scripting resource sites that anyone can recommend, really not getting a whole lot from google. Thanks in advance, Darren (3 Replies)
Discussion started by: dbridle
3 Replies

9. Shell Programming and Scripting

good book for unix shell programming

hi, i am ajay. I need a good book for shell programming. a book which covers from fundamental to advance shell programming. (3 Replies)
Discussion started by: ajaygodbole
3 Replies
Login or Register to Ask a Question

Featured Tech Videos