Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support for high refresh rate monitors #168

Open
foxpy opened this issue Jul 1, 2023 · 5 comments
Open

Support for high refresh rate monitors #168

foxpy opened this issue Jul 1, 2023 · 5 comments

Comments

@foxpy
Copy link

foxpy commented Jul 1, 2023

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 naelstrof/maim#278

@N-R-K
Copy link

N-R-K commented Aug 16, 2023

Likely source of the issue:

slop/src/slop.cpp

Lines 190 to 192 in 864bdb2

// X11 explodes if we update as fast as possible, here's a tiny sleep.
XFlush(x11->display);
std::this_thread::sleep_for(std::chrono::milliseconds(10));

@foxpy
Copy link
Author

foxpy commented Aug 16, 2023

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

@naelstrof
Copy link
Owner

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

@N-R-K
Copy link

N-R-K commented Aug 18, 2023

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).

@foxpy
Copy link
Author

foxpy commented Aug 21, 2023

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants