GithubHelp home page GithubHelp logo

Support for high refresh rate monitors about slop HOT 5 OPEN

foxpy avatar foxpy commented on September 22, 2024
Support for high refresh rate monitors

from slop.

Comments (5)

N-R-K avatar N-R-K commented on September 22, 2024

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

from slop.

foxpy avatar foxpy commented on September 22, 2024

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

from slop.

naelstrof avatar naelstrof commented on September 22, 2024

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

from slop.

N-R-K avatar N-R-K commented on September 22, 2024

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

from slop.

foxpy avatar foxpy commented on September 22, 2024

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.

from slop.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.