mirror of
https://git.mirrors.martin98.com/https://github.com/bambulab/BambuStudio.git
synced 2025-08-13 18:46:03 +08:00
FIX: protect the EndModal functions while top dialog is not this one.
jira: [STUDIO-11503] [STUDIO-11522] Change-Id: I02bf784fa7c796a75525deb79f8287027780bc69
This commit is contained in:
parent
d73d45d892
commit
d74a9ac286
@ -7,6 +7,7 @@
|
|||||||
#include <functional>
|
#include <functional>
|
||||||
|
|
||||||
#include <boost/optional.hpp>
|
#include <boost/optional.hpp>
|
||||||
|
#include <boost/log/trivial.hpp>
|
||||||
|
|
||||||
#include <wx/frame.h>
|
#include <wx/frame.h>
|
||||||
#include <wx/dialog.h>
|
#include <wx/dialog.h>
|
||||||
@ -337,7 +338,26 @@ private:
|
|||||||
};
|
};
|
||||||
|
|
||||||
typedef DPIAware<wxFrame> DPIFrame;
|
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
|
class EventGuard
|
||||||
|
Loading…
x
Reference in New Issue
Block a user