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

doesn't support useless gaps #2

Open
DanielFGray opened this issue Jan 22, 2017 · 12 comments
Open

doesn't support useless gaps #2

DanielFGray opened this issue Jan 22, 2017 · 12 comments

Comments

@DanielFGray
Copy link

treesome added it with RobSis@256250d

hopefully wouldn't be too much trouble to add support for treetile?

@guotsuan
Copy link
Owner

Hi @DanielFGray ,

I should be no problems. I will add it as soon as possible

@DanielFGray
Copy link
Author

in awesome 4.0 the variable is useless_gap for native gaps, treesome was using useless_gap_width which was defined by the copycat-killer/lain library

@GrayJack
Copy link

Any news on this one?

@0xC0ncord
Copy link

0xC0ncord commented Oct 14, 2018

I've just created a pull request for this. After a long while of playing around with it, I was able to get useless_gap support working fine.

@mphe
Copy link

mphe commented Oct 14, 2018

That's pretty cool and works well, but it seems like the gap is about 1-2 pixel too small, as seen in the following screenshots.
The first one is with treetile and the second is with the default tile layout.

screenshot20181014162211
screenshot20181014162209

@0xC0ncord
Copy link

That's pretty cool and works well, but it seems like the gap is about 1-2 pixel too small

I think that has something to do with the tag's padding/border property. I noticed the issue before but it doesn't appear to be related to the useless_gap property directly. The effect is even more noticeable when you bump up useless_gap to something like 32. I haven't dug deep enough into other layouts' code to see where this effect comes from to find out how to fix it yet.

@mphe
Copy link

mphe commented Oct 14, 2018

I quickly looked into it and changed the two lines (507, 643) where useless_gap is set to this:

useless_gap = useless_gap * 2.0 + beautiful.border_width * 2

This seems to deliver correct gaps between the clients, but the outer border extends to the right/bottom respectively.
So, theoretically it should work when the available screen space is adapted to be border_width * 2 pixels smaller.
I tried adding 2 lines at the top of do_treetile, and it seems to work mostly, but not in some cases, like closing a window, which would sometimes lead to wrong sizes and overlaps (see screenshot).
Haven't found out yet how to consistently reproduce this.

local area = p.workarea
area.width = area.width - beautiful.border_width * 2;
area.height = area.height - beautiful.border_width * 2;

screenshot20181014172612

@0xC0ncord
Copy link

I think border_width is the property I was trying to track down while investigating this a while back. I'm still not certain what it is even supposed to do. The documentation states it's just "the client's border width" which doesn't tell me much of anything. There might be some answers in the lain layouts and how they deal with this.

@mphe
Copy link

mphe commented Oct 14, 2018

Well, it's the border drawn around clients. If that still doesn't help, try setting it to a higher value to make it more noticable.

@0xC0ncord
Copy link

Well, it's the border drawn around clients. If that still doesn't help, try setting it to a higher value to make it more noticable.

Aha. That's it. It doesn't look like border_width has anything to do with the spacing issue here... Even if I set border_width to some obscene number like 128 it doesn't appear to change the positioning of clients at all - it just adds an internal padding to the actual space that the client is allowed to draw on.

@0xC0ncord
Copy link

I stand corrected. Using the attached code I was able to get treetile's first horizontal split with only two clients to mimic the basic tile layout in the lain library perfectly, but after adding more clients and removing them it gets really weird and inconsistent. I haven't messed with resizing clients yet though.

init.lua.txt

@mphe
Copy link

mphe commented Oct 18, 2018

I've also been fiddling around with it for a bit and got it mostly working using the code modifications I mentioned earlier. Unfortunetly removing clients doesn't always work as it should. But I found out how to consistently reproduce it:

  • Open 6 windows, should look like this:
 _______ _______
|       |       |
|       |___ ___|
|       |   |___|
|_______|___|_|_|
  • Focus 3rd window (the one marked with an x)
 _______ _______
|       |       |
|       |___ ___|
|       |x  |___|
|_______|___|_|_|
  • Close it
  • Should now look like this:
 _______ _______
|       |       |
|       |_______|
|       |_______|
|_______|___|___|

The bottom two windows on the right side should now overlap.

Unfortunetly my understanding of the treetile code is rather limited, so I have no idea how to fix that. Maybe you have an idea.
Resizing is also broken, but was, as you said, already before.

Here's the code I used: init.lua.txt

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants