Last active
October 14, 2023 21:22
-
-
Save NiLuJe/4be737eb123cf1199590b626be131345 to your computer and use it in GitHub Desktop.
KOReader: Disable HW inversion in case it's unreliable (e.g., mxcfb on old ntx kernels).
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
local Device = require("device") | |
local Screen = Device.screen | |
-- Flipping canHWInvert affects what fb:toggleNightmode does, so make sure we flip it with NM *off*, | |
-- because it'll already have been run by Device:init before this patch runs... | |
-- Otherwise we'll flip the Screen's bb invert flag the wrong way around ;). | |
local is_nm = Screen.night_mode | |
if is_nm then | |
Screen:toggleNightMode() | |
end | |
Device.canHWInvert = function() return false end | |
if is_nm then | |
Screen:toggleNightMode() | |
end |
done that
Updated to fix the breakage when restarting with nightmode enabled ;).
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
how do I apply this patch?