Skip to content

Commit

Permalink
Remove position and size check for GTK (#791)
Browse files Browse the repository at this point in the history
On X11, the display rectangle is only reported for the primary display.
This causes the reset to default values for multiple use cases on
multi-head displays. Thus just ignore the checks for GTK.
  • Loading branch information
tobiolo authored Dec 19, 2024
1 parent 9dfc4fb commit 0762513
Showing 1 changed file with 5 additions and 0 deletions.
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

0 comments on commit 0762513

Please sign in to comment.