You are not logged in.

#1 2025-04-01 17:48:50

Boyaroslav
Member
Registered: 2024-08-30
Posts: 3
Website

X11 window updating

Hello to everyone. I have a little project where I draw a rectangle on my root screen. I use Xlib for that. Sadly it creates a lot of trash when the coordinates of right corner of the rectangle changes. Can I update the whole screen by using Xlib? How does xsnow draw its snowflakes without doing a mess? Please help me to find the answer/solution



My code is there:
https://github.com/Boyaroslav/snip (its like screenshooting tool)

Offline

#3 Today 12:47:44

Boyaroslav
Member
Registered: 2024-08-30
Posts: 3
Website

Re: X11 window updating

XCLearArea doesnt help. The same with XClearWindow. Idk what to do

Offline

#4 Today 15:10:51

seth
Member
Registered: 2012-09-03
Posts: 62,277

Re: X11 window updating

How does xsnow draw its snowflakes without doing a mess?

The answer to that is "XClearArea".

If you just want to draw some rectangular position indicator, draw it XOR, then draw it again to flip the pixels back before drawing the new rect.

nb. that all of that will be glitchy in the presence of a compositor, rather use for windows to construct the indicator (can be input shaped, ie. output only)

Offline

Board footer

Powered by FluxBB