Skip to content

Fix/floating repeated size request#3538

Open
higorprado wants to merge 3 commits intoniri-wm:mainfrom
higorprado:fix/floating-repeated-size-request
Open

Fix/floating repeated size request#3538
higorprado wants to merge 3 commits intoniri-wm:mainfrom
higorprado:fix/floating-repeated-size-request

Conversation

@higorprado
Copy link

Summary

  • Fix a floating request_size_once() case where a repeated same-size request could be dropped after a stale commit.
  • Skip redundant floating configure requests when the requested concrete size already matches the committed window size.
  • Preserve interactive-move behavior (no regression).

Behavior Changes

  • tests::floating::repeated_size_request:
    • before: last same-size request after commit could produce no configure
    • after: configure is re-sent correctly
  • tests::floating::resize_to_same_size:
    • before: redundant configure could be sent even when size already matched
    • after: no configure is sent

Validation

  • Floating test module passes, including:
    • repeated_size_request
    • resize_to_same_size
    • resize_to_different_then_same
    • resize_during_interactive_move_propagates_to_floating

let win_height = ensure_min_max_size(win_height, min_size.h, max_size.h);

let win_size = Size::from((win_width, win_height));
if win_size.w > 0

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

IMHO because of how many conditions are in this block, a comment would go a long way to aiding readability e.g.

// Skip redundant request when window already matches size
if win_size.w > 0
// ...

In general, as a newcomer to this codebase, it's not clear to me why we would need to skip it. Whether or not it's worth a mention in the comment I would leave to you, it may be obvious to maintainers.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for your review. I refactored that predicate into should_skip_redundant_size_request() and added a comment explaining the intent. The skip is only for the case where the floating window already has the requested concrete size and there isn’t another pending state change that still needs a configure; that avoids redundant same-size configures, but still allows the request to be re-sent after a stale commit.

let win_width = ensure_min_max_size(win_width, min_size.w, max_size.w);

let win_size = Size::from((win_width, win_height));
if win_size.w > 0

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As above, could do with a comment e.g.
// Skip redundant request when window already matches size

@Sempyos Sempyos added the area:layout Columns, workspaces, scrolling, fullscreen, resize label Mar 11, 2026
Copy link

@ChrisPWill ChrisPWill left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, thanks! The intent is much clearer to me now

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area:layout Columns, workspaces, scrolling, fullscreen, resize

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants