You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
/* HACK: although we recived a DestroyNotify event, the frame still
* might not have been updated. a compositor might also buffer frames
* adding latency. so wait a bit for the screen to update and the
* selection borders to go away. */
structtimespect= { .tv_nsec=80*1000L*1000L };
while (nanosleep(&t, &t) <0&&errno==EINTR);
Instead of sleeping, we might want to detect whether the screen got repainted or not more reliably. This way, users who have a fast/low-latency system won't have to unnecessarily pay for the ~80ms sleep.
And if we cannot detect it more reliably, then we might want to listen for vblank rather than sleeping a fixed amount. Listening for about 4~5 vblanks should be okay, on 60hz monitors that'll be around 80ms, on faster 240hz it'll be about ~21ms. (Unfortunately, I don't know any simple way to listen for vblanks on X without depending on opengl/GLX).
Currently we have the following going on in the destroy part of selection-edge:
scrot/src/selection_edge.c
Lines 142 to 147 in 1a9964a
Instead of sleeping, we might want to detect whether the screen got repainted or not more reliably. This way, users who have a fast/low-latency system won't have to unnecessarily pay for the ~80ms sleep.
The XDamage extension might work. But my previous experience with it wasn't very fruitful.
And if we cannot detect it more reliably, then we might want to listen for vblank rather than sleeping a fixed amount. Listening for about
4~5
vblanks should be okay, on 60hz monitors that'll be around 80ms, on faster 240hz it'll be about ~21ms. (Unfortunately, I don't know any simple way to listen for vblanks on X without depending on opengl/GLX).Some other related discussion: #274 #304
The text was updated successfully, but these errors were encountered: