Skip to content

Commit

Permalink
Remove some checks leading to default values
Browse files Browse the repository at this point in the history
Large TreeSheets window on a secondary screen satisifes
`posx + resx > disprect.width + disprect.x` on X11
because `disprect` only refers to the primary screen.

Example:
```
(gdb) p posx
$6 = 2688
(gdb) p resx
$7 = 2432
(gdb) p disprect.width
$8 = 2560
(gdb) p disprect.x
$9 = 0
```
  • Loading branch information
tobiolo committed Dec 19, 2024
1 parent 9dfc4fb commit b0c2b7a
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions src/myframe.h
Original file line number Diff line number Diff line change
Expand Up @@ -696,8 +696,13 @@ struct MyFrame : wxFrame {
sys->cfg->Read(L"posx", &posx, boundary + disprect.x);
sys->cfg->Read(L"posy", &posy, boundary + disprect.y);
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) {
posy < disprect.y
#ifndef __WXGTK__
// On X11 platforms, disprect only refers to the primary screen
|| posx + resx > disprect.width + disprect.x
|| posy + resy > disprect.height + disprect.y
#endif
) {
// Screen res has been resized since we last ran, set sizes to default to avoid being
// off-screen.
resx = defx;
Expand Down

0 comments on commit b0c2b7a

Please sign in to comment.