2
0
mirror of https://github.com/koreader/koreader synced 2024-11-10 01:10:34 +00:00
Commit Graph

10596 Commits

Author SHA1 Message Date
NiLuJe
cafa9c8251
Disable the legacy ReaderRotation module (#12309)
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
2024-08-08 04:53:04 +02:00
NiLuJe
46a5d20513
Document: Do not cache panel-zoom tiles to disk and fix their caching and rendering (#12303)
* 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)
2024-08-08 04:52:24 +02:00
Benoit Pierre
5daff2579b
bump base; mostly thirdparty bumps (#12311)
- https://github.com/koreader/koreader-base/pull/1885
- https://github.com/koreader/koreader-base/pull/1886
- https://github.com/koreader/koreader-base/pull/1887
- https://github.com/koreader/koreader-base/pull/1888
- https://github.com/koreader/koreader-base/pull/1889
- https://github.com/koreader/koreader-base/pull/1890
- https://github.com/koreader/koreader-base/pull/1891
- https://github.com/koreader/koreader-base/pull/1892
- https://github.com/koreader/koreader-base/pull/1893
- https://github.com/koreader/koreader-base/pull/1895
- https://github.com/koreader/koreader-base/pull/1896
- https://github.com/koreader/koreader-base/pull/1897
- https://github.com/koreader/koreader-base/pull/1898
2024-08-07 23:33:27 +02:00
David
2900eef276
Show/Hide Virtual keyboard and more keyboard shortcuts (#12162) 2024-08-07 18:09:40 +02:00
hius07
975efae929
ReaderSearch: "All text" improve (#12287) 2024-08-06 19:12:16 +03:00
Frans de Jonge
880b7c5ed1
Profiles: make sure to close menu/quickmenu before executing action (#12299)
Mainly a difference without distinction, but in some edge cases like screenshots it keeps the menu on the screen.
See <https://github.com/koreader/koreader/pull/12293#issuecomment-2269680044>.

The "Show as QuickMenu" is really just for balance; it makes little to no difference.
2024-08-06 15:15:08 +02:00
mbays
fd8c9be57f MultiInputWidget: add addWidget 2024-08-06 13:12:08 +02:00
mbays
092649338b InputDialog: add setAllowNewline 2024-08-06 13:12:08 +02:00
mbays
f122e0082b MultiInputDialog: add enter_callback applying to all fields 2024-08-06 13:12:08 +02:00
mbays
b5203686e3 InputDialog: call edited_callback on edit even when no Save/Close buttons 2024-08-06 13:12:08 +02:00
NiLuJe
7e8cdbcf65
PowerD: Keep track of frontlight state change by interactive callers for suspend/resume purposes (#12283)
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 #12256
Fix #12246 (again)
2024-08-06 01:13:14 +02:00
Frédéric Brière
9e6f3dac65
Panel zoom: Properly handle renderPage() not rendering the whole page (#12296)
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)
2024-08-05 22:47:51 +02:00
Benoit Pierre
a6663202b7
NetworkMgr: fix debug trace (#12297)
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'
[…]
```
2024-08-05 19:09:47 +02:00
Benoit Pierre
f22e8bbbc2
doc: update building documentation (#12295)
Meson is now required.
2024-08-05 13:00:38 +02:00
David
3992438872
[CoverBrowser.MosaicMenu] Increase focus underline thickness (#12189) 2024-08-05 10:19:16 +02:00
poire-z
949b996ad7
Fix early unhighlight after Add to vocab builder (#12288)
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.
2024-08-04 23:27:30 +02:00
ziz57
c213bd779c
ReaderUI: add seamless argument to switchDocument (#12290) 2024-08-04 20:02:45 +02:00
NiLuJe
030f4a15d4
ReadHistory: On remove, trust the index from FileManagerHistory if possible (#12253)
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.
2024-08-03 21:49:11 +02:00
zwim
f6f8b38cac
[plugin] Reader footer: check if header resp. footer are available (#12264) 2024-08-03 16:38:56 +02:00
Benoit Pierre
13cc21b769
make: fix android update sdcv (#12275)
Need the real stuff, not a symlink.
2024-08-03 08:35:49 +02:00
hius07
74e863c9bb
readerannotation: fix matchFunc (#12270) 2024-08-02 22:36:34 +03:00
Benoit Pierre
3567a59bcb ci/macos: update binaries dump & check 2024-08-02 18:46:29 +02:00
Benoit Pierre
673f15f3ce ci/macos: install meson 2024-08-02 18:46:29 +02:00
NiLuJe
b0f6a0e039 Bump base
https://github.com/koreader/koreader-base/pull/1861
https://github.com/koreader/koreader-base/pull/1864
https://github.com/koreader/koreader-base/pull/1869
https://github.com/koreader/koreader-base/pull/1866
https://github.com/koreader/koreader-base/pull/1877
https://github.com/koreader/koreader-base/pull/1876
https://github.com/koreader/koreader-base/pull/1875
https://github.com/koreader/koreader-base/pull/1874
https://github.com/koreader/koreader-base/pull/1878
https://github.com/koreader/koreader-base/pull/1871
https://github.com/koreader/koreader-base/pull/1879 (Make Wi-Fi scanning reliable, re: #12236)
https://github.com/koreader/koreader-base/pull/1880
https://github.com/koreader/koreader-base/pull/1872
https://github.com/koreader/koreader-base/pull/1882
https://github.com/koreader/koreader-base/pull/1884
https://github.com/koreader/koreader-base/pull/1883
2024-08-02 18:46:29 +02:00
NiLuJe
9b9898d466
Kobo: Track frontlight state more accurately on suspend/resume (#12256)
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
2024-08-01 23:06:31 +02:00
Frans de Jonge
764a482f8c
[fix] NetworkMgr: apply HTTP proxy setting on startup (#12260)
Fixes #12244.
2024-08-01 21:03:34 +02:00
Benoit Pierre
7ef78e606e
make: install missing cr3.css… (#12262) 2024-08-01 14:11:28 +02:00
hius07
a24bb70066
Annotations: fix exporting (#12261) 2024-08-01 13:14:46 +03:00
hius07
e5fb836a81
ReaderFooter: improve (#12243) 2024-08-01 13:11:28 +03:00
Benoit Pierre
f9ee2449c7
make: handle old build data directory (#12259) 2024-08-01 09:06:39 +02:00
Benoit Pierre
dbebf3f996 make: tweak data install rules
Use a directory distinct from the one in base (so its entries survive
a `make base-re`), symlink the base data directory entries, and the
crengine data files directly from its checkout (since the base data
directory now only contains the bare minimum).
2024-07-31 08:45:48 +02:00
Benoit Pierre
47a2d3900f make: fix testfront rule
Same behavior as for base: build and install test data before running.
2024-07-31 08:45:48 +02:00
Benoit Pierre
1add3b5772 make: directly include base main makefile 2024-07-31 08:45:48 +02:00
Benoit Pierre
4855a8695d make: minor cleanups 2024-07-31 08:45:48 +02:00
Benoit Pierre
14f105707d make: always symlink, even for release builds (faster) 2024-07-31 08:45:48 +02:00
Benoit Pierre
d83647d76e make: simplify symlink installs
Since we mandate coreutils on macOS too, we can simplify calls to `ln`.
2024-07-31 08:45:48 +02:00
Benoit Pierre
d9e4376e35 make: avoid duplicate fetchthirdparty
When using `make fetchthirdparty` and base has not been checkout yet:
- make want to include `Makefile.defs` which is missing
- the rule for `Makefile.defs` / `fetchthirdparty` are executed
- make reload the main makefile, and execute `fetchthirdparty`
2024-07-31 08:45:48 +02:00
Benoit Pierre
040e033edb make: move android variables where they belong 2024-07-31 08:45:48 +02:00
NiLuJe
5c77774ca9
NetworkMgr: Attempt to handle wpa_supplicant rescans better (#12236)
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.
2024-07-30 11:44:45 +02:00
Benoit Pierre
45d1a14aed
bump base (#12241)
Preliminary bump before #1242:
- https://github.com/koreader/koreader-base/pull/1867
- https://github.com/koreader/koreader-base/pull/1868
- https://github.com/koreader/koreader-base/pull/1870
2024-07-30 08:36:44 +02:00
Benoit Pierre
18439e7578
doc: explicitly mention perl dependency (#12240)
It usually gets pulled when installing git.
2024-07-30 08:36:08 +02:00
hius07
3919deef05
readerannotation: fix doesMatch func (#12231) 2024-07-29 17:39:44 +03:00
Benoit Pierre
817afe8ed7
ci/macos: pin XCode version (#12229)
Avoid breakage on runner image update, like the recent update
to XCode 15.4 on arm64 which breaks our (ancient) glib build.
2024-07-28 18:31:59 +02:00
NiLuJe
d59c837714
Kobo: Refactor various aspects of the Kaleido/MTK support (#12221)
* 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).
2024-07-28 01:19:40 +02:00
NiLuJe
761cf18222
SDL: Return true in NetworkMgr:isConnected on !hasWifiToggle platforms, (#12217)
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
2024-07-26 02:12:53 +02:00
hius07
477d6865f1
toggleswitch: fix long-press (#12215) 2024-07-24 18:36:21 +03:00
hius07
8cb221c6c6
Annotations: pageno honors reference pages and hidden flows (#12214) 2024-07-24 18:35:48 +03:00
hius07
b17bd967da
Page turns: invert vertical tap zones (#12195) 2024-07-24 18:34:23 +03:00
Trash Panda
5affb68233
AltStatusBar: add option to show Author (#12197) 2024-07-21 20:11:46 +02:00
poire-z
1dd3704200
bump crengine: various fixes and optimizations (#12200)
Includes:
- xml parser: simplifications and optimizations
- lvstring: optimize Utf8ToUnicode
- lvstream: add helper to read the whole stream
- lvfntman: use new `LVStream::GetData` helper
- EPUB: minor simplification
- EPUB: fix possible buffer overflows
- EPUB: improve support for obfuscated fonts
- lvfntman: add error traces for some freetype calls
- LVDocView header: allow displaying author and book title separately
- LVFontDef::CalcMatch(): bump weight of typeface match
- Font: fix measureText() when max_width met with fallback font
- TextLang: Russian: loosen curly quotes handling
- base: cre.cpp: isLinkToFootnote: say no if target has empty content
- base: fix MacOS build
2024-07-21 20:09:02 +02:00