I am working on a window manager written using xlib python bindings, and I (initially) try to mimic dwm behavior in a more pythonic way. I got a lot of what I need, but I'm having trouble using the X window's built-in function to indicate the focus of the window.
Assuming I have an instance of the Xlib window class and that I am reading the documentation correctly, this should do what I want to do (at least for now) - set the window border of the existing window to a bright color and set the border width to 2px.
def set_active_border(self, window):
border_color = self.colormap.alloc_named_color(\
"#ff00ff").pixel
window.change_attributes(None,border_pixel=border_color,
border_width = 2 )
self.dpy.sync()
However, I don’t get anything from this - I can add print statements to prove that my program actually performs the callback function associated with the event, but I get absolutely no color change at the border. Can anyone determine what exactly I'm missing here? I can use a more complete example if this helps. I'm not sure what it will be, although this is the only bit that handles the border.
source
share