Skip to content

Commit

Permalink
Fix windows resizing after being moved
Browse files Browse the repository at this point in the history
revert `457b000e682bd00ed62c28023107b0dc71d57ae0`
  • Loading branch information
PixelDoted committed Oct 6, 2023
1 parent 457b000 commit 12067d8
Showing 1 changed file with 5 additions and 12 deletions.
17 changes: 5 additions & 12 deletions src/shell/layout/floating/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -104,18 +104,14 @@ impl FloatingLayout {

if let Some(size) = last_geometry.map(|g| g.size) {
win_geo.size = size;
}
{
} else {
let (min_size, max_size) = (
mapped.min_size().unwrap_or((0, 0).into()),
mapped.max_size().unwrap_or((0, 0).into()),
);
if win_geo.size.w > max_size.w
|| win_geo.size.w < min_size.w
|| win_geo.size.w > geometry.size.w
{
if win_geo.size.w > geometry.size.w / 3 * 2 {
// try a more reasonable size
let mut width = win_geo.size.w;
let mut width = geometry.size.w / 3 * 2;
if max_size.w != 0 {
// don't go larger then the max_size ...
width = std::cmp::min(max_size.w, width);
Expand All @@ -127,12 +123,9 @@ impl FloatingLayout {
// but no matter the supported sizes, don't be larger than our non-exclusive-zone
win_geo.size.w = std::cmp::min(width, geometry.size.w);
}
if win_geo.size.h > max_size.h
|| win_geo.size.h < min_size.h
|| win_geo.size.h > geometry.size.h
{
if win_geo.size.h > geometry.size.h / 3 * 2 {
// try a more reasonable size
let mut height = win_geo.size.h;
let mut height = geometry.size.h / 3 * 2;
if max_size.h != 0 {
// don't go larger then the max_size ...
height = std::cmp::min(max_size.h, height);
Expand Down

0 comments on commit 12067d8

Please sign in to comment.