[Scummvm-git-logs] scummvm master -> 057bb00950cd8f289d029d9007e07d5b3abbf488
lephilousophe
noreply at scummvm.org
Fri Nov 15 17:23:52 UTC 2024
This automated email contains information about 2 new commits which have been
pushed to the 'scummvm' repo located at https://github.com/scummvm/scummvm .
Summary:
07e9c262d4 GUI: Fix redraw priorities
057bb00950 GUI: Properly redraw the saves list when called from the progress dialog
Commit: 07e9c262d430720d8577f20a7f223771c1b07e55
https://github.com/scummvm/scummvm/commit/07e9c262d430720d8577f20a7f223771c1b07e55
Author: Le Philousophe (lephilousophe at users.noreply.github.com)
Date: 2024-11-15T18:23:35+01:00
Commit Message:
GUI: Fix redraw priorities
Avoid erasing full redraw when requesting a top dialog redraw.
If two dialogs open immediately, request a full redraw to take both into
account.
Changed paths:
gui/gui-manager.cpp
diff --git a/gui/gui-manager.cpp b/gui/gui-manager.cpp
index a46ad7d6b7a..35b2ce4ff11 100644
--- a/gui/gui-manager.cpp
+++ b/gui/gui-manager.cpp
@@ -737,6 +737,10 @@ void GuiManager::openDialog(Dialog *dialog) {
getTopDialog()->lostFocus();
_dialogStack.push(dialog);
+ // We were already ready to redraw a new dialog
+ // Redraw fully to ensure a proper draw of the whole stack
+ if (_redrawStatus == kRedrawOpenDialog)
+ _redrawStatus = kRedrawFull;
if (_redrawStatus != kRedrawFull)
_redrawStatus = kRedrawOpenDialog;
@@ -908,7 +912,10 @@ void GuiManager::processEvent(const Common::Event &event, Dialog *const activeDi
void GuiManager::scheduleTopDialogRedraw() {
// Open/Close dialog redraws have higher priority, otherwise they may not be processed at all
- if (_redrawStatus != kRedrawOpenDialog && _redrawStatus != kRedrawCloseDialog)
+ // Full redraw also has higher priority
+ if (_redrawStatus != kRedrawOpenDialog &&
+ _redrawStatus != kRedrawCloseDialog &&
+ _redrawStatus != kRedrawFull)
_redrawStatus = kRedrawTopDialog;
}
Commit: 057bb00950cd8f289d029d9007e07d5b3abbf488
https://github.com/scummvm/scummvm/commit/057bb00950cd8f289d029d9007e07d5b3abbf488
Author: Le Philousophe (lephilousophe at users.noreply.github.com)
Date: 2024-11-15T18:23:35+01:00
Commit Message:
GUI: Properly redraw the saves list when called from the progress dialog
When the SaveLoadCloudSyncProgressDialog dialog is displayed, the top
dialog is not the saveload dialog anymore.
In this case, a full redraw is needed for proper display.
Changed paths:
gui/saveload-dialog.cpp
gui/saveload-dialog.h
diff --git a/gui/saveload-dialog.cpp b/gui/saveload-dialog.cpp
index fffd561a012..a7795956ba0 100644
--- a/gui/saveload-dialog.cpp
+++ b/gui/saveload-dialog.cpp
@@ -134,7 +134,7 @@ void SaveLoadCloudSyncProgressDialog::pollCloudMan() {
_progressBar->markAsDirty();
if (_parent) {
- _parent->updateSaveList();
+ _parent->updateSaveList(true);
_parent->reflowLayout();
}
}
@@ -284,7 +284,7 @@ void SaveLoadChooserDialog::handleTickle() {
}
}
_dialogWasShown = true;
- updateSaveList();
+ updateSaveList(false);
}
}
@@ -316,7 +316,7 @@ void SaveLoadChooserDialog::reflowLayout() {
Dialog::reflowLayout();
}
-void SaveLoadChooserDialog::updateSaveList() {
+void SaveLoadChooserDialog::updateSaveList(bool external) {
#if defined(USE_CLOUD) && defined(USE_LIBCURL)
Common::Array<Common::String> files = CloudMan.getSyncingFiles(); //returns empty array if not syncing
g_system->getSavefileManager()->updateSavefilesList(files);
@@ -422,7 +422,7 @@ void SaveLoadChooserDialog::pollCloudMan() {
}
if (update)
- updateSaveList();
+ updateSaveList(false);
}
#endif
@@ -482,7 +482,7 @@ int SaveLoadChooserSimple::runIntern() {
_resultString.clear();
reflowLayout();
- updateSaveList();
+ updateSaveList(false);
return Dialog::runModal();
}
@@ -543,7 +543,7 @@ void SaveLoadChooserSimple::handleCommand(CommandSender *sender, uint32 cmd, uin
if (_metaEngine->removeSaveState(_target.c_str(), saveSlot)) {
setResult(-1);
int scrollPos = _list->getCurrentScrollPos();
- updateSaveList(); // resets scroll pos
+ updateSaveList(false); // resets scroll pos
_list->scrollTo(scrollPos);
updateSelection(true);
} else {
@@ -741,8 +741,8 @@ void SaveLoadChooserSimple::close() {
SaveLoadChooserDialog::close();
}
-void SaveLoadChooserSimple::updateSaveList() {
- SaveLoadChooserDialog::updateSaveList();
+void SaveLoadChooserSimple::updateSaveList(bool external) {
+ SaveLoadChooserDialog::updateSaveList(external);
int curSlot = 0;
int saveSlot = 0;
@@ -807,7 +807,11 @@ void SaveLoadChooserSimple::updateSaveList() {
else
_chooseButton->setEnabled(false);
- g_gui.scheduleTopDialogRedraw();
+ if (external) {
+ g_gui.scheduleFullRedraw();
+ } else {
+ g_gui.scheduleTopDialogRedraw();
+ }
}
// SaveLoadChooserGrid implementation
@@ -904,10 +908,14 @@ void SaveLoadChooserGrid::handleMouseWheel(int x, int y, int direction) {
}
}
-void SaveLoadChooserGrid::updateSaveList() {
- SaveLoadChooserDialog::updateSaveList();
+void SaveLoadChooserGrid::updateSaveList(bool external) {
+ SaveLoadChooserDialog::updateSaveList(external);
updateSaves();
- g_gui.scheduleTopDialogRedraw();
+ if (external) {
+ g_gui.scheduleFullRedraw();
+ } else {
+ g_gui.scheduleTopDialogRedraw();
+ }
}
void SaveLoadChooserGrid::open() {
diff --git a/gui/saveload-dialog.h b/gui/saveload-dialog.h
index 47a0612e38e..96552a287e6 100644
--- a/gui/saveload-dialog.h
+++ b/gui/saveload-dialog.h
@@ -100,7 +100,7 @@ protected:
virtual int runIntern() = 0;
/** Common function to refresh the list on the screen. */
- virtual void updateSaveList();
+ virtual void updateSaveList(bool external);
/**
* Common function to get saves list from MetaEngine.
@@ -162,7 +162,7 @@ public:
void open() override;
void close() override;
protected:
- void updateSaveList() override;
+ void updateSaveList(bool external) override;
private:
int runIntern() override;
@@ -219,7 +219,7 @@ public:
protected:
void handleCommand(CommandSender *sender, uint32 cmd, uint32 data) override;
void handleMouseWheel(int x, int y, int direction) override;
- void updateSaveList() override;
+ void updateSaveList(bool external) override;
private:
int runIntern() override;
More information about the Scummvm-git-logs
mailing list