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
Implement dragging and resizing of borderless window #7952
base: master
Are you sure you want to change the base?
Implement dragging and resizing of borderless window #7952
Conversation
0967b05
to
efc9899
Compare
efc9899
to
889cf7f
Compare
Upon first look at this PR a lot of things come to mind:
All that said, I don't expect all these points to necessarily be addressed in a single PR, I just view them as related. As for this PR, I did notice some bugs with the cursor setting. The easiest to replicate is if you start a selection and drag into the top padding area. The cursor will flicker between a move cursor and the default, and depending on the state it's in when you release, it may be broken thereafter. I also don't know why the SE corner is special, I would expect to be able to resize from any corner, no? |
Yes
No valid usecases.
This is a separate issue. |
Really? Because without |
I can't comment on macOS as I don't use it. I just try to make the decoration-less mode more usable.
Personally I have no issue with the small padding I have to hit to move the window, and I like that it is slim and symmetric and configurable as it is.
Moving the window using the other paddings is not quite intuitive to me, and is not necessary. I imagine it as a collapsed title bar, not the border gaining dragging powers.
Can't comment on macOS.
Will try to fix that, thanks.
I went for the minimalistic approach here (or call me lazy 😄), with my implementation you can already position and resize the window arbitrarily. There's also a precedent of things that are only resizable using the bottom-right corner, like this textarea field in the browser for example. But if people would require to resize from all corners, that can surely be done. |
I would strongly push for resizing from both bottom corners at least. |
7499be2
to
98cb89a
Compare
…ursor, refactoring
98cb89a
to
4affc9f
Compare
I addressed the flicker issue, enabled resizing on the south-east corner as well, and in general refactored my changes to put things in better places and make it easier to read and extend, I hope. Feel free to have a second try. |
Sadly my Windows machine is currently broken and testing this on macOS seems to yield different results (all corners and edges allow resizing, as expected). I'll leave it to someone else to confirm this PR unless I get the time to put windows on an old laptop I've got lying around again. |
Hi, I like using alacritty without decorations (on windows, that's the only alternative to full title bar), but I found it difficult to move and resize the window.
I saw that winit provides the
drag_window
anddrag_resize_window
functions for the use case of defining custom click target areas to move and resize a window.So I implemented moving the window when dragging the top padding, and resizing it when dragging the bottom-right corner padding, as well as corresponding
CursorIcon
changes.I hope you like it, I am happy about any criticism.