Skip to content
This repository has been archived by the owner on May 7, 2023. It is now read-only.

ilidemi/giorefreshrate

Repository files navigation

GioRefreshRate

Deprecated: this functionality has been merged into Gio

Allows to set the display refresh rate in Gio apps on Android. Some manufacturers limit apps using SurfaceView to 60hz, this library can bring it back and have that scroll be smooth.

Getting Started

Run go get github.com/ilidemi/giorefreshrate

Call giorefreshrate.PreferHighRefreshRate() or giorefreshrate.PreferLowRefreshRate() before the event loop and provide giorefreshrate access to the Window events:

+   giorefreshrate.PreferHighRefreshRate()

    for e := range w.Events() { // Gio main event loop
+       giorefreshrate.ListenEvents(e, w)

        switch e := e.(type) {
            // ...
        }
    }

That's it! The refresh rate will be the highest or lowest supported for the current display resolution.

Notes

Uses the same approach as flutter_displaymode.

About

A library to set refresh rate in Gio apps on Android

Resources

License

Stars

Watchers

Forks

Languages