Edit: I modified the code a little to take out some unnecessary stuff, for some reason before I needed to use fillrectangle so the window was drawn correctly i tested and now works fine for some reason.

I'm trying to mirgrate my code from xlib to xcb and I'm having some problems when trying to "draw a border" on a window, with the code will be more clear what I mean with that:

I suspect the mask isn't working and the lack of documentation isn't helping me at all...
Maybe what I want can be done using cairo?, I tryed to draw something on my window without painting the background but the background was all distorted for some reason.

If someone can take a look at my code and tell me what I'm doing wrong or maybe give me an example how to do something like this using cairo or point me to some examples I'll be a happy person xD.

Let's take a step back: What exactly are you trying to do? Adding a border of a given color to a window? Why do you do this with the SHAPE extension instead of just setting the border width and border color? Are you writing a window manager?
–
Uli SchlachterJan 31 '13 at 13:25

@Uli I'm not trying to give a real border to a window, I'm trying to mark an area on the screen with a square which resulted to be the border of a window in first instance (I don't know if i explain myself, is kinda hard to explain this for me, english isn't my first lenguage). Let's say I just want to make a rectangle which is hollow so i can interact with what is inside him. Im not writing a window manager, I just want to mark an area of the screen.
–
NikoJan 31 '13 at 14:47