Hi there! I'm trying to implement a window manager from scratch. I'm quite newbie in X11.
I've checked out the code from others windows managers and tried to figure out how do they draw the title bar .. some just draw a grey box others use a widget thing that I've tried to understand but unfortunately I couldn't.

What are the different techniques to draw a title bar. It's all about using the drawing (geometric) functions or there are some other resources to do that?

Thanks in advance!