GithubHelp home page GithubHelp logo

useless gaps window misplacement about lain HOT 9 CLOSED

lcpz avatar lcpz commented on May 21, 2024
useless gaps window misplacement

from lain.

Comments (9)

lcpz avatar lcpz commented on May 21, 2024

I tried every layout without being able to reproduce.

This is a screenshot.

Is this happening with all layouts or just some of them? Can you provide a screenshot?

from lain.

shmibs avatar shmibs commented on May 21, 2024

it's effecting every layout for me. maybe it's something related to window border width? i'm using two-pixel borders, and it looks like you're using only one.
screenshot

EDIT: i took another look at your screenshot, and the error IS occuring for you as well. your gaps are 11 pixels at the top and left and 9 at the bottom and right, so i guess the issue is definitely a window-border problem.

from lain.

lcpz avatar lcpz commented on May 21, 2024

Tell me if this is ok.

Gist [deleted]
Screenshot

from lain.

shmibs avatar shmibs commented on May 21, 2024

it's symmetrical, which is definitely better, but now you have an 11 pixel
gap between windows and ten on the edges instead of the other way around.
how does that behave when you have windows sandwiched in between (i.e. 3
windows tall in fair mode)?

EDIT: after looking at the problem again, i think the proper way to express this would be something like this (please excuse the pseudocode; i don't know the names of everything =P):

g.width = round( (screen.width - useless_gap * (screen.client_x_count+1))/screen.client_x_count )

where screen.client_x_count is the number of clients across the screen at that position. stuff gets really messy, though (particularly if trying to disclude window borders from the gaps, as that means variable gap widths too), so it might not even be worth it to try to fix this. i think i'm just going to use

g.width = g.width - useless_gap
g.x = g.x + math.ceil(useless_gap * .25)

from lain.

lcpz avatar lcpz commented on May 21, 2024

I didn't understand how to measure gaps the way you do (in my previous screenshot I observed 10 px everywere, border_width included).

But since these "distance attempts" may take forever, why don't you patch and test the layouts yourself?

g.width = round( (screen.width - useless_gap * (screen.client_x_count+1))/screen.client_x_count )

if I am not mistaken can be translated like this:

g.width = round( (p.workarea.width - useless_gap * (num_x + 1))/num_x )

where round is a function like this:

local function round(num)
    return math.floor(num+0.5)
end

and:

    num_x = mycustomlayout.nmaster or awful.tag.getnmaster(t)

I think 1-2 pixels less or more is a little splitting hairs over it (If one is able to catch them!), but if you solve this I'll be glad to merge.

I'll give it another try later, anyway.

from lain.

lcpz avatar lcpz commented on May 21, 2024

I tried a different approach, git pull and let me know.

from lain.

shmibs avatar shmibs commented on May 21, 2024

i made a screenshot and marked out the different widths along with the nominal width when using uselessfair:
widths

from lain.

lcpz avatar lcpz commented on May 21, 2024

Are you sure this is the correct way to measure gaps?

Borders are part of a client. At least this is true for a layout arrange function.

This is what I measured:

widths

So you're having the issue only with the last column.

This is very weird, I have the same resolution and no misplacements.

from lain.

lcpz avatar lcpz commented on May 21, 2024

Closed by c4c149d.

from lain.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.