#Xlib Rendering rectangle lags behind cursor

17 messages · Page 1 of 1 (latest)

remote sentinel
#

I know this code isn't very good. Just kinda a prototype at the moment. I want the rectangle to keep up with my mouse cursor. Currently, the rectangle that is being rendered is lagging behind the cursor.

balmy helmBOT
#

When your question is answered use !solved to mark the question as resolved.

Remember to ask specific questions, provide necessary details, and reduce your question to its simplest form. For tips on how to ask a good question use !howto ask.

remote sentinel
#

I tried to chatgpt my problem for help but that didnt really lead me anywhere, currently im at a sort of a stand still

dapper cobalt
#

Lagging how?

remote sentinel
#

uhh, rather than the end point of the rectangle being at the cursor, the rectangle is being drawn slower than the cursor moves

#

the specific function is takeUserInput()

dapper cobalt
#

An input lag of a frame or two is normal.

remote sentinel
#

its much more than a frame or 2

#

lemme see if i can get a quick video of it

#

it didnt embed bruh

#

sorry 1 sec

#

it was a bit worse before using XFlush, but i can't figure out how to fix the problem as a whole

#

Xlib Rendering rectangle lags behind cursor

remote sentinel
#

Making an event loop in a different program with a simple window has the correct functionality but the problem is that I am clearing the window every time I am redrawing the rectangle. I don't think I can clear the window each time because it would clear the SCREEN_IMAGE that i overlayed onto the overlay_window

#

currently what I am doing is re-overlaying the image every time and I believe thats my problem but I dont know of another solution to keep the image shown