Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove window restoration correction routine #791

Merged
merged 1 commit into from
Dec 19, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions src/myframe.h
Original file line number Diff line number Diff line change
Expand Up @@ -695,6 +695,10 @@ struct MyFrame : wxFrame {
sys->cfg->Read(L"resy", &resy, defy);
sys->cfg->Read(L"posx", &posx, boundary + disprect.x);
sys->cfg->Read(L"posy", &posy, boundary + disprect.y);
#ifndef __WXGTK__
// On X11, disprect only refers to the primary screen. Thus, for a multi-head display,
// the conditions below might be fulfilled (e.g. large window spanning multiple screens
// or being on the secondary screen), so just ignore them.
if (resx > disprect.width || resy > disprect.height || posx < disprect.x ||
posy < disprect.y || posx + resx > disprect.width + disprect.x ||
posy + resy > disprect.height + disprect.y) {
Expand All @@ -706,6 +710,7 @@ struct MyFrame : wxFrame {
posx += disprect.x;
posy += disprect.y;
}
#endif
SetSize(resx, resy);
SetPosition(wxPoint(posx, posy));

Expand Down
Loading