Skip to content

Commit

Permalink
FarGroupgh-854: Windows 10 32-bit crash.
Browse files Browse the repository at this point in the history
A relatively large value of Layout.WidthDecrement, persisted into the config,
could cause havoc after rerunning with a smaller window size
  • Loading branch information
alabuzhev committed Jul 8, 2024
1 parent 723536d commit 45384f5
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 10 deletions.
7 changes: 7 additions & 0 deletions far/changelog
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
--------------------------------------------------------------------------------
drkns 2024-07-08 22:55:36+01:00 - build 6345

1. gh-854: Windows 10 32-bit crash.
A relatively large value of Layout.WidthDecrement, persisted into the config,
could cause havoc after rerunning with a smaller window size.

--------------------------------------------------------------------------------
drkns 2024-06-26 18:12:34+01:00 - build 6344

Expand Down
11 changes: 2 additions & 9 deletions far/filepanels.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -222,15 +222,8 @@ void FilePanels::Init()

void FilePanels::SetPanelPositions(bool LeftFullScreen, bool RightFullScreen) const
{
if (const auto MaxWidth = ScrX / 2; MaxWidth > 10)
{
if (Global->Opt->WidthDecrement < -MaxWidth)
Global->Opt->WidthDecrement = -MaxWidth;

if (Global->Opt->WidthDecrement > MaxWidth)
Global->Opt->WidthDecrement = MaxWidth;
}

const auto AbsMaxWidthDecrement = std::max(0ll, ScrX / 2 - 10ll);
Global->Opt->WidthDecrement = std::max(-AbsMaxWidthDecrement, std::min(Global->Opt->WidthDecrement.Get(), AbsMaxWidthDecrement));
Global->Opt->LeftHeightDecrement = std::max(0ll, std::min(Global->Opt->LeftHeightDecrement.Get(), ScrY - 7ll));
Global->Opt->RightHeightDecrement = std::max(0ll, std::min(Global->Opt->RightHeightDecrement.Get(), ScrY - 7ll));

Expand Down
2 changes: 1 addition & 1 deletion far/vbuild.m4
Original file line number Diff line number Diff line change
@@ -1 +1 @@
6344
6345

0 comments on commit 45384f5

Please sign in to comment.