Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Which dimensions should resize increments be relative to? #3900

Open
madsmtm opened this issue Sep 4, 2024 · 6 comments
Open

Which dimensions should resize increments be relative to? #3900

madsmtm opened this issue Sep 4, 2024 · 6 comments
Labels
S - platform parity Unintended platform differences

Comments

@madsmtm
Copy link
Member

madsmtm commented Sep 4, 2024

Should they be relative to the window's dimensions, or the surface?

On macOS it's currently the surface, as that's what was decided in #2411 (comment), but perhaps that's wrong? @kchibisov why is this incorrect, when would you ever want your resize increments to be relative to the window's frame, i.e. including decorations?

Spun off from #3889.

@madsmtm madsmtm added the S - platform parity Unintended platform differences label Sep 4, 2024
@madsmtm
Copy link
Member Author

madsmtm commented Sep 4, 2024

As I understand it, the use-case for resize increments is terminal emulators, who want to make their terminal snap nicely to the size of a character. If that's the case, the resize increments should definitely be relative to the surface, otherwise you would still end up snapping halfway inside a character? Or is there something I'm not understanding here?

@kchibisov
Copy link
Member

kchibisov commented Sep 4, 2024

On macOS it's currently the surface, as that's what was decided in #2411 (comment), but perhaps that's wrong? @kchibisov why is this incorrect, when would you ever want your resize increments to be relative to the window's frame, i.e. including decoration

They generally apply for the whole thing, so increment for the whole window applies the same for the inner surfaces? However there's a case when only some surface will be resized.

Especially given that the decorations are fixed sized and don't grow if you grow the window.

It's a matter of a platform really, but on Wayland it's for window and all other methods are for window.

Surface has no events on Wayland other than scaling/rotation, and the only target for sizing suggestions is window.

@madsmtm
Copy link
Member Author

madsmtm commented Sep 4, 2024

the only target for sizing suggestions is window.

That seems like it'll only be useful in non-decorated windows, then? Or is there some way to make it work properly for decorated windows? If not, perhaps we should document that too?

@madsmtm
Copy link
Member Author

madsmtm commented Sep 4, 2024

Wait... Resize increments aren't even implemented on the Wayland backend?

@kchibisov
Copy link
Member

You implement resize increments on Wayland by tracking the live resize and _adjusting the window size the way you want.

They are useful regardless, since you set the step, and step will work correctly even if you have decorations around the window. And there's a way to account for decorations around the window anyway...

Maybe for surface it's fine, it's just when you have e.g. 3 surfaces inside one window, it's not clear how you'd use this API if it's not on window.

@madsmtm
Copy link
Member Author

madsmtm commented Sep 4, 2024

when you have e.g. 3 surfaces inside one window, it's not clear how you'd use this API if it's not on window.

True, if/when we consider sub surfaces, this will clearly only apply to a single surface - and on macOS, it can only apply to the root surface. But I'd punt on that for now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
S - platform parity Unintended platform differences
Development

No branches or pull requests

2 participants