Commit Graph

940 Commits (d9e4376e3594b7df97841fe70e94d03e5ff9382e)

Author SHA1 Message Date
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).
2 months ago
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
2 months ago
Martín Fernández 617618d587
Add Device:otaModel() (#12014)
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.
3 months ago
Marek Veselý 4c4cfa2db0
Kindle: add wifi selector (#12056)
* 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).
3 months ago
David f330593233
Fixing button invert on start (#11982)
fixing issue described here https://github.com/koreader/koreader/pull/11963#issuecomment-2147876605
4 months ago
David 7a84cfef4a
Individually invert left or right side page turn buttons on Kindle (#11963)
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.
4 months ago
NiLuJe 6a4d433aa9
Kobo: check for RGBA vs BGRA the proper way (#11953)
i.e., poke at the fb vinfo data to check the component offsets.

Fix #11952
4 months ago
Frans de Jonge 8f2bd5420d
Introduce Device:useDPadAsActionKeys() (#11900)
1. Non-Kindle-specific `hasFiveWay` behavior is changed to `hasDPad and useDPadAsActionKeys`. For now they remain Kindle-specific in practice, unless one sets `useDPadAsActionKeys = yes` in a user patch.
2. With that disambiguation out of the way, `hasFiveWay` itself is further disambiguated into `hasScreenKB` and `hasSymKey`, as per the actual property being used, rather than something that tends to correlate with it. (It needn't be Kindle-specific per se, but non-Kindle devices have equivalent shortcuts with for example `Shift`.)
  Running the emulator with `DISABLE_TOUCH=1` will set `hasSymKey = yes`, which can be tested with right shift.

Closes #11887.
4 months ago
NiLuJe f0f37e3153
Kobo: Boost saturation for CFA refreshes (and add a dev setting to disable it) (#11883)
Being able to disable it can be interesting, because it *is* a somewhat destructive process.

* Requires a base bump:
https://github.com/koreader/koreader-base/pull/1793
https://github.com/koreader/koreader-base/pull/1794
4 months ago
SomeGuy 6c7e2a9c62
Support screenshots on Non-Touch with ScreenKB as modifier (#11802)
on devices (mostly kindles) with keyboards: Alt + Shift + G
on kindle 4: ScreenKB + Menu
4 months ago
SomeGuy 577c5d454f
Non-touch DPad improvements (#11749)
Closes #11295.
4 months ago
NiLuJe 4d9c6523ad
Input: Some more followups to the input device auto-detection stuff (#11855)
Switch to a new `input.fdopen` API & wrapper so we can keep the fds opened by `fbink_input_scan` instead of closing them to re-open them right after that...

This should hopefully help on racy zForce devices that attempt to handle power management when opening/closing the device. We know this sometimes horribly fail to re-activate the IR grid (c.f., our manual activation on resume), but this apparently could also happen here (re: #11844) because of the quick succession of open->close->open.
4 months ago
Tomáš Janoušek e94550a261
PocketBook: Open links in the on-device web browser (#11787)
Many PocketBook devices include a web browser, but when clicking a link in KOReader, there was no option to open the link in the browser, there was only an option to show a QR code (which can then be scanned by a smartphone).

This commit implements `canOpenLink`/`openLink` on PocketBook using the "browser.app", if available.

Tested on PB740 (InkPad 3).

Fixes: https://github.com/koreader/koreader/issues/11782
Related: https://github.com/koreader/koreader/issues/6597
4 months ago
Martín Fernández 7bded465eb
SDL: add flatpak flavor (#11833)
* ship metadata with generic linux binaries
* append release version & data at build time
4 months ago
NiLuJe 05168b22f5
Kindle: Don't forget about fiveways on legacy devices & fix a couple input-scan misdetections (#11827)
* Kindle: Don't forget to open INPU_DPAD devices for the fiveways. Somehow managed to skip my mind, they're often on a separate input device.

Regression since #11807

* Update FBInk to fix a few cases of input_scan misdetection (on misconfigured drivers (e.g., no DIRECT prop on supported kernels), or old kernels with no EVIOCGPROP support).

Fix #11824
4 months ago
NiLuJe fd5260f2ce
Support auto-detection of input devices via fbink_input (#11807)
* Kobo: Drop a bunch of if ladder crap and switch to auto-detection of input devices via fbink_input
* Kindle: Drop an even larger bundle of crap to do the same ;p. (re: #11392)
* ExternalKeyboard: Switch to fbink_input to whitelist keyboards instead of the manual parsing of caps via its FindKeyboard class
* Input: Extended open/close wrappers to handle logging & tracking of dupe open/close calls.
4 months ago
mergen3107 8a316f928a
Kindle: remove separate L and R orientations (#11780)
Fixes #11743
4 months ago
Joshua Bullock 1398154546
Gesture: Add toggle for orientation lock (#11795) 4 months ago
Predrag Đokić eb6e5e3c20
Kindle: Fix missing Amazon UI screensaver after exiting KOreader (#11794) 4 months ago
peicuiping a7e34673e6
chore: remove repetitive words (#11785) 4 months ago
Valentin Dubois 526a1fb727
Initial support for new Kobo (Clara B/W + Colour, Libra Colour) (#11737)
* Support the Clara B&W, Clara Colour & Libra Colour
* Enable HW dithering on *all* the Kobo MTK devices
* Enforce 32bpp instead of 8bpp for Kobo devices with a color panel (the driver doesn't actually support 8bpp anyway)
* Enable standby support on MTK (whenever possible, i.e., not when plugged in, as that is horribly, horribly broken).
* Enforce the dedicated "color" waveform mode for image content in ScreenSaver, ImageViewer & Reader.
* Fix charging LED support on MTK
* Tweak the frontlight ramp on MTK + LM3630 so that it actually ramps smoothly
4 months ago
Benoit Pierre e8544316a8
pocketbook: simplify device model detection (#11721)
To avoid avoid having to manually handle the multiple
ways a model name reported by inkview can be formatted.
5 months ago
mergen3107 caea0e8fb2
Kindle Scribe: improve gyro detection, replace accel with acc keyword (#11696)
Fixes #11691.
5 months ago
ElimGarak1 bfc84795c8
Add PocketBook Era Color (PB700K3) (#11695)
Fixes #11684.
5 months ago
mergen3107 d3011571a3
Kindle Scribe: find accelerometer based on hardware (#11642)
Closes #11392 (temporarily).
5 months ago
Tomas Janousek 1fbdc1f19d NetworkMgr: Limit the hasDefaultRoute check in isOnline to PocketBooks
It's not necessary on other platforms. To be more precise, it would be
necessary on Kobo as well, but there's a different workaround in place:
https://github.com/koreader/koreader/pull/6424/files#diff-be863601c59a2d6607af6b04b3be2392ec4494df6d25dae48250fae57b737f61R216-R224
6 months ago
Denis Malinovsky 501cba6ebe
PocketBook: remove unused `color_saturation` parameter (#11597)
Bumps base for https://github.com/koreader/koreader-base/pull/1751

Includes several build system improvements as well
6 months ago
NiLuJe dd8560cef8
Input: Don't let wacom pens clobber the slot of the next contact (#11520)
If there's only one contact, we won't get an ABS_MT_SLOT, so we need to
make sure we fall back to the main finger slot once we've caught a tool
switch.

Also, move the dedicated pen slot further away, so it has zero chance of
being detected as a potential buddy contact to a finger contact.

Fix #11514
7 months ago
Hzj_jie d4c78aaa4f
Kindle oasis has no ambient brightness sensor (#11456)
I did not notice an ambient brightness sensor, nor adaptive brightness feature. (Ref: https://www.geekwire.com/2016/kindle-oasis-review-amazons-premium-e-reader-use-premium-features/)

Was it previously wrongly configured?
7 months ago
zwim f836f6a237
Clear UI leftovers before doing an OTA-install, add unmovable to InfoMessage and ConfirmBox (#11412) 8 months ago
NiLuJe 4785df48a9 PRSTux: Disable OTAs
We haven't been offering any for years, and I've just killed zsync
support there anyway.
8 months ago
NiLuJe 72250daba8 UI: Add a verbose debug logging checkbox next to "Report a bug"
@hius07 mentioned something to that effect a while back, makes sense.

Unlike the set of checkmarks in the dev settings, this one flips both
debug + verbose at once, *and* asks for a restart for framebuffer's
sake.

Also update the "Report a bug" spiel to request verbose debug logs.
8 months ago
NiLuJe c529c1cce3 Kindle: Log the args from WakeupFromSuspend & ReadyToSuspend 8 months ago
NiLuJe 588bf38c84 Kindle: Log the suspend/wakeup source
We currently don't do anything with it, but this might help someone come
up with fancier smartcover handling, like we do on Kobo...

Simplify the fake events w/args checks:
We can just hitcheck the table directly, no need for another hash

Also catch ExitedSS on Kindle.
And, again, dn't do anything with it ;p.
8 months ago
NiLuJe dcfcc81dcf Android: Don't forget to call Generic.exit on Device:exit ;).
Fix #11345
8 months ago
NiLuJe c97d20cd24
Chore: Make sure we always pass a rect to `fb:refreshFull` (#11307)
* UIManager: Init a full Geom on region-less refreshes in _refresh
* Never call refreshFull with no arguments
  I got rid of the low-level nil guards, because UIManager itself guarantees that it can never happen
* Bump base (https://github.com/koreader/koreader-base/pull/1718) (fix #11303)
* Kindle: Re-enable HW dithering on the Scribe
  Now that the underlying issue is fixed in base ;).
8 months ago
NiLuJe 18c17829b7
Input: Simplify input slot storage alloc (#11296)
* Input: Harden setCurrentMtSlotChecked
  The current implementation was assuming that the only case where we
  might be missing slot storage was for the *first* contact point,
  given that ABS_MT_SLOT is (if all goes well) guaranteed to be present
  and come first for every subsequent additional contact points.
  While this works just fine in practice, we can simplify and generalize
  the check by just checking if we've actually recorded the requested
  slot, even if it's not the first contact point.
  The hit check is possibly ever so slightly faster than the length
  computation, to boot.
* Input: Handle snow_protocol devices with newer hardware revisions that do *NOT* need the snow quirks.
  If a sane input frame is detected, the snow quirks will be disabled at runtime, ensuring sane behavior.
  Given the extremely non-standard behavior of the snow quirks, this is fairly easy to detect,
  as a snow device will *never* emit EV_ABS:ABS_MT_TRACKING_ID:-1, so if we catch one, it's not snow ;).
  (We've had reports of this on a Clara HD, FWIW)
8 months ago
zwim 2c33fc6576
Reader: Do less work on same-orientation non-gyro rotations (#11297)
Namely, don't recompute layouts, as they do not change.
(The gyro codepaths were already doing something similar.)

* Keep ConfigDialog, FileManagerMenu & ReaderMenu open on rotation.
  (In practice, only ConfigDialog is affected, as *Menu doesn't handle the rotation event.)
* Plugged an instance leak in the aforementioned Menu classes.
* Unify behavior & code with the gyro codepaths.
8 months ago
mergen3107 4a9473ed45
Kindle Oasis 1,2,3, Scribe: fix startup orientation (#11277)
Closes #11269
8 months ago
NiLuJe 4a15dce3e4 Kindle: Disable HW dithering on Scribe
Pending the actual fix from
https://github.com/koreader/koreader-base/pull/1718 that'll hit after
the release.
8 months ago
Mihai Vasiliu 5d2a441064
Add viewport for PB743K3 (#11302)
The bezel covers a couple of pixels of the screen, so adjust not to show content under the bezel.
9 months ago
mergen3107 63329569eb
[android] toggle warmth on onyx devices (#11275) 9 months ago
mergen3107 6c85547ce6
Add HW dither on Kindle Scribe (#11292) 9 months ago
mergen3107 4c2fc1eb81
Kindle Scribe: fix touch input (#11285) 9 months ago
NiLuJe 33b54f5574
Kindle: Add a hasLightSensor devcap, and use it in the AutoFrontlight plugin (#11255)
Add the Scribe to the list while we're there
9 months ago
zwim c30c1ff11f DeviceListener: Rejig calculateGestureDelta algorithm
Get rid of the silly precomputed tables, and do More Maths(TM) instead!
Thanks to @zwim for the magic sauce ;).

Minor simplification of the API while I'm in there, and unify the warmth
computations, do everything in the native scale (much like what
effectively happens for intensity) to workaround the silly public API
being an unhelpful PITA, ensuring consistent & effective changes.
9 months ago
NiLuJe a2e0642998 Cervantes: Make sure the warmth scaling is accurate
For some mysterious reason, we init fl_warmth_max to 100 on Kobo &
Cervantes, despite this being the case on absolutely none of them.

TL;DR: We update it according to nl_max during init, but this was
missing on Cervantes.
9 months ago
NiLuJe ff58ac7a65 DeviceListener: Handle non-gesture warmth increment in the native scale
Re: #11220
Followup to #6468
9 months ago
Frans de Jonge 13a521c398
AppImage: remove hasMultiTouch = no (#11212)
SDL supports multitouch since https://github.com/koreader/koreader-base/pull/1599
10 months ago
NiLuJe 18fff200ac GestureDetector: Be even *more* defensive with initial_tev records
Apparently, #11198 wasn't defensive enough...

Make those visible warnings, so we can see how much they actually happen
in the wild...

Closes #11209
10 months ago