Skip to content

Conversation

@BobbyCannon
Copy link
Contributor

@BobbyCannon BobbyCannon commented Nov 14, 2025

What does the pull request do?

The current extend into client area on windows makes it very difficult to resize on the left, right, and bottom borders due to extending into the resize areas.

ExtendClientAreaToDecorationsHint="True"
ExtendClientAreaChromeHints="NoChrome"
ExtendClientAreaTitleBarHeightHint="32"

image

The arrow should be in "resize" mode to resize the window on the right side.

What is the current behavior?

Extending into the client area makes it hard or impossible to use controls due to the window resize overriding the control area on the left, right, and bottom borders.

Ex. if you have a scrolling item that has a collapsed scroll bar on the right side of your application. Because the client area extends into the right area the scroll bar is inaccessible due to the window resize margin.

image

What is the updated/expected behavior with this PR?

When extending only the top (title bar) should be extended into.

Breaking changes

May affect apps that wants resize to override on all sides? I'm not entirely sure this would be desired ever. When would an app want to resize into the resize margin?

@avaloniaui-bot
Copy link

You can test this PR using the following package version. 12.0.999-cibuild0060018-alpha. (feed url: https://nuget-feed-all.avaloniaui.net/v3/index.json) [PRBUILDID]

@BobbyCannon
Copy link
Contributor Author

I'm working on fixing the unit tests. I have fixes but I'm reviewing them one more time.

@BobbyCannon
Copy link
Contributor Author

OK, I have learned that my attempt to fix this only works when override just the title bar height of 32. It seems to not work properly when extending past (ex. 70).

@avaloniaui-bot
Copy link

You can test this PR using the following package version. 12.0.999-cibuild0060026-alpha. (feed url: https://nuget-feed-all.avaloniaui.net/v3/index.json) [PRBUILDID]

@avaloniaui-bot
Copy link

You can test this PR using the following package version. 12.0.999-cibuild0060034-alpha. (feed url: https://nuget-feed-all.avaloniaui.net/v3/index.json) [PRBUILDID]

@BobbyCannon
Copy link
Contributor Author

OK, I think this final commit is good. I would love feedback from the Avalonia team. If this is not acceptable then maybe instead I could add a bool to like UWP's TitleBar.ExtendViewIntoTitleBar, this way we can leave the left, right, and bottom border as is.

@avaloniaui-bot
Copy link

You can test this PR using the following package version. 12.0.999-cibuild0060102-alpha. (feed url: https://nuget-feed-all.avaloniaui.net/v3/index.json) [PRBUILDID]

@avaloniaui-bot
Copy link

You can test this PR using the following package version. 12.0.999-cibuild0060224-alpha. (feed url: https://nuget-feed-all.avaloniaui.net/v3/index.json) [PRBUILDID]

@avaloniaui-bot
Copy link

You can test this PR using the following package version. 12.0.999-cibuild0060271-alpha. (feed url: https://nuget-feed-all.avaloniaui.net/v3/index.json) [PRBUILDID]

@avaloniaui-bot
Copy link

You can test this PR using the following package version. 12.0.999-cibuild0060281-alpha. (feed url: https://nuget-feed-all.avaloniaui.net/v3/index.json) [PRBUILDID]

@avaloniaui-bot
Copy link

You can test this PR using the following package version. 12.0.999-cibuild0060355-alpha. (feed url: https://nuget-feed-all.avaloniaui.net/v3/index.json) [PRBUILDID]

@MrJul
Copy link
Member

MrJul commented Nov 27, 2025

The problem with this PR is that the requested client area isn't respected anymore: the initial Width value now becomes the frame's width instead of the client's, and the latter is shrunk. Height is something in-between. The client area is clipped 1px horizontally, but not vertically (on master, it's clipped on all sides, which still isn't correct but at least it's consistent).

Plus, since this PR only works with captions having a height > 32, we now have completely different behaviors depending on the height of the title bar.

As it is currently, we can't accept this PR.

That said, the idea has merits. In fact, I started reviewing this yesterday, found the size issue and hacked my way around. I came up with a start of a solution that seemed to worked well initially, and also solved the clipping issue that we have on master. Then I realized that I just added new problems when the window gets maximized, because we are special casing a lot of things in a lot of places.

I went down the rabbit hole. Deeply. We have hacks in every corner in this area, and they don't play well with each other. A lot of combinations of WindowState and SystemDecorations aren't working well together with ExtendClientAreaToDecorationsHint=true, whether it's weird margins, content being clipped, extra title bars or extra resize handles...

I initially just wanted to give you some pointers, but at the point where I am right now I'll just finish this work and open a new PR that will solve this issue, as well as several others. I'm also working on adding integration tests, because those scenarios are tedious to test manually, and so easy to break without realizing it. (Which is what happened through the years when other fixes got pushed).

Thank you for your understanding :)

@BobbyCannon
Copy link
Contributor Author

Can you reference the PR here once you create it? Also, I don't mind if the problem is solved another way, I just need a better resize experience. I wasn't sure my way was the "correct" way to solve it.

@avaloniaui-bot
Copy link

You can test this PR using the following package version. 12.0.999-cibuild0060455-alpha. (feed url: https://nuget-feed-all.avaloniaui.net/v3/index.json) [PRBUILDID]

@MrJul
Copy link
Member

MrJul commented Dec 4, 2025

@BobbyCannon I'm closing this in favor of #20217.

@MrJul MrJul closed this Dec 4, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants