FIX:fixed crash when creat projecy in full screen mode on mac

Change-Id: I029bf52e805d699a5d6de4e3a049954b09e58255
This commit is contained in:
tao wang 2022-10-09 15:48:55 +08:00 committed by Lane.Wei
parent fd0f22b771
commit e325214cb6
4 changed files with 47 additions and 7 deletions

View file

@ -198,6 +198,25 @@ DPIFrame(NULL, wxID_ANY, "", wxDefaultPosition, wxDefaultSize, BORDERLESS_FRAME_
// Font is already set in DPIFrame constructor
*/
#ifdef __APPLE__
m_reset_title_text_colour_timer = new wxTimer();
m_reset_title_text_colour_timer->SetOwner(this);
Bind(wxEVT_TIMER, [this](auto& e) {
set_title_colour_after_set_title(GetHandle());
m_reset_title_text_colour_timer->Stop();
});
this->Bind(wxEVT_FULLSCREEN, [this](wxFullScreenEvent& e) {
set_tag_when_enter_full_screen(e.IsFullScreen());
if (!e.IsFullScreen()) {
if (m_reset_title_text_colour_timer) {
m_reset_title_text_colour_timer->Stop();
m_reset_title_text_colour_timer->Start(500);
}
}
e.Skip();
});
#endif
#ifdef __APPLE__
// Initialize the docker task bar icon.
switch (wxGetApp().get_app_mode()) {
@ -766,8 +785,8 @@ void MainFrame::update_title()
void MainFrame::update_title_colour_after_set_title()
{
#ifdef __WXOSX__
set_title_colour_after_set_title();
#ifdef __APPLE__
set_title_colour_after_set_title(GetHandle());
#endif
}