View Single Post
Old 05-24-2020, 10:26 PM   #7
NiLuJe
BLAM!
NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.
 
NiLuJe's Avatar
 
Posts: 13,506
Karma: 26047202
Join Date: Jun 2010
Location: Paris, France
Device: Kindle 2i, 3g, 4, 5w, PW, PW2, PW5; Kobo H2O, Forma, Elipsa, Sage, C2E
@yparitcher: The neat way would be to punt the nightmode handling to the kernel by just flipping the grayscale flag in the fb state instead of ORing the INVERT EPDC flag on each refresh ourselves. This way *every* refresh is inverted, no matter the source.

This is highly platform specific, though (mxcfb @ 8bpp, which, granted, means the full Kobo lineup, the full reMarkable lineup, and every Kindle on FW 5.x. And possibly PB, too).

----

The cheap way would be to simply check the process table for luajit/koreader and skip the fbink_refresh() call if it's up .

AFAIR, it's a bit gnarly if you want to do it in C, because you're basically reinventing procps, so it may be simpler to just rely on the output from pidof or pgrep.

Last edited by NiLuJe; 05-24-2020 at 10:32 PM.
NiLuJe is offline   Reply With Quote