diff --git a/einkfb.c b/einkfb.c index a1f7054f9..cfc268719 100644 --- a/einkfb.c +++ b/einkfb.c @@ -150,6 +150,16 @@ static int einkUpdate(lua_State *L) { ioctl(fb->fd, FBIO_EINK_UPDATE_DISPLAY_AREA, &myarea); #else // for now, we only do fullscreen blits in emulation mode + if (fxtype == 0) { + // simmulate a full screen update in eink screen + if(SDL_MUSTLOCK(fb->screen) && (SDL_LockSurface(fb->screen) < 0)) { + return luaL_error(L, "can't lock surface."); + } + SDL_FillRect(fb->screen, NULL, 0x000000); + if(SDL_MUSTLOCK(fb->screen)) SDL_UnlockSurface(fb->screen); + SDL_Flip(fb->screen); + } + if(SDL_MUSTLOCK(fb->screen) && (SDL_LockSurface(fb->screen) < 0)) { return luaL_error(L, "can't lock surface."); } diff --git a/unireader.lua b/unireader.lua index e6c9a3740..db5eed43c 100644 --- a/unireader.lua +++ b/unireader.lua @@ -187,6 +187,11 @@ function UniReader:initGlobalSettings(settings) if cache_max_ttl then self.cache_max_ttl = cache_max_ttl end + + local rcountmax = settings:readSetting("partial_refresh_count") + if rcountmax then + self.rcountmax = rcountmax + end end -- guarantee that we have enough memory in cache @@ -523,7 +528,7 @@ function UniReader:show(no) self:toggleTextHighLight(self.highlight[no]) end - if self.rcount == self.rcountmax then + if self.rcount >= self.rcountmax then print("full refresh") self.rcount = 1 fb:refresh(0) @@ -1070,6 +1075,12 @@ function UniReader:addAllCommands() unireader:showHighLight() unireader:goto(unireader.pageno) end) + self.commands:add(KEY_R, MOD_SHIFT, "R", + "manual full screen refresh", + function(unireader) + unireader.rcount = 1 + fb:refresh(0) + end) self.commands:add(KEY_HOME,nil,"Home", "exit application", function(unireader)