-
Notifications
You must be signed in to change notification settings - Fork 599
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 dynamic layouts, tabbing and more #644
base: master
Are you sure you want to change the base?
Conversation
eaa8bd2
to
4ec3059
Compare
I improved the |
Actually, no, I think it is correct. If there is multiple selected tags and it isn't the first, then the layout in suspended. As with the current system, when multiple tags are selected, the first tag layout is used. I did some tests. It seem to work |
4ec3059
to
908b4bd
Compare
Rebased and updated |
0cfa30d
to
48fb69f
Compare
Updated, ready for review @psychon I implemented a different solution from the one you proposed. Using a parallel implementation of hierarchy traversing wasn't really working. Many widgets expect a certain sequence, so making it work was almost re-implementing hierarchy. The solution proposed in the commit is a little hacky, but cleaner than the other (IMO). |
Here are some selected (I removed things like "unused loop variable) warnings from Luacheck: Checking lib/awful/layout/dynamic/base.lua
Checking lib/awful/layout/dynamic/resize.lua
Checking lib/awful/layout/dynamic/wrapper.lua
|
lib/gears/matrix.lua
Outdated
function matrix:set_mutating(mutate) | ||
rawset(self, "_automerge", mutate) | ||
end | ||
|
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.
I don't like all of this change to gears.matrix
. I made matrices immutable on purpose so that e.g. I don't have to return a copy from functions in wibox.hierarchy
, but can just return the internal matrix. If a matrix is immutable, you don't need to save/restore it, but can just keep the old instance around (in a stack?).
Let's see what you are using this for in the other commits...
Apparently I have to require this separately, Edit:
I can't even require it, I have to add Edit: Which means that the example that I copied from somewhere is wrong Edit:
I give up. This is just plain broken. |
This is so broken, you may only reopen this once you added unit tests to this which cover at least 50% of the new code. Meh. |
Or can you at least tell me how to test this since apparently I didn't do the right thing from looking at the docs? |
I'm sorry I were so harsh and will try to be less angry when things break. |
Better take the
Thanks, it was indeed a little harsh. Ready for review ~= ready to merge, it just imply I fixed the issues you pointed in the last round. You are also right this badly need tests. I will write them. It is not as broken as you think it is. Considering only the tile layout is properly implemented (the others are there, but incomplete and somewhat broken). The bugs are:
Note that the "dynamic" branch of my collision module need to be up-to-date. Resizing can be done using the usual keybindings, but the "better" version is mod4+alt+arrows to increase size and mod4+alt+shift+arrows to reduce it. If you get any errors, forward them here. also note that the mouse resize implemented by this PR is more advanced than the current one (and the code is also simpler, as long as the reader did some matrix math before). It support "side" resize, like left/right/up/down instead of corner only like the old implementation. It also support proper keyboard resize, the old implementation did not. It is also layout agnostic, unlike the previous code. |
48fb69f
to
49bb36c
Compare
a73db8c
to
58eb3ac
Compare
2425727
to
c19c3f4
Compare
Updated. I removed the fake context, then it still didn't always work (the same corner cases as last time, no surprises here). It also added 5 new "standard" method to the widget API for almost no reason, which is ugly and confusing. After that I reverted that commit and created a new "domain specific" context, but with @psychon [1] including those who alter the CR matrix in the before__/after__, but not the clip (previously, the code would not cause error, but would do nothing). So not "all" widgets/layouts/containers are compatible, a little regression compared to my previous cairo context shim. I also force the translation back, I will have to re-implement more of wibox.hierarchy.draw to avoid doing this. |
If you really want this to use a cairo context, use an unbounded cairo recording surface as the target of the cairo context. Just, please, don't try to create a fake cairo context. |
That's a really good work that you have done here. It was the only thing that was really missing from Awesomewm. |
@Sinvers sorry for the delay, it has been "I will find time tomorrow" for a month now.
No, you are doing it right. The commit message has The issue is that by the time the client is added to the layout, it already has focus and as it can't split itself, it falls back to the largest remaining client. So the fallback code is the only one that can be reached unless you add some However I never patched the I will close this PR and open a new once I found a better name and added regression tests for minimization, maximization and master_fill_policy. @blueyed I can no longer reproduce the bug you had last year, mind trying again with the version from my |
@Elv13 Thanks for the precise answer, I'll check this out ! |
There is any ETA for this PR to be merged? |
@GrayJack depends on user feedback is it working fine for you? |
I don't use it, since I don't know witch branch to clone to compile it What is the branch, cause I really want to test it!! Or a easy way to get a .patch file so can git the master and patch it before compiling |
Elv13 upstream_dynamic_p7 is the branch for this PR, there is a more advanced one, but it has a couple minor regressions regarding floating clients (but has more testable code, which isn't a factor for people who want to try it) The doc is here https://elv13.github.io/libraries/dynamite.html If you want to help, resolve all code comments here: |
And where I can find a example of rc.lua |
The rc.lua is the same, you just need to include |
What is the regression for floating? if is something minor, I don't mind using the more updated branch 😄 |
Try the |
I want to do something like i3, dynamic split + both types of stack. One thing I don't understand about your documentation I where I define my layouts, is it inside the |
It has all the feature to do that, for now it's a bit low level and non-trivial to use them, but it's definitely there.
By default it uses the same layouts as Awesome. If you want to add new layouts, you can add them there is directly set them on the tag (see my tyrannical module). In the near term, this pull request was recently merged #2360 and will make this easier to manage going forward. |
Ok, i put |
You are probably missing a If the error isn't a missing |
What's the current situation of this? |
Unchanged. It works fine and is usable in production. There's another, newer, version that has some improvements regarding unit testing, but has some regressions. This project is too impractical to merge during Awesome 4.x lifetime so is maintained out-of-tree. Some parts get merged as time pass, but I have very limited time to work on these things, so other AwesomeWM related project get more attention than this. Currently finishing the notification rewrite and getting v4.4 into shape is the priority. |
Idea: There should be a possibility of enforcing tabs via rules, so that e.g. every new instance of //Edit: I've been using the |
@Elv13 any status update? When is it planed to be merged into master? |
Time for the yearly status update questoom x) |
For now there are:
Getting this PR merged cannot happen during the 4.x lifecycle and has to wait for 5.0. The code here still works and still does what it claims to do. As of now 4.4 is getting close. It was "supposed" to be the last 4.x, but I don't have enough time/energy to finish all the features I originally planned, so it looks like there is still room for a 4.5 before getting to the point where bumping the default API level to 5 becomes worthwhile. As for "why can't you just merge it and leave it disabled by default", this PR is missing an important chunk. Right now, AwesomeWM has some "layers" for clients like ontop/below/above and a |
Woaw thank you for the great explanation and the links! |
This is the whole dynamic layout system. I stopped doing small PR with this because it became untestable/useless without the other parts. I still plan to split a couple of PRs out of this before calling this non-experimental.
I run this code since January 2016. For me, it is trouble free.
Use cases:
manual
layout/tags to save and restore the layout as they are.However, I am aware of a few major issues:
Size honoring is not supported, it just create weird resizing bugs. I know how to fix it, I just want feedback first.[DONE]2 layout suits are broken, corner and treesome (i3 layout). I don't use them, they are easy to fix, it is not a priority for now.There is a few "off by one" bugs leaving 1px gaps between clients, I solve one every now and then, it is not that bad anymore.[DONE (I think)]Minor issues:
Features not fully implemented:
Random splitters: It works fine, but I don't like the API, it will use the newly merged[DONE]awful.placement
API, but this is not done yet, it still have a somewhat hardcoded API.documentation: The suits are very well documented, but nothing else is.[DONE]API changes to come: (updated 2017)
Merge all layout description into a single documentation guide/pageDONE:reset()
for all layoutsthe "multiple resize mode" for the ratio layouts are still unmerged[DONE]merge the grid layout with resize supportDONEadd offset to the stack layoutratio
property (once, then update it when changed)make it trivial to use different layouts depending on the client count (necessary for the corner layout)enable "garbage" layout collection in[DONE]base_layout
andbase_stack
(can be disabled)request::geometry
with{slave=true}
or{master = true}
as hint (and use it in awful.client and awful.ewmh)base_stack
base
andtabbed
with their own module namespacefloating
base layoutIt has tests now, I found only 3 very minor bugs when writing them. It doesn't have full coverage, but it is quite close. Some tests fail due to the off-by-one pixel bugs mentioned above. It also has "some" (read: many) luacheck warnings. I will fix that soon-ish, none are really hitting critical paths, most of them are unused loop variables.
Missing tests:
RFC:
Widget resize API
Where
args
has adirection
,direction_x
,direction_y
"official" arguments.