4

I want to create a software that requires X11 render window that is stacked on the top and grabs the keyboard and mouse(just like a screen locker) but all I could find was a shallow documentation with very few examples. How shall I proceed?

4
  • This is a hard one. Afaik there is only one in depth book on xlib programming: The XLIB Programming Manual by oreilly. Concerning xcb: I wasn't able to find much more information, than they provided on their site: link. Did you know, that you can access the documentation of xlib functions also via man? See for example "man XCreateWindow" (but again, no examples). There are also some shallow tutorials out there, just google for "xlib tutorial". You could also read some code others wrote (e.g. from dmenu). And after all: do you really want to learn xlib programming
    – Lord Bo
    Dec 5, 2012 at 13:05
  • @LordBo I am considering it to add some low level screensaver like feature to my application. I think I need to understand something to read the code others wrote. I would be glad if you give me links to code for screensavers. Dec 5, 2012 at 13:10
  • I'm sorry, I never had to handle screensavers. Just a tip: Maybe you should edit your question a bit. What programming language do you use for your application (C I guess), what kind of widget set do you use for X11 programming (If you do, or are you really programming in pure xlib?). Sorry, I can't help you more.
    – Lord Bo
    Dec 5, 2012 at 13:18
  • 1
    This is a bit broad. "I want to use X11 for my application" is like "I want to use organic chemistry for my compound". Perhaps setting a more narrow goal could be more productive. Dec 5, 2012 at 14:05

2 Answers 2

7

After researching for a little a while, I decided to answer the question myself.

The the X11 manual at sbin.com is a very good one and contains detailed explanation and examples.

I also found the folks at #xcb irc challel at irc.freenode.com very cooperative and knowledgeable. They suggested me to read code written in X11 like xscreensaver and others. That should get me started.

3
  • Thanks for the irc channel. The link to the xlib programming manual however... I'm not sure, if there is no copyright on it. I didn't find anything concerning it, but it is still sold and not in the section of free books of oreilly.
    – Lord Bo
    Dec 5, 2012 at 19:02
  • @LordBo You can read the manual by clicking the links. Tell me if I am missing anything. Dec 5, 2012 at 20:06
  • I just wanted to point out, that I am not sure, if it is legal to share this link, as the book is still sold and oreilly does not have it in the "open books" section. But I don't know, what kind of license applies to the content of the book, so you might as well ignore my comments.
    – Lord Bo
    Dec 7, 2012 at 0:18
7

There is no such a thing X11 or XCB. They are different things. X11 is the protocol, XCB is a C library which implements the low-level protocol calls to the X server. Perhaps you were referring to Xlib or libX11 instead of X11 alone.

I would recommend you to read Xlib documentation, you can learn a lot about the X11 protocol. Then you can easily switch to XCB, which is highly recommended, by reading their documentation. Check xcb/xproto.h to find all X11 protocol calls.

It's also interesting to read about ICCCM and EWMH standards.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.