Merge pull request #81 from jpirnay/fix-ghosting-regression

fix: ghosting regression when opening subactivity from within reader
This commit is contained in:
jpirnay
2026-04-15 10:33:28 +02:00
committed by GitHub
5 changed files with 5 additions and 8 deletions
@@ -218,6 +218,7 @@ void EpubReaderActivity::loop() {
const int bookProgressPercent = clampPercent(static_cast<int>(bookProgress + 0.5f)); const int bookProgressPercent = clampPercent(static_cast<int>(bookProgress + 0.5f));
const bool isCurrentPageStarred = section && bookmarkStore.has(static_cast<uint16_t>(currentSpineIndex), const bool isCurrentPageStarred = section && bookmarkStore.has(static_cast<uint16_t>(currentSpineIndex),
static_cast<uint16_t>(section->currentPage)); static_cast<uint16_t>(section->currentPage));
ReaderUtils::enforceExitFullRefresh(renderer);
startActivityForResult( startActivityForResult(
std::make_unique<EpubReaderMenuActivity>( std::make_unique<EpubReaderMenuActivity>(
renderer, mappedInput, epub->getTitle(), currentPage, totalPages, bookProgressPercent, SETTINGS.orientation, renderer, mappedInput, epub->getTitle(), currentPage, totalPages, bookProgressPercent, SETTINGS.orientation,
@@ -263,6 +264,7 @@ void EpubReaderActivity::loop() {
if (currentPageFootnotes.size() == 1) { if (currentPageFootnotes.size() == 1) {
navigateToHref(currentPageFootnotes[0].href, true); navigateToHref(currentPageFootnotes[0].href, true);
} else if (currentPageFootnotes.size() > 1) { } else if (currentPageFootnotes.size() > 1) {
ReaderUtils::enforceExitFullRefresh(renderer);
startActivityForResult(std::make_unique<EpubReaderFootnotesActivity>(renderer, mappedInput, currentPageFootnotes), startActivityForResult(std::make_unique<EpubReaderFootnotesActivity>(renderer, mappedInput, currentPageFootnotes),
[this](const ActivityResult& result) { [this](const ActivityResult& result) {
if (!result.isCancelled) { if (!result.isCancelled) {
@@ -1,7 +1,6 @@
#include "EpubReaderMenuActivity.h" #include "EpubReaderMenuActivity.h"
#include <GfxRenderer.h> #include <GfxRenderer.h>
#include <HalGPIO.h>
#include <I18n.h> #include <I18n.h>
#include "KOReaderCredentialStore.h" #include "KOReaderCredentialStore.h"
@@ -234,10 +233,5 @@ void EpubReaderMenuActivity::render(RenderLock&&) {
const auto labels = mappedInput.mapLabels(tr(STR_BACK), tr(STR_SELECT), tr(STR_DIR_UP), tr(STR_DIR_DOWN)); const auto labels = mappedInput.mapLabels(tr(STR_BACK), tr(STR_SELECT), tr(STR_DIR_UP), tr(STR_DIR_DOWN));
GUI.drawButtonHints(renderer, labels.btn1, labels.btn2, labels.btn3, labels.btn4); GUI.drawButtonHints(renderer, labels.btn1, labels.btn2, labels.btn3, labels.btn4);
if (gpio.deviceIsX3() && !initialHalfRefreshDone) { renderer.displayBuffer();
initialHalfRefreshDone = true;
renderer.displayBuffer(HalDisplay::HALF_REFRESH);
} else {
renderer.displayBuffer();
}
} }
@@ -62,7 +62,6 @@ class EpubReaderMenuActivity final : public MenuListActivity {
int8_t pendingEmbeddedStyleOverride = -1; int8_t pendingEmbeddedStyleOverride = -1;
int8_t pendingImageRenderingOverride = -1; int8_t pendingImageRenderingOverride = -1;
uint8_t pendingTextDarkness = 1; uint8_t pendingTextDarkness = 1;
bool initialHalfRefreshDone = false;
static constexpr const char* pageTurnLabels[] = {"", "1", "3", "6", "12"}; static constexpr const char* pageTurnLabels[] = {"", "1", "3", "6", "12"};
@@ -162,6 +162,7 @@ void TxtReaderActivity::loop() {
// Open starred pages list via Confirm button // Open starred pages list via Confirm button
if (mappedInput.wasReleased(MappedInputManager::Button::Confirm) && !bookmarkStore.isEmpty()) { if (mappedInput.wasReleased(MappedInputManager::Button::Confirm) && !bookmarkStore.isEmpty()) {
ReaderUtils::enforceExitFullRefresh(renderer);
startActivityForResult(std::make_unique<StarredPagesActivity>(renderer, mappedInput, bookmarkStore), startActivityForResult(std::make_unique<StarredPagesActivity>(renderer, mappedInput, bookmarkStore),
[this](const ActivityResult& result) { [this](const ActivityResult& result) {
if (!result.isCancelled) { if (!result.isCancelled) {
@@ -69,6 +69,7 @@ void XtcReaderActivity::loop() {
// Enter chapter selection activity // Enter chapter selection activity
if (mappedInput.wasReleased(MappedInputManager::Button::Confirm)) { if (mappedInput.wasReleased(MappedInputManager::Button::Confirm)) {
if (xtc && xtc->hasChapters() && !xtc->getChapters().empty()) { if (xtc && xtc->hasChapters() && !xtc->getChapters().empty()) {
ReaderUtils::enforceExitFullRefresh(renderer);
startActivityForResult( startActivityForResult(
std::make_unique<XtcReaderChapterSelectionActivity>(renderer, mappedInput, xtc, currentPage), std::make_unique<XtcReaderChapterSelectionActivity>(renderer, mappedInput, xtc, currentPage),
[this](const ActivityResult& result) { [this](const ActivityResult& result) {