AFAICT, this has never worked since the KPV -> KOReader refactor, as it relies on a weird little DrawContext "feature", while the actually in-use rotation framework is handled via BlitBuffer.
That kludge pollutes *a lot* of both the backend and frontend code, so I plan to annihilate that in a followup PR.
See #12303 for more context
* Use a dedicated cache hash for partial tiles from panel-zoom
* Never dump them to disk, as it confuses DocCache's crappy heuristics that rewinds the cache to skip over the hinted page to try to dump the on-screen page to disk.
* Apply the zoom factor in the exact same way as any other page rect (i.e., floor coordinates, ceil dimensions), and make sure said rect is actually a Geom so it doesn't break the cache hash, which relies on Geom's custom tostring method for rects. Said scaling method *also* belongs to the Geom class anyway.
* Handle such pre-scaled rects properly in renderPage, so as not to apply the zoom factor to the full page, which would attempt to create a gigantic buffer.
* And now that the rect is rendered properly in an appropriately-sized buffer, use the rendered tile as-is, no need to blit it to another (potentially way too large because of the above issue) blank BB.
* The zoom factor is now computed for a scale to best-fit (honoring `imageviewer_rotate_auto_for_best_fit`), ensuring the best efficiency (ImageViewer won't have to re-scale).
* Cache: Reduce the maximum item size to 50% of the cache, instead of 75%.
* Warn about the legacy ReaderRotation module, as it turned out to be horribly broken. The whole machinery (which is spread over *a lot* of various codepaths) is left as-is, peppered with notes & fixmes hinting at the problem. Thankfully, that's not how we actually handle rotation, so it was probably hardly ever used (which possibly explains why nobody ever noticed it breaking, and that nugget possibly dates back to the inception of the kpv -> ko refactor!). (#12309)
While #12256 papered over the tracking of a *single* suspend -> (resume->suspend) series of events, things still go out of sync if you tack on *more* suspend/resume events after that.
The upside is that our *actual* tracking of suspend/resume is solid, so at least we're actually doing the right thing as far as PM is concerned.
The downside is that on Kobo, the frontlight handling code is full of delays, and the ramping down/up itself also takes some time, so things can quickly overrun into the wrong event.
This means a couple of things:
* We need to cancel any scheduled frontlight toggles and ramps on Kobo, to ensure that only the one from the *last* event received goes through, in an attempt to limit the amount of potential crossover.
* Tracking fl_was_on *cannot* reliably be done from the suspend/resume handlers (especially on Kobo), as the ramps themselves may cross over the event barriers (and we potentially cancel the task anyway), so this was moved to the very few interactive callers that will actually change the frontlight state.
* On Kobo, crossover is still *somewhat* possible because the ramps take time. It's mostly harmless for the ramp down, we just need to tweak the ramp down to start from the actual intensity to avoid a weird jump on the initial step if there's an inconsistency. For the ramp up, we potentially need to manually kill the light first, because off -> on assumes it *really* starts from off ;).
Followup to #12256Fix#12246 (again)
When zooming to a small panel on a device with a large display, the
resulting zoom factor often causes `renderPage()` to only render the
panel itself instead of the whole page. `getPagePart()` needs to
account for that when extracting the panel from the rendered tile.
Fixes half of #7961 (namely the black/half-black rectangles)
Prevent crash:
```
./luajit: frontend/util.lua:1092: attempt to get length of local 'str' (a nil value)
stack traceback:
frontend/util.lua:1092: in function 'fixUtf8'
frontend/ui/network/manager.lua:1109: in function 'requestToTurnOnWifi'
[…]
```
Getting text from xpointers to get the current selected
word context would have crengine unhighlight that word.
Allow to get it selected again when done getting context.
The item's idx field is based on the current view settings, so only trust it when there's no filtering or searches involved, which ensures the order matches the actual history array layout.
Hopefully in the least intrusive way possible, because frontlight handling code is hell.
`self.fl_was_on` could go out of sync with the expected state when resume->suspend events happened in very quick succession, leading to it being set to false, preventing the frontlight from being turned back on on the next resume.
Fix#12246
Namely, in the face of wpa_supplicant doing multiple scans. Note that a backend PR will make this largely redundant, by actually fixing the core issue in our backend ;).
Also add more logging around the authentication status.
* UIManager: Let the fb backend deal with Kaleido wfm promotion. This fixes a number of quirks that poisoned the refresh queue with spurious full-screen refreshes. See https://github.com/koreader/koreader-base/pull/1865 for more details.
* This also means we now disable Kaleido waveform modes when color rendering is disabled (remember to trash your thumbnail cache if you don't want to mix color w/ grayscale thumbnails, though).
* UIManager: Merge refreshes that share an edge, because that was driving me nuts (and would have most likely been merged by the kernel anyway). A perfect test-case is the FM, which trips two separate refreshes because of its title bar.
* ReaderFlipping: Use sensible dimensions, so that we only refresh the icon's region.
* ReaderBookmark: Only refresh the dogear instead of the whole page when toggling bookmarks.
* NetworkSetting: Make it a real boy, so it consistently refreshes properly on dismiss instead of relying on UIManager saving the day.
* Kobo: Aggressively prevent *both* suspend & standby while MTK devices are plugged-in, as both will horribly implode the kernel (we previously only prevent standby while charging).
* Kobo: Switch to 8bpp on B&W MTK devices (or when color rendering is disabled on Kaleido panels).
so as not to break the beforeWifiction shenanigans...
Which is most of them, only the Emulator subclass sets it, for...
reasons.
(That Emulator quirk is also why we can't simply scrap the whole thing
to use NetworkMgr's default imps).
Fix#12203 (thanks to @benoit-pierre for spotting that one).
This was clearly an oversight on my part when working on #10669
Avoid highlights' xpointers to be recomputed when
switching between page and scroll mode, which could
make using "Auto-scroll when selection reaches a corner"
really slow when having a large number of highlights.
Closes#12156.
Latest MuPDF update changed HTML parsing, and use a better
HTML5 parser, which may cause some issues with the XHTML
we get from crengine.
So, for footnote popups, be sure we use MuPDF's XHTML parser.
Devices with a single target might want to specify it in `Device.ota_model`
Devices with multiple targets want to override the function or to specify `ota_model` variants for each target.
* Kindle: Implement a NetworkMgr backend loosely based on WpaClient in order to allow feature-parity with hasWifiManager platforms. This involves dealing with the native wifid over lipc (the native IPC system, based on DBus), through custom Lua bindings (https://github.com/notmarek/openlipclua), since the stock ones lack support for the needed hasharray data type.
* NetworkMgr: Clear up leftover hallucinations from #10669, making `enableWifi` much simpler (and much more similar to `turnOnWifiAndWaitForConnection`).
* NetworkMgr: Made it clearer that `turnOnWifi` implementations *must* deal with `complete_callback`, as part of the aforementioned changes mean that it's *always* wrapped in a connectivity check, and we need that for proper event signaling.
* Android, Emu: Run `complete_callback` properly in `turnOnWifi`.
* Kindle: Support `powerd:isCharged()` on the PW2 (yes, this is random, it just happened to be my test device :D).
* NetworkMgr:disableWifi: Properly tear down any potential ongoing connection attempt (e.g., connectivity check).
* NetworkMgr:promptWifi: Make the "wifi enabled but not connected" popup clearer if there's an ongoing connection attempt, and gray out the "Connect" button in this case (as it would only lead to another "connection already in progress" popup anyway).
* NetworkMgr:reconnectOrShowNetworkMenu: Make *total* scanning failures fatal (they will lead to an immediate wifi teardown).
* NetworkMgr:reconnectOrShowNetworkMenu: Clear up the long-press behavior (which *always* shows the network list popup) so that it doesn't weirdly break all the things (technical term!).
* NetworkMgr:reconnectOrShowNetworkMenu: When we manage to connect to a preferred network on our own *before* showing the network list, make sure it is flagged as "connected" in said list.
* NetworkMgr:reconnectOrShowNetworkMenu: Make connection failures fatal in non-interactive workflows (they'll lead to a wifi teardown).
* NetworkSetting (the aforementioned network list widget): Clear NetworkMgr's "connection pending" flag on dismiss when nothing else will (i.e., when there's no connectivity check ticking).
Ignore files starting with "._" (metafiles by MacOS), that will otherwise show up in the Styletweaks menu. (These files are alrady ignored in the File manager, even when 'show hidden files' is enabled.)
This allows plugins to handle relative and otherwise schemeless URLs.
Also: clear registered schemes on each init(), to parallel the situation
with external link buttons, and add documentation.
With enabled battery percentage shown and some other (e.g. reading percentage) the alt status bar shows the expected line. But when disabling everything except battery percentage, then the reading percentage keeps being shown.
So when using this `self:page_info_override` caching trick, we have to restore the cre default again.
as first discussed here #11908. This PR brings the book map to non-touch devices that useDPadAsActionKeys().
Book map can be accessed from the menu or by using the following shortcut: ScreenKB + Down or Shift + Down depending on whether you use a K4 device or a kindle with keyboard respectively.
Inside the book map, a user can toggle the hamburger menu by pressing the Menu key and make any adjustment from there. ScreenKB (or Shift) + Up/Down allows it to scroll and Page turn buttons to move by whole full page turns. Back key allows user to exit the map.
K4 is ergonomically designed to be held with one hand (one's hand wrapped around the back and both thumb and middle finger on either PgFwd buttons).
This PR allows users to individually invert left and right page turners such that it can be operated just with one hand. It also closes#9350
Not sure if there are any other devices with two sets of page turn buttons, so currently limited to kindle, excluding kindle Voyage, but could be added too, albeit with some gymnastics.
This will make the stroke-based Chinese character keyboard compatible with Japanese kanji stroke order, with an increase of the data file by about 80kb.
This could be a temporary solution for Japanese users to type kanji before better methods are implemented.
The stroke order data are extracted from this repo: https://github.com/KanjiVG/kanjivg.