mirror of
https://github.com/OrcaSlicer/OrcaSlicer.git
synced 2026-05-17 02:22:17 +00:00
FIX: protect the EndModal functions while top dialog is not this one.
jira: [STUDIO-11503] [STUDIO-11522] Change-Id: I02bf784fa7c796a75525deb79f8287027780bc69 (cherry picked from commit d74a9ac286654bc8b4bec1e27d02a2d578f8b12c)
This commit is contained in:
@@ -7,6 +7,7 @@
|
||||
#include <functional>
|
||||
|
||||
#include <boost/optional.hpp>
|
||||
#include <boost/log/trivial.hpp>
|
||||
|
||||
#include <wx/frame.h>
|
||||
#include <wx/dialog.h>
|
||||
@@ -320,7 +321,26 @@ private:
|
||||
};
|
||||
|
||||
typedef DPIAware<wxFrame> DPIFrame;
|
||||
typedef DPIAware<wxDialog> DPIDialog;
|
||||
class DPIDialog : public DPIAware<wxDialog>
|
||||
{
|
||||
public:
|
||||
using DPIAware<wxDialog>::DPIAware;
|
||||
|
||||
public:
|
||||
void EndModal(int retCode) override
|
||||
{
|
||||
if (!dialogStack.empty() && dialogStack.front() != this) {
|
||||
// This is a bug in wxWidgets
|
||||
// when the dialog is not top modal dialog, EndModal() just hide dialog without quit
|
||||
// the modal event loop. And the modal event loop blocks us from bottom widgets.
|
||||
// Solution: let user click it manually or close outside. FIXME
|
||||
BOOST_LOG_TRIVIAL(warning) << "DPIAware::EndModal Error: dialogStack is not empty, but top dialog is not this one. retCode=" << retCode;
|
||||
return;
|
||||
}
|
||||
|
||||
return wxDialog::EndModal(retCode);
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
class EventGuard
|
||||
|
||||
Reference in New Issue
Block a user