slop icon indicating copy to clipboard operation
slop copied to clipboard

Support for high refresh rate monitors

Open foxpy opened this issue 2 years ago • 5 comments
trafficstars

On a high refresh rate monitor (in @iambeingtracked's case 144hz) the selection GUI doesn't act as smooth as it should act with such a refresh rate.

Supersedes https://github.com/naelstrof/maim/issues/278

foxpy avatar Jul 01 '23 09:07 foxpy

Likely source of the issue:

https://github.com/naelstrof/slop/blob/864bdb2ce8bd6403e9e38c5c400cb93138952407/src/slop.cpp#L190-L192

N-R-K avatar Aug 16 '23 07:08 N-R-K

The XSync function flushes the output buffer and then waits until all requests have been received and processed by the X server.

I think the fix would be to replace

 XFlush(x11->display);
 std::this_thread::sleep_for(std::chrono::milliseconds(10));

with a simple

 XSync(x11->display, False);

CC @naelstrof

foxpy avatar Aug 16 '23 16:08 foxpy

Yeah that seems like it'll work, someone make a pull request and I'll accept it

naelstrof avatar Aug 16 '23 18:08 naelstrof

I'm not sure if XSync the "right" fix here or not. Ideally you'd want to sync with the vblank - using something like XPresent. (But I don't have any first hand experience in doing that, so can't offer anything more atm).

N-R-K avatar Aug 18 '23 03:08 N-R-K

maybe we should even use XNextEvent. slop is not a videogame, it only has to refresh screen when a new input event arrives.

though I don't have any experience, too.

foxpy avatar Aug 21 '23 09:08 foxpy