The positions are calculated at the beginning and are constant through the entire program, they are not recalculated. Thus, you have to keep track of both x and y position and refresh the position of the parent window constantly. (15-05-2020, 03:04 PM)venam Wrote: It seems that all your menu location calculation rely on the position of the parent window relative to the root window and the screen geometry instead of the position of the entries themselves.
Xmenu color code#
I will rewrite the code to use a pixmap for each window. I solved it by improving the algorithm that decides when to remap stack of menus to it preform less remapping. I was indeed experiencing some flickering on the windows of my menus while remapping them.
So, you first draw an entire frame into a pixmap and then copy the final result to a window. When you do a lot of drawing operations directly onto a window, it can happen that you see glitches, artifacts, flickering. and one of the main reasons why anyone would want to draw into a pixmap and then copy it to a window is: Double buffering. They might come in handy when I venture in the task of creating my own window manager, the next project I want to do in order to learn more Xlib. I will check the other linked posts on your blog either. I bookmarked it here for the links in the references.
Thanks venam! Your post was very informative. You can then apply the pixmap pixels over some other drawables. The difference is that a window is something on the screen already while a pixmap only lives in a memory buffer. (15-05-2020, 02:47 AM)venam Wrote: In sum, windows and pixmap are instances of something more abstract called a drawable.