Skip to content

Basic window manager cleanups#4669

Merged
AlanGriffiths merged 1 commit intomainfrom
basic-window-manager-cleanups
Feb 13, 2026
Merged

Basic window manager cleanups#4669
AlanGriffiths merged 1 commit intomainfrom
basic-window-manager-cleanups

Conversation

@tarek-y-ismail
Copy link
Contributor

Just some cleanups that I found while working on #4664 and don't quite fit there.

@tarek-y-ismail tarek-y-ismail self-assigned this Feb 6, 2026
@tarek-y-ismail tarek-y-ismail requested a review from a team as a code owner February 6, 2026 15:40
Copy link
Contributor

@AlanGriffiths AlanGriffiths left a comment

Choose a reason for hiding this comment

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

Sorry, don't have good suggestions: center_horizontally_with_clamp_left() is just as confusing and even longer

namespace
{
void clamp_left(Rectangle const& zone, Rectangle& rect)
void center_horizontally_in_zone(Rectangle const& zone, Rectangle& rect)
Copy link
Contributor

Choose a reason for hiding this comment

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

Isn't the new name also confusing? If rect is wider than zone the placement is not centered horizontally, but clamped to the left. (No, that isn't a defense of the old name.)

}

void clamp_top(Rectangle const& zone, Rectangle& rect)
void center_vertically_in_zone(Rectangle const& zone, Rectangle& rect)
Copy link
Contributor

Choose a reason for hiding this comment

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

Isn't the new name also confusing? If rect is taller than zone the placement is not centered vertically, but clamped to the top.

@tarek-y-ismail
Copy link
Contributor Author

tarek-y-ismail commented Feb 10, 2026

center_horizontally_with_clamp_left

I believe this would be okay with a comment explaining when it centers and when it clamps. What do you think?

Alternative: center_horizontally_or_align_left

@tarek-y-ismail tarek-y-ismail changed the title dBasic window manager cleanups Basic window manager cleanups Feb 10, 2026
Copy link
Contributor

@mattkae mattkae left a comment

Choose a reason for hiding this comment

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

A nit on my end, but all good otherwsie

@AlanGriffiths
Copy link
Contributor

center_horizontally_with_clamp_left

I believe this would be okay with a comment explaining when it centers and when it clamps. What do you think?

I don't have a better idea

@AlanGriffiths
Copy link
Contributor

Seems to have hung waiting on "documentation-checks / Run documentation checks" -I'm just gonna land it

@AlanGriffiths AlanGriffiths merged commit faf16fb into main Feb 13, 2026
35 of 44 checks passed
@AlanGriffiths AlanGriffiths deleted the basic-window-manager-cleanups branch February 13, 2026 17:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants