-
-
Notifications
You must be signed in to change notification settings - Fork 931
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
Get current layout from workspace instead of g_pLayoutManager #6544
base: main
Are you sure you want to change the base?
Conversation
Makes no sense to split that though, as per-workspace layouts by the pure design of layouts cannot work properly. Am I missing something? |
Well, have to start with something. Too many changes to do it in one go. And it won't be easy to review it in one go... |
my numba 1 question would be: why? It adds complexity for no reason, tbh. Currently Hyprland is designed so that each "layout" is like a standalone window manager - so it's easy to swap them out and also write new ones using plugins. |
This will implement #622 |
I've had a plugin that does this for a while now. It does work and it's nice for people with multiple monitors that may have different sizes and/or orientations. Or just people who want different layouts in workspaces based on workflows/content etc. It works by adding a layout that just proxies layout calls to the "real" layout for a given workspace, and adding/removing windows from the 'real' layouts so a given window is never tracked by more than one layout. I think if the only layouts possible in hyprland were the two default ones, having native per-workspace layouts might seem a bit overkill. With plugins able to add as many layouts as users want, it might be nice to allow that extra flexibility. |
swapwindow between two workspaces will break this, for example. |
If my hacky proxy layout can deal with swapwindow across workspace/layout a native implementation of it can too. |
1184395
to
b16fb97
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
it it necessary to update the code, i think the original code was perfect.
Describe your PR, what does it fix/add?
Initial work on per workspace layouts. For now
CWorkspace::getCurrentLayout
just returnsg_pLayoutManager->getCurrentGlobalLayout()
. So any existing logic shouldn't be affected by these changes.Renamed
CLayoutManager::getCurrentLayout
to break the api and get conflicts with other PRs which may add new calls tog_pLayoutManager->getCurrentLayout
.Also removed calls to
getCurrentLayout
from layouts since it should point tothis
.Is there anything you want to mention? (unchecked code, possible bugs, found problems, breaking compatibility, etc.)
This code relies on
CWindow::m_pWorkspace
andCMonitor::activeWorkspace
being set before the calls togetCurrentLayout
.In some cases
getCurrentLayout
might be called on an incorrect workspace. This should not be an issue for now since all workspaces will return the same layout.When a window is moved to another workspace there are no checks that both workspaces have the same layout and only one of them gets updated. Again not an issue for now.
Is it ready for merging, or does it need work?
Ready for merging