-
Notifications
You must be signed in to change notification settings - Fork 199
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
Move windows with mouse #564
Comments
Looking for the same functionality :( |
Hi, I'm currently exploring how to implement this feature. Although I have much to learn about the Windows API, I’m eager to contribute, especially because I would love to use this feature myself. Here's a brief outline of how I envision implementing it:
As @HolbyFPV mentioned on Discord, some windows might not have a title bar. In such cases, we can combine a keyboard key with a mouse drag to move the window. Ultimately, the same approach should work for both scenarios. I’ve looked at your platform code, and it seems we need to handle the WM_ENTERSIZEMOVE event to listen for both window drag and resize exits. (The resize part could be a separate issue, in my opinion). I haven't delved much further into this yet because I want to ensure no one else is already working on it and to confirm that it’s okay for me to proceed. Looking forward to your feedback! |
@LucaCoduriV Yeah absolutely, feel free to take a stab at it. The latest development branch is There's a really cool POC that @Pamesta actually did a while back which might be a useful reference (demo video). Their branch is here. There's different ways to approach the window move behavior and I'm not sure what's best. A couple things to consider:
IMO ideally we could have an implementation where it's just purely mouse click and drag, but if it really calls for it, it might be useful to have different behaviors if a specific key is held down. |
@LucaCoduriV it seems like you are on a good path 👍 @lars-berger brings up the tricky part of this implementation. If we had a way of previewing the placement before actually re-tiling, then we could easily support all of those bullet points. But without it, I'm afraid users would be unsure of what the behavior will be when the let go of their mouse. Maybe if we provided enough configuration settings we could make it work for enough people without any sort of preview. The glaring issue with preview is that it would require including a UI library which GWM currently has none (thanks to Zebar). So I'm not sure how in scope this is. If anyone reading has any .gifs of this feature in other WMs they want to mention here as inspiration, feel free! |
@lars-berger Yep, I know that's an other reason why I want to help haha, I love rust.
I don't think that this feature is really interesting. Wouldn't it be easier to just press a key while hovering a window to make it floating or tiled ?
Based on Hyprland
I am not sure if this is really important, I never had a preview while using this feature. It even might complicate things a lot because with a preview windows will move and we will need to find a way to not fall in a "recursive window moving every where" haha. |
I am delving deeper into your code and have a few questions. // Snap window to its original position if it's the only window in the
// workspace.
if parent.is_workspace() && window.tiling_siblings().count() == 0 {
state.pending_sync.containers_to_redraw.push(window.into());
return Ok(());
} In this code you are looking for siblings, but I am not sure to understand what a sibling is. My second question is about containers pub enum Container {
Root(RootContainer),
Monitor(Monitor),
Workspace(Workspace),
Split(SplitContainer),
TilingWindow(TilingWindow),
NonTilingWindow(NonTilingWindow),
} It seems each container type can have both a child and a parent, including RootContainer. Is this a possible scenario? If so, why? Also, is there a defined hierarchy? For instance, are workspaces always contained within monitors? If that's the case, why did you choose to use an enum instead of direct types? Thank you for your answers; they will help me a lot. 😃 |
That behavior sounds great 👍
If a workspace has windows 1, 2, and 3, then window 2 + 3 are siblings of window 1. It’s the same with workspaces and monitors. The main state of the application is a tree where root -> monitors -> workspaces -> windows/split containers. The root is the only container that doesn’t have a parent. It’s represented as an enum because a) workspaces can have both windows + split containers as children b) some functions can return multiple container types (e.g. the focused container getter can either return a window or a workspace). |
I've already made a draft pull request #635 I am not sure, but I think that it should be possible to link this issue to my PR. |
Nice implement @LucaCoduriV ! I don't know currently tiling direction is determined by dragged position or have to manually change by hotkey |
@MisteryMonster With @lars-berger, we are discussing to have something better than the behavior of Hyprland. But don't worry something better than now should come out (soon I hope). |
Closing this one in favor of #641 @LucaCoduriV's cooked up another pr which addresses issues with the current implementation, so should be landing soon 👍 |
🎉 This issue has been resolved in version 3.2.0 🎉 The release is available on GitHub release Your semantic-release bot 📦🚀 |
Is it possible to move windows between monitors with the mouse like u can do on FancyWM and Komorebi?
The text was updated successfully, but these errors were encountered: