Eeems-Org / oxide

A desktop environment for the reMarkable tablet
https://oxide.eeems.codes
MIT License
238 stars 21 forks source link

Handling of suspended.png that is not 1872x1404 #326

Closed FouzR closed 5 months ago

FouzR commented 11 months ago

Problem. After the Type Folio's release, xochitl has a landscape lockscreen when the Type follow is deployed. It can handle pngs of 1872x1872, cropping it as needed for landscape/portrait orientations. Oxide currently uses a Qt function to draw on the screen, the suspended.png file before putting the device to sleep, without ever using xochitl's lockscreen system. This creates a couple of problems, namely the orientation, and the buggy behaviour when the png is NOT 1872x1404, resulting in stretched/squashed image.

Solution Tho I have little experience, I can see a couple of ways to fix this. One might be to have a suspended_l.png and suspended_p.png file, each for landscape/portrait respectively already cropped to the right dimensions, and drawn onto the screen depending on state of the folio. This cropping could be done when the suspended.png is altered/modified. Another might be to selectively draw a portion of the png, but I am uncertain how one might go through that

Eeems commented 11 months ago

Selective drawing is rather easy with QPainter::drawImage

This is blocked by adding folio support (#297) since we'd have to detect the folio being detected to be able to know if we are in landscape or not.