View Single Post
Old 01-05-2024, 01:19 AM   #480
Matthew Roloff
Junior Member
Matthew Roloff began at the beginning.
 
Posts: 1
Karma: 10
Join Date: Jan 2024
Device: Onyx BOOX Palma
Post

Hi,

I have been trying to create a user patch to account for the BOOX Palma's massive bezels which cover up the top corners of the screen. I attached what I came up with below but it doesn't seem to have any effect (It isn't the F-Droid version of the app).


koreader/patches/1-andoid-viewport-shift-down:
Code:
local Device = require("android")

function Device:setViewport(x, y, w, h)
    logger.info(string.format("Switching viewport to new geometry [x=%d,y=%d,w=%d,h=%d]", x, y, w, h))
    local viewport = Geom:new{x=x, y=120, w=w, h=h}
    self.screen:setViewport(viewport)
end

There is also this old related issue that never seemed to be resolved. Changing the setViewport in "ffi/framebuffer" also didn't seem to do anything.


koreader/patches/1-framebuffer-viewport-shift-down
Code:
local fb = require("ffi/framebuffer")

fb.setViewport = function(self, viewport)
    if not self.full_bb then
        self.full_bb = self.bb
    end
    self.debug("fb:setViewport() setting viewport to",
               viewport.x, viewport.y,
               viewport.w, viewport.h)
    self.bb = self.full_bb:viewport(
        viewport.x, 120,
        viewport.w, viewport.h)
    self.viewport = viewport
    self.full_bb:fill(Blitbuffer.COLOR_WHITE)
    self:refreshFull()
end

Any help would be appreciated,
thanks
Matthew Roloff is offline   Reply With Quote