W10 double window fix (#13074)

Co-authored-by: Rodrigo Faselli <162915171+RF47@users.noreply.github.com>
This commit is contained in:
Ian Bassi
2026-04-20 19:27:38 -03:00
committed by GitHub
parent bfb70c598c
commit f70d30bf79
4 changed files with 38 additions and 5 deletions

View File

@@ -772,7 +772,7 @@ wxAuiToolBarItem* BBLTopbar::FindToolByCurrentPosition()
return this->FindToolByPosition(client_pos.x, client_pos.y);
}
#ifdef __WIN32__
#ifdef __WXMSW__
WXLRESULT CenteredTitle::MSWWindowProc(WXUINT nMsg, WXWPARAM wParam, WXLPARAM lParam)
{
switch (nMsg) {

View File

@@ -19,7 +19,7 @@ public:
wxSize DoGetBestSize() const override;
protected:
#ifdef __WIN32__
#ifdef __WXMSW__
WXLRESULT MSWWindowProc(WXUINT nMsg, WXWPARAM wParam, WXLPARAM lParam) override;
#endif
@@ -75,7 +75,7 @@ public:
void ShowCalibrationButton(bool show = true);
protected:
#ifdef __WIN32__
#ifdef __WXMSW__
WXLRESULT MSWWindowProc(WXUINT nMsg, WXWPARAM wParam, WXLPARAM lParam) override;
#endif

View File

@@ -310,6 +310,17 @@ DPIFrame(NULL, wxID_ANY, "", wxDefaultPosition, wxDefaultSize, BORDERLESS_FRAME_
m_edge_right = new ResizeEdgePanel(this, ResizeEdgePanel::Right);
#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")) {
wxGetApp().app_config->set("user_mode", "simple");
wxGetApp().app_config->set_bool("developer_mode", false);
@@ -524,6 +535,28 @@ DPIFrame(NULL, wxID_ANY, "", wxDefaultPosition, wxDefaultSize, BORDERLESS_FRAME_
update_layout();
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
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)
// Adopted from https://gist.github.com/MortenChristiansen/6463580

View File

@@ -204,7 +204,7 @@ protected:
virtual void on_dpi_changed(const wxRect &suggested_rect) override;
virtual void on_sys_color_changed() override;
#ifdef __WIN32__
#ifdef __WXMSW__
WXLRESULT MSWWindowProc(WXUINT nMsg, WXWPARAM wParam, WXLPARAM lParam) override;
#endif