From 645d843dd97949fb6a73e93fc61ffa4a255b20f3 Mon Sep 17 00:00:00 2001 From: "zhou.xu" Date: Tue, 25 Mar 2025 11:34:27 +0800 Subject: [PATCH] ENH:When software is full screen in mac, the sub frame uses the wxSTAYBON_TOP style jira: none Change-Id: I338576d77e61a436615e70372b4564c38be0c7dc --- src/slic3r/GUI/MainFrame.cpp | 5 ++++- src/slic3r/GUI/MainFrame.hpp | 9 +++++++-- src/slic3r/GUI/ReleaseNote.cpp | 7 ++++++- 3 files changed, 17 insertions(+), 4 deletions(-) diff --git a/src/slic3r/GUI/MainFrame.cpp b/src/slic3r/GUI/MainFrame.cpp index 44feec63a..16147407d 100644 --- a/src/slic3r/GUI/MainFrame.cpp +++ b/src/slic3r/GUI/MainFrame.cpp @@ -241,7 +241,10 @@ DPIFrame(NULL, wxID_ANY, "", wxDefaultPosition, wxDefaultSize, BORDERLESS_FRAME_ m_reset_title_text_colour_timer->Stop(); m_reset_title_text_colour_timer->Start(500); } - } + m_mac_fullscreen = false; + } else { + m_mac_fullscreen = true; + } auto int_event = new IntEvent(EVT_NOTICE_FULL_SCREEN_CHANGED, e.IsFullScreen() ? 1 : 0); wxQueueEvent(wxGetApp().plater(), int_event); e.Skip(); diff --git a/src/slic3r/GUI/MainFrame.hpp b/src/slic3r/GUI/MainFrame.hpp index ab4b96fd0..a8852e46c 100644 --- a/src/slic3r/GUI/MainFrame.hpp +++ b/src/slic3r/GUI/MainFrame.hpp @@ -91,7 +91,10 @@ protected: class MainFrame : public DPIFrame { - bool m_loaded {false}; +#ifdef __APPLE__ + bool m_mac_fullscreen{false}; +#endif + bool m_loaded {false}; wxTimer* m_reset_title_text_colour_timer{ nullptr }; wxString m_qs_last_input_file = wxEmptyString; @@ -204,7 +207,9 @@ protected: public: MainFrame(); ~MainFrame() = default; - +#ifdef __APPLE__ + bool get_mac_full_screen() { return m_mac_fullscreen; } +#endif //BBS GUI refactor enum TabPosition { diff --git a/src/slic3r/GUI/ReleaseNote.cpp b/src/slic3r/GUI/ReleaseNote.cpp index adb21f035..63a39012e 100644 --- a/src/slic3r/GUI/ReleaseNote.cpp +++ b/src/slic3r/GUI/ReleaseNote.cpp @@ -746,6 +746,11 @@ void SecondaryCheckDialog::update_text(wxString text) void SecondaryCheckDialog::on_show() { +#ifdef __APPLE__ + if (wxGetApp().mainframe && wxGetApp().mainframe->get_mac_full_screen()) { + SetWindowStyleFlag(GetWindowStyleFlag() | wxSTAY_ON_TOP); + } +#endif wxGetApp().UpdateFrameDarkUI(this); // recover button color wxMouseEvent evt_ok(wxEVT_LEFT_UP); @@ -754,7 +759,7 @@ void SecondaryCheckDialog::on_show() m_button_cancel->GetEventHandler()->ProcessEvent(evt_cancel); this->Show(); - //this->Raise(); + this->Raise(); } void SecondaryCheckDialog::on_hide()