mirror of
https://github.com/OrcaSlicer/OrcaSlicer.git
synced 2026-05-19 11:23:42 +00:00
W10 double window fix (#13074)
Co-authored-by: Rodrigo Faselli <162915171+RF47@users.noreply.github.com>
This commit is contained in:
@@ -772,7 +772,7 @@ wxAuiToolBarItem* BBLTopbar::FindToolByCurrentPosition()
|
|||||||
return this->FindToolByPosition(client_pos.x, client_pos.y);
|
return this->FindToolByPosition(client_pos.x, client_pos.y);
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef __WIN32__
|
#ifdef __WXMSW__
|
||||||
WXLRESULT CenteredTitle::MSWWindowProc(WXUINT nMsg, WXWPARAM wParam, WXLPARAM lParam)
|
WXLRESULT CenteredTitle::MSWWindowProc(WXUINT nMsg, WXWPARAM wParam, WXLPARAM lParam)
|
||||||
{
|
{
|
||||||
switch (nMsg) {
|
switch (nMsg) {
|
||||||
|
|||||||
@@ -19,7 +19,7 @@ public:
|
|||||||
wxSize DoGetBestSize() const override;
|
wxSize DoGetBestSize() const override;
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
#ifdef __WIN32__
|
#ifdef __WXMSW__
|
||||||
WXLRESULT MSWWindowProc(WXUINT nMsg, WXWPARAM wParam, WXLPARAM lParam) override;
|
WXLRESULT MSWWindowProc(WXUINT nMsg, WXWPARAM wParam, WXLPARAM lParam) override;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
@@ -75,7 +75,7 @@ public:
|
|||||||
void ShowCalibrationButton(bool show = true);
|
void ShowCalibrationButton(bool show = true);
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
#ifdef __WIN32__
|
#ifdef __WXMSW__
|
||||||
WXLRESULT MSWWindowProc(WXUINT nMsg, WXWPARAM wParam, WXLPARAM lParam) override;
|
WXLRESULT MSWWindowProc(WXUINT nMsg, WXWPARAM wParam, WXLPARAM lParam) override;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|||||||
@@ -310,6 +310,17 @@ DPIFrame(NULL, wxID_ANY, "", wxDefaultPosition, wxDefaultSize, BORDERLESS_FRAME_
|
|||||||
m_edge_right = new ResizeEdgePanel(this, ResizeEdgePanel::Right);
|
m_edge_right = new ResizeEdgePanel(this, ResizeEdgePanel::Right);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#ifdef __WXMSW__
|
||||||
|
if (HWND hWnd = GetHandle(); hWnd != nullptr) {
|
||||||
|
LONG_PTR style = GetWindowLongPtr(hWnd, GWL_STYLE);
|
||||||
|
if ((style & WS_CAPTION) != 0) {
|
||||||
|
SetWindowLongPtr(hWnd, GWL_STYLE, style & ~WS_CAPTION);
|
||||||
|
SetWindowPos(hWnd, nullptr, 0, 0, 0, 0,
|
||||||
|
SWP_NOACTIVATE | SWP_NOMOVE | SWP_NOSIZE | SWP_NOZORDER | SWP_FRAMECHANGED);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
if (!wxGetApp().app_config->has("user_mode")) {
|
if (!wxGetApp().app_config->has("user_mode")) {
|
||||||
wxGetApp().app_config->set("user_mode", "simple");
|
wxGetApp().app_config->set("user_mode", "simple");
|
||||||
wxGetApp().app_config->set_bool("developer_mode", false);
|
wxGetApp().app_config->set_bool("developer_mode", false);
|
||||||
@@ -524,6 +535,28 @@ DPIFrame(NULL, wxID_ANY, "", wxDefaultPosition, wxDefaultSize, BORDERLESS_FRAME_
|
|||||||
update_layout();
|
update_layout();
|
||||||
sizer->SetSizeHints(this);
|
sizer->SetSizeHints(this);
|
||||||
|
|
||||||
|
#ifdef __WXMSW__
|
||||||
|
// SetMaximize causes the window to overlap the taskbar, due to the fact this window has wxMAXIMIZE_BOX off
|
||||||
|
// https://forums.wxwidgets.org/viewtopic.php?t=50634
|
||||||
|
// Fix it here
|
||||||
|
this->Bind(wxEVT_MAXIMIZE, [this](auto &e) {
|
||||||
|
wxDisplay display(this);
|
||||||
|
auto size = display.GetClientArea().GetSize();
|
||||||
|
auto pos = display.GetClientArea().GetPosition();
|
||||||
|
HWND hWnd = GetHandle();
|
||||||
|
RECT borderThickness;
|
||||||
|
SetRectEmpty(&borderThickness);
|
||||||
|
AdjustWindowRectEx(&borderThickness, GetWindowLongPtr(hWnd, GWL_STYLE), FALSE, 0);
|
||||||
|
const auto max_size = size + wxSize{-borderThickness.left + borderThickness.right, -borderThickness.top + borderThickness.bottom};
|
||||||
|
const auto current_size = GetSize();
|
||||||
|
SetSize({std::min(max_size.x, current_size.x), std::min(max_size.y, current_size.y)});
|
||||||
|
Move(pos + wxPoint{borderThickness.left, borderThickness.top});
|
||||||
|
e.Skip();
|
||||||
|
});
|
||||||
|
|
||||||
|
#endif // __WXMSW__
|
||||||
|
|
||||||
|
|
||||||
// BBS
|
// BBS
|
||||||
Fit();
|
Fit();
|
||||||
|
|
||||||
@@ -760,7 +793,7 @@ void MainFrame::bind_diff_dialog()
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
#ifdef __WIN32__
|
#ifdef __WXMSW__
|
||||||
|
|
||||||
// Orca: Fix maximized window overlaps taskbar when taskbar auto hide is enabled (#8085)
|
// Orca: Fix maximized window overlaps taskbar when taskbar auto hide is enabled (#8085)
|
||||||
// Adopted from https://gist.github.com/MortenChristiansen/6463580
|
// Adopted from https://gist.github.com/MortenChristiansen/6463580
|
||||||
|
|||||||
@@ -204,7 +204,7 @@ protected:
|
|||||||
virtual void on_dpi_changed(const wxRect &suggested_rect) override;
|
virtual void on_dpi_changed(const wxRect &suggested_rect) override;
|
||||||
virtual void on_sys_color_changed() override;
|
virtual void on_sys_color_changed() override;
|
||||||
|
|
||||||
#ifdef __WIN32__
|
#ifdef __WXMSW__
|
||||||
WXLRESULT MSWWindowProc(WXUINT nMsg, WXWPARAM wParam, WXLPARAM lParam) override;
|
WXLRESULT MSWWindowProc(WXUINT nMsg, WXWPARAM wParam, WXLPARAM lParam) override;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user